connection->queryRange('SELECT [data], [item_id] FROM {queue} q WHERE [name] = :name ORDER BY [item_id] ASC', 0, 1, [':name' => $this->name])->fetchObject(); if ($item) { $item->data = unserialize($item->data); return $item; } } catch (\Exception $e) { $this->catchException($e); } return FALSE; } /** * Retrieves all remaining items in the queue. * * This is specific to Batch API and is not part of the * \Drupal\Core\Queue\QueueInterface. * * @return array * An array of queue items. */ public function getAllItems() { $result = []; try { $items = $this->connection->query('SELECT [data] FROM {queue} q WHERE [name] = :name ORDER BY [item_id] ASC', [':name' => $this->name])->fetchAll(); foreach ($items as $item) { $result[] = unserialize($item->data); } } catch (\Exception $e) { $this->catchException($e); } return $result; } }