Iterator for flattening elements in a tree structure while adding some visual markers for their relative position in the tree
__construct( RecursiveIterator $items , string|callable $valuePath , string|callable $keyPath , string $spacer , integer $mode Cake\Collection\Iterator\RecursiveIteratorIterator::SELF_FIRST )
Constructor
$items
$valuePath
$keyPath
$spacer
$mode
optional Cake\Collection\Iterator\RecursiveIteratorIterator::SELF_FIRST RecursiveIteratorIterator::__construct()
_fetchCurrent( )
Returns the current iteration element and caches its value
mixed
current( )
Returns the current iteration value
string
RecursiveIteratorIterator::current()
key( )
Returns the current iteration key
mixed
RecursiveIteratorIterator::key()
next( )
Advances the cursor one position
RecursiveIteratorIterator::next()
_unwrap( )
Backwards compatible wrapper for unwrap()
Iterator
append( mixed $items )
buffered( )
Cake\Collection\Iterator\BufferedIterator
chunk( mixed $chunkSize )
combine( mixed $keyPath , mixed $valuePath , mixed $groupPath null )
compile( mixed $preserveKeys true )
contains( mixed $value )
countBy( mixed $callback )
each( callable $c )
every( callable $c )
extract( mixed $matcher )
filter( callable $c null )
Cake\Collection\Iterator\FilterIterator
first( )
firstMatch( array $conditions )
groupBy( mixed $callback )
indexBy( mixed $callback )
insert( mixed $path , mixed $values )
Cake\Collection\Iterator\InsertIterator
isEmpty( )
jsonSerialize( )
last( )
listNested( mixed $dir 'desc' , mixed $nestingKey 'children' )
Cake\Collection\Iterator\TreeIterator
map( callable $c )
Cake\Collection\Iterator\ReplaceIterator
match( array $conditions )
max( mixed $callback , mixed $type SORT_NUMERIC )
min( mixed $callback , mixed $type SORT_NUMERIC )
nest( mixed $idPath , mixed $parentPath )
reduce( callable $c , mixed $zero null )
reject( callable $c )
Cake\Collection\Iterator\FilterIterator
sample( mixed $size 10 )
shuffle( )
skip( mixed $howMany )
some( callable $c )
sortBy( mixed $callback , mixed $dir SORT_DESC , mixed $type SORT_NUMERIC )
stopWhen( mixed $condition )
Cake\Collection\Iterator\StoppableIterator
sumOf( mixed $matcher null )
take( mixed $size 1 , mixed $from 0 )
through( callable $handler )
toArray( mixed $preserveKeys true )
toList( )
unfold( callable $transformer null )
unwrap( )
zip( mixed $items )
zipWith( mixed $items , mixed $callable )
_createMatcherFilter( array $conditions )
Returns a callable that receives a value and will return whether or not it matches certain condition.
$conditions
callable
_extract( array|ArrayAccess $data , array $path )
Returns a column from $data that can be extracted by iterating over the column names contained in $path. It will return arrays for elements in represented with {*}
$data
$path
mixed
_propertyExtractor( string|callable $callback )
Returns a callable that can be used to extract a property or column from an array or object based on a dot separated path.
$callback
callable
_simpleExtract( array|ArrayAccess $data , array $path )
Returns a column from $data that can be extracted by iterating over the column names contained in $path
$data
$path
mixed
CATCH_GET_CHILD, CHILD_FIRST, LEAVES_ONLY, SELF_FIRST |
© 2005–2016 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.
http://api.cakephp.org/3.1/class-Cake.Collection.Iterator.TreePrinter.html