curRow = 0; $this->list = $list; } /** * How many elements have * @return int */ public function count() { return count($this->list); } /** * Ask the Iterator is exists more rows. Use before moveNext method. * @return bool True if exist more rows, otherwise false */ public function hasNext() { return ($this->curRow < $this->count()); } /** * Return the next row. * * @return Row */ public function moveNext() { if (!$this->hasNext()) { return null; } return $this->list[$this->curRow++]; } public function key() { return $this->curRow; } }