1 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

array $queue_name: The name of the queue from which to fetch items.

Related topics

File

modules/examples/queue_example/queue_example.module, line 289
Examples demonstrating the Backdrop 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;
}