Ejemplo n.º 1
0
 /**
  *
  */
 public function prepare()
 {
     $this->fetched = $this->fetch();
     $this->fetched->rewind();
     $this->filtered = $this->filter($this->fetched);
     $this->filtered->rewind();
     $this->sorted = $this->sort($this->filtered);
     $this->sorted->rewind();
 }
<?php

$h = new SplPriorityQueue();
$h->insert(1, 1);
$h->insert(5, 5);
$h->insert(0, 0);
$h->insert(4, 4);
$h->rewind();
echo "count(\$h) = " . count($h) . "\n";
echo "\$h->count() = " . $h->count() . "\n";
while ($h->valid()) {
    $k = $h->key();
    $v = $h->current();
    echo "{$k}=>{$v}\n";
    $h->next();
}
?>
===DONE===
 /**
  * {@inheritdoc}
  */
 public function rewind()
 {
     $this->queue->rewind();
 }