You are here

public function BatchQueueMongodb::getAllItems in MongoDB 8

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

src/BatchQueueMongodb.php, line 75
QueueMongodb functionality.

Class

BatchQueueMongodb
MongoDB batch queue implementation.

Namespace

Drupal\mongodb

Code

public function getAllItems() {
  $result = [];
  $items = $this
    ->mongoCollection()
    ->find()
    ->sort([
    '_id' => 1,
  ]);
  foreach ($items as $item) {
    $result[] = unserialize($item['data']);
  }
  return $result;
}