function Memory::createItem
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Queue/Memory.php \Drupal\Core\Queue\Memory::createItem()
- 10 core/lib/Drupal/Core/Queue/Memory.php \Drupal\Core\Queue\Memory::createItem()
- 11.x core/lib/Drupal/Core/Queue/Memory.php \Drupal\Core\Queue\Memory::createItem()
Overrides QueueInterface::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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.