ResultIterator
class ResultIterator implements Iterator, Countable
External result set iterator.
This can be returned by Result::getIterator() method or using foreach
$result = dibi::query('SELECT * FROM table');
foreach ($result as $row) {
print_r($row);
}
unset($result);
Methods
void
rewind()
Rewinds the iterator to the first element.
mixed
key()
Returns the key of the current element.
mixed
current()
Returns the current element.
void
next()
Moves forward to next element.
bool
valid()
Checks if there is a current element after calls to rewind() or next().
int
count()
Required by the Countable interface.
Details
at line 40
__construct(Result $result)
No description
at line 50
void
rewind()
Rewinds the iterator to the first element.
at line 62
mixed
key()
Returns the key of the current element.
at line 72
mixed
current()
Returns the current element.
at line 82
void
next()
Moves forward to next element.
at line 93
bool
valid()
Checks if there is a current element after calls to rewind() or next().
at line 103
int
count()
Required by the Countable interface.
Traits
Better OOP experience.