Exemple #1
0
 /**
  * Returns iterator (yield values).
  *
  * @return mixed
  */
 public function getIterator()
 {
     foreach ($this->persistence->prepareIterator($this) as $data) {
         $this->data = $this->persistence->typecastLoadRow($this, $data);
         $this->id = $data[$this->id_field];
         $this->hook('afterLoad');
         (yield $this->id => $this);
     }
     $this->unload();
 }