An iterator that can be used to generate nested iterators out of a collection of items by applying an function to each of the elements in this iterator.
\Traversable
A reference to the internal iterator this object is wrapping.
callable
A function that is passed each element in this iterator and must return an array or Traversable object.
Creates the iterator that will generate child iterators from each of the elements it was constructed with.
Returns an iterator containing the items generated by transforming the current value with the callable function.
__construct(\Traversable $items, callable $unfolder)
Creates the iterator that will generate child iterators from each of the elements it was constructed with.
\Traversable
$items The list of values to iterate
callable
$unfolder A callable function that will receive the current item and key. It must return an array or Traversable object out of which the nested iterators will be yielded.
getChildren()
Returns an iterator containing the items generated by transforming the current value with the callable function.
\RecursiveIterator
hasChildren()
Returns true as each of the elements in the array represent a list of items
bool
A reference to the internal iterator this object is wrapping.
\Traversable
A function that is passed each element in this iterator and must return an array or Traversable object.
callable
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.Collection.Iterator.UnfoldIterator.html