Example #1
0
 public function run()
 {
     if (!$this->generator) {
         throw new Exception("");
     } elseif (!$this->closed) {
         throw new Exception("");
     }
     $this->closed = false;
     $this->generator->rewind();
     return $this->generator->current();
 }
Example #2
0
 public function rewind()
 {
     if ($this->_tryToCreateGenerator()) {
         $this->_currentGen = call_user_func($this->_gen);
         return $this->_currentGen->rewind();
     }
     $this->_loadRecords();
     return reset($this->_records);
 }
 /**
  * @inheritdoc
  */
 public function rewind()
 {
     $this->generator->rewind();
 }