| 7 queue_example.module | queue_example_retrieve_queue($queue_name) |
| 8 queue_example.module | queue_example_retrieve_queue($queue_name) |
Retrieves the queue from the database for display purposes only.
It is not recommended to access the database directly, and this is only here so that the user interface can give a good idea of what's going on in the queue.
Parameters
$queue_name: The name of the queue from which to fetch items.
Related topics
2 calls to queue_example_retrieve_queue()
File
- queue_example/
queue_example.module, line 229 - Examples demonstrating the Drupal Queue API.
Code
function queue_example_retrieve_queue($queue_name) {
$items = array();
$result = db_query("SELECT item_id, data, expire, created FROM {queue} WHERE name = :name ORDER BY item_id",
array(':name' => $queue_name),
array('fetch' => PDO::FETCH_ASSOC));
foreach ($result as $item) {
$items[] = $item;
}
return $items;
}
Login or register to post comments