You are here

public function DatabaseQueue::loadItem in Queue UI 8.2

Load a specified SystemQueue queue item from the database.

Parameters

int $item_id: The item id to load

Return value

mixed Result of the database query loading the queue item.

Overrides QueueUIBase::loadItem

File

src/Plugin/QueueUI/DatabaseQueue.php, line 111

Class

DatabaseQueue
Defines the default Drupal Queue UI backend

Namespace

Drupal\queue_ui\Plugin\QueueUI

Code

public function loadItem($item_id) {

  // Load the specified queue item from the queue table.
  $query = $this->database
    ->select('queue', 'q')
    ->fields('q', [
    'item_id',
    'name',
    'data',
    'expire',
    'created',
  ])
    ->condition('q.item_id', $item_id)
    ->range(0, 1);

  // item id should be unique
  return $query
    ->execute()
    ->fetchObject();
}