}
function fetchRow() {
- $this->currentRow = $this->result[$this->pos++];
+ if ( $this->pos < count( $this->result ) ) {
+ $this->currentRow = $this->result[$this->pos];
+ } else {
+ $this->currentRow = false;
+ }
+ $this->pos++;
return $this->currentRow;
}
// Callers want to be able to access fields with $this->fieldName
function fetchObject() {
- $this->currentRow = $this->result[$this->pos++];
- return (object)$this->currentRow;
+ $this->fetchRow();
+ if ( $this->currentRow ) {
+ return (object)$this->currentRow;
+ } else {
+ return false;
+ }
}
function rewind() {
$this->pos = 0;
$this->currentRow = null;
}
+
+ function next() {
+ return $this->fetchObject();
+ }
}
/**