class SS_Map_Iterator implements Iterator (View source)

Builds a map iterator around an Iterator. Called by SS_Map

Properties

protected $items
protected $keyField
protected $titleField
protected $firstItemIdx
protected $endItemIdx
protected $firstItems
protected $lastItems
protected $excludedItems

Methods

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

No description

public
mixed
rewind()

Rewind the Iterator to the first element.

public
mixed
current()

Return the current element.

public
string
key()

Return the key of the current element.

public
mixed
next()

Move forward to next element.

public
bool
valid()

Checks if current position is valid.

Details

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

No description

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

$firstItems
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