class Map_Iterator implements Iterator (View source)

deprecated 4.13.0 Will be removed without equivalent functionality to replace it

Builds a map iterator around an Iterator. Called by Map

Methods

__construct(Iterator $items, string $keyField, string $titleField, array $firstItems = null, array $lastItems = null)

No description

mixed
rewind()

Rewind the Iterator to the first element.

mixed
current()

Return the current element.

string
key()

Return the key of the current element.

mixed
next()

Move forward to next element.

bool
valid()

Checks if current position is valid.

Details

__construct(Iterator $items, string $keyField, string $titleField, array $firstItems = null, array $lastItems = null)

Parameters

Iterator $items

The iterator to build this map from

string $keyField

The field to use for the keys

string $titleField

The field to use for the values

array $firstItems

An optional map of items to show first

array $lastItems

An optional map of items to show last

mixed rewind()

Rewind the Iterator to the first element.

Return Value

mixed

mixed current()

Return the current element.

Return Value

mixed

string key()

Return the key of the current element.

Return Value

string

mixed next()

Move forward to next element.

Return Value

mixed

bool valid()

Checks if current position is valid.

Return Value

bool