ExtendedObjectIterator
in package
implements
Iterator
An iterator for objects.
Table of Contents
Interfaces
- Iterator
Properties
- $_current : mixed
- Current position.
- $_data : mixed
- The object collection.
- $_keys : array<string|int, string>
- Keys in the data array.
Methods
- __construct() : mixed
- Constructor. Receives the object collection.
- current() : mixed
- Return the current value.
- key() : string
- Return the key of the current position.
- next() : mixed
- Move to the next value.
- rewind() : void
- Rewind to the first entry.
- valid() : bool
- Check the validity of the iterator, i.e., whether the current value is valid.
Properties
$_current
Current position.
private
mixed
$_current
= 0
$_data
The object collection.
private
mixed
$_data
$_keys
Keys in the data array.
private
array<string|int, string>
$_keys
Methods
__construct()
Constructor. Receives the object collection.
public
__construct([array<string|int, mixed>|null $data = null ]) : mixed
Parameters
- $data : array<string|int, mixed>|null = null
-
The collection
current()
Return the current value.
public
current() : mixed
key()
Return the key of the current position.
public
key() : string
Return values
stringnext()
Move to the next value.
public
next() : mixed
rewind()
Rewind to the first entry.
public
rewind() : void
valid()
Check the validity of the iterator, i.e., whether the current value is valid.
public
valid() : bool