A type of collection that is aware of nested items and exposes methods to check or retrieve them
$_nestKey
protected string|callable
Returns true if there is an array or a traversable object stored under the configured nestKey for the current item
__construct( array|Traversable $items , string|callable $nestKey )
Constructor
$items
$nestKey
the property that contains the nested items If a callable is passed, it should return the childrens for the passed item
Cake\Collection\Collection::__construct()
getChildren( )
Returns a traversable containing the children for the current item
RecursiveIterator::getChildren()
hasChildren( )
Returns true if there is an array or a traversable object stored under the configured nestKey for the current item
RecursiveIterator::hasChildren()
__debugInfo( )
Returns an array that can be used to describe the internal state of this object.
count( )
Throws an exception.
Issuing a count on a Collection can have many side effects, some making the Collection unusable after the count operation.
serialize( )
Returns a string representation of this object that can be used to reconstruct it
Serializable::serialize()
unserialize( string $collection )
Unserializes the passed string and rebuilds the Collection instance
$collection
Serializable::unserialize()
_unwrap( )
append( $items )
cartesianProduct( callable $operation null , callable $filter null )
Cake\Collection\CollectionInterface
chunk( $chunkSize )
chunkWithKeys( $chunkSize , $preserveKeys true )
combine( $keyPath , $valuePath , $groupPath null )
compile( $preserveKeys true )
contains( $value )
countBy( $callback )
each( callable $c )
every( callable $c )
extract( $matcher )
first( )
firstMatch( array $conditions )
groupBy( $callback )
indexBy( $callback )
isEmpty( )
jsonSerialize( )
last( )
listNested( $dir 'desc' , $nestingKey 'children' )
Cake\Collection\Iterator\TreeIterator
match( array $conditions )
max( $callback , $type SORT_NUMERIC )
min( $callback , $type SORT_NUMERIC )
nest( $idPath , $parentPath , $nestingKey 'children' )
reduce( callable $c , $zero null )
sample( $size 10 )
shuffle( )
skip( $howMany )
some( callable $c )
sortBy( $callback , $dir SORT_DESC , $type SORT_NUMERIC )
sumOf( $matcher null )
take( $size 1 , $from 0 )
through( callable $handler )
toArray( $preserveKeys true )
toList( )
unfold( callable $transformer null )
unwrap( )
zip( $items )
zipWith( $items , $callable )
protected string|callable
The name of the property that contains the nested items for each element
© 2005–2017 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/3.4/class-Cake.Collection.Iterator.NestIterator.html