Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Batch.php

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

core/lib/Drupal/Core/Queue/Batch.php, line 50

Class

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

Namespace

Drupal\Core\Queue

Code

public function getAllItems() {
    $result = [];
    try {
        $items = $this->connection
            ->select('queue', 'q')
            ->fields('q', [
            'data',
        ])
            ->condition('name', $this->name)
            ->orderBy('item_id', 'ASC')
            ->execute()
            ->fetchAll();
        foreach ($items as $item) {
            $result[] = unserialize($item->data);
        }
    } catch (\Exception $e) {
        $this->catchException($e);
    }
    return $result;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal