class DataIterator implements Countable, Iterator (View source)

Class DataIterator

Methods

__construct(AbstractReader $reader, string $class = 'stdClass')

Constructor.

__destruct()

Database iterator destructor.

mixed
current()

Return the current element

void
next()

Move forward to next element

mixed
key()

Return the key of the current element

boolean
valid()

Checks if current position is valid

void
rewind()

Rewind the Iterator to the first element

int
count()

Count elements of an object

Details

at line line 54
__construct(AbstractReader $reader, string $class = 'stdClass')

Constructor.

Parameters

AbstractReader $reader
string $class

at line line 67
__destruct()

Database iterator destructor.

at line line 77
mixed current()

Return the current element

Return Value

mixed Can return any type.

at line line 87
void next()

Move forward to next element

Return Value

void Any returned value is ignored.

at line line 103
mixed key()

Return the key of the current element

Return Value

mixed scalar on success, or null on failure.

at line line 114
boolean valid()

Checks if current position is valid

Return Value

boolean The return value will be casted to boolean and then evaluated. Returns true on success or false on failure.

at line line 124
void rewind()

Rewind the Iterator to the first element

Return Value

void Any returned value is ignored.

at line line 133
int count()

Count elements of an object

Return Value

int The custom count as an integer.