class MapFieldIter implements Iterator (View source)

MapFieldIter is used to iterate MapField. It is also need for the foreach syntax.

Methods

__construct($container, $key_type)

Create iterator instance for MapField.

void
rewind()

Reset the status of the iterator

object
current()

Return the element at the current position.

object
key()

Return the current key.

void
next()

Move to the next position.

bool
valid()

Check whether there are more elements to iterate.

Details

__construct($container, $key_type)

Create iterator instance for MapField.

Parameters

$container
$key_type

void rewind()

Reset the status of the iterator

need to add return type void (require update php version to 7.1)

Return Value

void

object current()

Return the element at the current position.

need to add return type mixed (require update php version to 8.0)

Return Value

object

The element at the current position.

object key()

Return the current key.

need to add return type mixed (require update php version to 8.0)

Return Value

object

The current key.

void next()

Move to the next position.

need to add return type void (require update php version to 7.1)

Return Value

void

bool valid()

Check whether there are more elements to iterate.

Return Value

bool

True if there are more elements to iterate.