CMapIterator
CMapIterator implements an iterator for
CMap.
It allows CMap to return a new iterator for traversing the items in the map.
Public Methods
Method |
Description |
Defined By |
__construct() | Constructor. | CMapIterator |
current() | Returns the current array element. | CMapIterator |
key() | Returns the key of the current array element. | CMapIterator |
next() | Moves the internal pointer to the next array element. | CMapIterator |
rewind() | Rewinds internal array pointer. | CMapIterator |
valid() | Returns whether there is an element at current position. | CMapIterator |
Method Details
public void __construct(array &$data) |
$data | array | the data to be iterated through |
Constructor.
public mixed current() |
{return} | mixed | the current array element |
Returns the current array element. This method is required by the interface Iterator.
public mixed key() |
{return} | mixed | the key of the current array element |
Returns the key of the current array element. This method is required by the interface Iterator.
Moves the internal pointer to the next array element. This method is required by the interface Iterator.
Rewinds internal array pointer. This method is required by the interface Iterator.
public boolean valid() |
{return} | boolean | |
Returns whether there is an element at current position. This method is required by the interface Iterator.