You are here

public function PriorityQueue::getIterator in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-stdlib/src/PriorityQueue.php \Zend\Stdlib\PriorityQueue::getIterator()

Retrieve the inner iterator

SplPriorityQueue acts as a heap, which typically implies that as items are iterated, they are also removed. This does not work for situations where the queue may be iterated multiple times. As such, this class aggregates the values, and also injects an SplPriorityQueue. This method retrieves the inner queue object, and clones it for purposes of iteration.

Return value

SplPriorityQueue

File

vendor/zendframework/zend-stdlib/src/PriorityQueue.php, line 165

Class

PriorityQueue
Re-usable, serializable priority queue implementation

Namespace

Zend\Stdlib

Code

public function getIterator() {
  $queue = $this
    ->getQueue();
  return clone $queue;
}