queue)) { reset($this->queue); return current($this->queue); } 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 = []; foreach ($this->queue as $item) { $result[] = $item->data; } return $result; } }