return new \
IteratorIterator($statement);
} /**
* Position the iterator to the following row.
*/
protected function fetchNextRow() { $this->
getIterator()->
next();
// We might be out of data entirely, or just out of data in the current
// batch. Attempt to fetch the next batch and see.
if ($this->batchSize > 0 && !
$this->
getIterator()->
valid()) { $this->
fetchNextBatch();
} } /**
* Prepares query for the next set of data from the source database.
*/
protected function fetchNextBatch() { $this->batch++;
unset($this->iterator
);
$this->
getIterator()->
rewind();
}