statement->closeCursor(); unset($this->statement); } /** * * Moves row set pointer to first element. * */ public function rewind() { $this->key = -1; $this->next(); } /** * * Returns value at current position. * * @return mixed * */ public function current() { return $this->row; } /** * * Returns key at current position. * * @return mixed * */ public function key() { return $this->key; } /** * * Fetches next row from statement. * */ abstract public function next(); /** * * Detects if iterator state is valid. * * @return bool * */ public function valid() { return $this->row !== false; } }