public function Memory::createItem in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Queue/Memory.php \Drupal\Core\Queue\Memory::createItem()
- 9 core/lib/Drupal/Core/Queue/Memory.php \Drupal\Core\Queue\Memory::createItem()
File
- core/
lib/ Drupal/ Core/ Queue/ Memory.php, line 44
Class
- Memory
- Static queue implementation.
Namespace
Drupal\Core\QueueCode
public function createItem($data) {
$item = new \stdClass();
$item->item_id = $this->idSequence++;
$item->data = $data;
$item->created = \Drupal::time()
->getCurrentTime();
$item->expire = 0;
$this->queue[$item->item_id] = $item;
return $item->item_id;
}