Example #1
0
 /**
  * (PHP 5 &gt;= 5.0.0)<br/>
  * Move forward to next element
  * @link http://php.net/manual/en/iterator.next.php
  * @return void Any returned value is ignored.
  */
 public function next()
 {
     $this->current = $this->driver->fetchAssoc($this->result);
     if (null === $this->current) {
         $this->valid = false;
         $this->position = -1;
     } else {
         $this->valid = true;
         if ($this->resultClass) {
             /** @var Contract $class */
             $class = $this->resultClass;
             $this->current = $class::fromArray($this->current, null, true);
         }
         ++$this->position;
     }
 }