public function PriorityQueue::insert in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/zendframework/zend-stdlib/src/PriorityQueue.php \Zend\Stdlib\PriorityQueue::insert()
Insert an item into the queue
Priority defaults to 1 (low priority) if none provided.
Parameters
mixed $data:
int $priority:
Return value
1 call to PriorityQueue::insert()
- PriorityQueue::unserialize in vendor/
zendframework/ zend-stdlib/ src/ PriorityQueue.php - Unserialize a string into a PriorityQueue object
File
- vendor/
zendframework/ zend-stdlib/ src/ PriorityQueue.php, line 62
Class
- PriorityQueue
- Re-usable, serializable priority queue implementation
Namespace
Zend\StdlibCode
public function insert($data, $priority = 1) {
$priority = (int) $priority;
$this->items[] = [
'data' => $data,
'priority' => $priority,
];
$this
->getQueue()
->insert($data, $priority);
return $this;
}