You are here

public function QueueService::selectPage in Purge 8.3

Select a page of queue data with a limited number of items.

This method facilitates end-user inspection of the queue by letting it select a set of data records, without the ability to further interact with the returned data. The items returned aren't claimed and no action is taken on them.

Parameters

int $page: Pages always start at 1 and the highest available page is returned by ::selectPageMax(), which bases its information on the set limit that in turn gets returned by selectPageLimit(). When page numbers are given without any data in it, the resulting return value will be empty.

Return value

\Drupal\purge\Plugin\Purge\Invalidation\ImmutableInvalidationInterface[] Immutable invalidation objects, which aren't usable besides data display.

Overrides QueueServiceInterface::selectPage

See also

\Drupal\purge\Plugin\Purge\Queue\QueueServiceInterface::selectPageLimit

\Drupal\purge\Plugin\Purge\Queue\QueueServiceInterface::selectPageMax

File

src/Plugin/Purge/Queue/QueueService.php, line 497

Class

QueueService
Provides the service that lets invalidations interact with a queue backend.

Namespace

Drupal\purge\Plugin\Purge\Queue

Code

public function selectPage($page = 1) {
  $this
    ->initializeQueue();
  $this
    ->commit();
  $immutables = [];
  foreach ($this->queue
    ->selectPage($page) as $item) {
    $immutables[] = $this->purgeInvalidationFactory
      ->getImmutableFromQueueData($item->data);
  }
  return $immutables;
}