function BatchMemory::getAllItems

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Queue/BatchMemory.php \Drupal\Core\Queue\BatchMemory::getAllItems()
  2. 10 core/lib/Drupal/Core/Queue/BatchMemory.php \Drupal\Core\Queue\BatchMemory::getAllItems()
  3. 11.x core/lib/Drupal/Core/Queue/BatchMemory.php \Drupal\Core\Queue\BatchMemory::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

core/lib/Drupal/Core/Queue/BatchMemory.php, line 43

Class

BatchMemory
Defines a batch queue handler.

Namespace

Drupal\Core\Queue

Code

public function getAllItems() {
    $result = [];
    foreach ($this->queue as $item) {
        $result[] = $item->data;
    }
    return $result;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.