FilterIterator
abstract class FilterIterator extends IteratorIterator (View source)
This abstract iterator filters out unwanted values. This class should be extended to implement custom iterator filters. The FilterIterator::accept must be implemented in the subclass.
Methods
Iterator|null
getInnerIterator()
Get the inner iterator
void
rewind()
Rewind the iterator
bool
valid()
Check whether the current element is valid
mixed
key()
Get the current key
mixed
current()
Get the current element value
void
next()
Move the iterator forward
bool
accept()
Check whether the current element of the iterator is acceptable
Details
__construct(Traversable $iterator)
Construct a filterIterator
Iterator|null
getInnerIterator()
Get the inner iterator
void
rewind()
Rewind the iterator
bool
valid()
Check whether the current element is valid
mixed
key()
Get the current key
mixed
current()
Get the current element value
void
next()
Move the iterator forward
abstract bool
accept()
Check whether the current element of the iterator is acceptable