RecursiveCallbackFilterIterator
class RecursiveCallbackFilterIterator extends CallbackFilterIterator implements RecursiveIterator (View source)
(PHP 5 >= 5.4.0)
RecursiveCallbackFilterIterator from a RecursiveIterator
Methods
Create a RecursiveCallbackFilterIterator from a RecursiveIterator
This method calls the callback with the current value, current key and the inner iterator.
Check whether the inner iterator's current element has children
Returns an iterator for the current entry.
Details
__construct(Traversable $iterator, callable $callback)
Create a RecursiveCallbackFilterIterator from a RecursiveIterator
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()
This method calls the callback with the current value, current key and the inner iterator.
The callback is expected to return TRUE if the current item is to be accepted, or FALSE otherwise.
bool
hasChildren()
Check whether the inner iterator's current element has children
RecursiveIterator|null
getChildren()
Returns an iterator for the current entry.