Class PaginatorIterator

Summary

Fully Qualified Name: Zend\Paginator\PaginatorIterator
Implements: OuterIterator

Description

Class allowing for the continuous iteration of a Zend\Paginator\Paginator instance.

Useful for representing remote paginated data sources as a single Iterator

Methods

Name Description Defined By
__construct() PaginatorIterator
current() Return the current element PaginatorIterator
getInnerIterator() Returns the inner iterator for the current entry. PaginatorIterator
key() Return the key of the current element PaginatorIterator
next() Move forward to next element PaginatorIterator
rewind() Rewind the Iterator to the first element PaginatorIterator
valid() Checks if current position is valid PaginatorIterator

Method Details

__construct()

Parameter Name Type Description
$paginator

Returns: void

current()

Return the current element

Returns: mixed Can return any type.

getInnerIterator()

Returns the inner iterator for the current entry.

Returns: \Iterator The inner iterator for the current entry.

key()

Return the key of the current element

Returns: mixed scalar on success, or null on failure.

next()

Move forward to next element

Returns: void Any returned value is ignored.

rewind()

Rewind the Iterator to the first element

Returns: void Any returned value is ignored.

valid()

Checks if current position is valid

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

Top