Source API for the «PorteIterator» class

Represent a list of records by implementation of the PHP Iterator and Countable interfaces.

PHP magic methods

__construct

This method is not yet documented.

__get

This method is not yet documented.

__call

This method is not yet documented.

Public methods

current

Implement the "current" method of the PHP native Iterator interface.

return
mixed
Returns current value.
key

Return the key of the current element.

Implement the "key" method of the PHP native Iterator interface.

return
mixed
Returns scalar on success, integer 0 on failure.
next

Move forward to next element.

Implement the "next" method of the PHP native Iterator interface.

return
mixed
Returns next value.
prev

Move backward to previous element.

Note, this method is not part the PHP navite Iterator interface.

return
mixed
Returns previous value.
rewind

Rewind the Iterator to the first element.

Implement the "rewind" method of the PHP native Iterator interface.

return
mixed
The value of the first array element, or FALSE if the array is empty.
valid

Checks if current position is valid.

Implement the "valid" method of the PHP native Iterator interface.

return
boolean
Wether the iterated array is in a valid state or not.
shift

Shift the current element off the iterator. An exemple calling the "shift" method in a while loop is available in sample/iterator/shift.php. Note this sample exemple executed in a foreach loop will fail.

count

Count the number of stored elements.

Implement the "count" method of the PHP native Countable interface.

return integer Number of stored elements.

toArray

This method is not yet documented.

toJson

This method is not yet documented.