public function Batch::getAllItems

Retrieves all remaining items in the queue.

This is specific to Batch API and is not part of the Drupal\Core\Queue\QueueInterface.

Return value

array An array of queue items.

File

drupal/core/lib/Drupal/Core/Queue/Batch.php, line 48
Definition of Drupal\Core\Queue\Batch.

Class

Batch
Defines a batch queue handler used by the Batch API.

Namespace

Drupal\Core\Queue

Code

public function getAllItems() {
  $result = array();
  $items = db_query('SELECT data FROM {queue} q WHERE name = :name ORDER BY item_id ASC', array(
    ':name' => $this->name,
  ))
    ->fetchAll();
  foreach ($items as $item) {
    $result[] = unserialize($item->data);
  }
  return $result;
}