result = $array; } /** * @return int */ function numRows() { return count( $this->result ); } /** * @return array|bool */ function fetchRow() { if ( $this->pos < count( $this->result ) ) { $this->currentRow = $this->result[$this->pos]; } else { $this->currentRow = false; } $this->pos++; if ( is_object( $this->currentRow ) ) { return get_object_vars( $this->currentRow ); } else { return $this->currentRow; } } function seek( $row ) { $this->pos = $row; } function free() { } /** * Callers want to be able to access fields with $this->fieldName * @return bool|stdClass */ function fetchObject() { $this->fetchRow(); if ( $this->currentRow ) { return (object)$this->currentRow; } else { return false; } } function rewind() { $this->pos = 0; $this->currentRow = null; } /** * @return bool|stdClass */ function next() { return $this->fetchObject(); } }