Properties

$_key

$_key : callable

A callable to generate the iteration key

Type

callable

$_value

$_value : callable

A callable to extract the display value

Type

callable

$_current

$_current : mixed

Cached value for the current iteration element

Type

mixed

$_spacer

$_spacer : string

The string to use for prefixing the values according to their depth in the tree.

Type

string

Methods

each()

each(callable  $c) 

{@inheritDoc}

Parameters

callable $c

every()

every(callable  $c) 

{@inheritDoc}

Parameters

callable $c

some()

some(callable  $c) 

{@inheritDoc}

Parameters

callable $c

contains()

contains(  $value) 

{@inheritDoc}

Parameters

$value

reduce()

reduce(callable  $c,   $zero = null) 

{@inheritDoc}

Parameters

callable $c
$zero

extract()

extract(  $matcher) 

{@inheritDoc}

Parameters

$matcher

max()

max(  $callback,   $type = \SORT_NUMERIC) 

{@inheritDoc}

Parameters

$callback
$type

min()

min(  $callback,   $type = \SORT_NUMERIC) 

{@inheritDoc}

Parameters

$callback
$type

avg()

avg(  $matcher = null) 

{@inheritDoc}

Parameters

$matcher

median()

median(  $matcher = null) 

{@inheritDoc}

Parameters

$matcher

sortBy()

sortBy(  $callback,   $dir = \SORT_DESC,   $type = \SORT_NUMERIC) 

{@inheritDoc}

Parameters

$callback
$dir
$type

groupBy()

groupBy(  $callback) 

{@inheritDoc}

Parameters

$callback

indexBy()

indexBy(  $callback) 

{@inheritDoc}

Parameters

$callback

countBy()

countBy(  $callback) 

{@inheritDoc}

Parameters

$callback

sumOf()

sumOf(  $matcher = null) 

{@inheritDoc}

Parameters

$matcher

shuffle()

shuffle() 

{@inheritDoc}

sample()

sample(  $size = 10) 

{@inheritDoc}

Parameters

$size

take()

take(  $size = 1,   $from) 

{@inheritDoc}

Parameters

$size
$from

skip()

skip(  $howMany) 

{@inheritDoc}

Parameters

$howMany

match()

match(array  $conditions) 

{@inheritDoc}

Parameters

array $conditions

firstMatch()

firstMatch(array  $conditions) 

{@inheritDoc}

Parameters

array $conditions

first()

first() 

{@inheritDoc}

last()

last() 

{@inheritDoc}

takeLast()

takeLast(  $howMany) 

{@inheritDoc}

Parameters

$howMany

append()

append(  $items) 

{@inheritDoc}

Parameters

$items

appendItem()

appendItem(  $item,   $key = null) 

{@inheritDoc}

Parameters

$item
$key

prepend()

prepend(  $items) 

{@inheritDoc}

Parameters

$items

prependItem()

prependItem(  $item,   $key = null) 

{@inheritDoc}

Parameters

$item
$key

combine()

combine(  $keyPath,   $valuePath,   $groupPath = null) 

{@inheritDoc}

Parameters

$keyPath
$valuePath
$groupPath

nest()

nest(  $idPath,   $parentPath,   $nestingKey = 'children') 

{@inheritDoc}

Parameters

$idPath
$parentPath
$nestingKey

toArray()

toArray(  $preserveKeys = true) 

{@inheritDoc}

Parameters

$preserveKeys

toList()

toList() 

{@inheritDoc}

jsonSerialize()

jsonSerialize() 

{@inheritDoc}

compile()

compile(  $preserveKeys = true) 

{@inheritDoc}

Parameters

$preserveKeys

lazy()

lazy() 

{@inheritDoc}

listNested()

listNested(  $dir = 'desc',   $nestingKey = 'children') : \Cake\Collection\Iterator\TreeIterator

{@inheritDoc}

Parameters

$dir
$nestingKey

Returns

\Cake\Collection\Iterator\TreeIterator

unfold()

unfold(callable  $transformer = null) 

{@inheritDoc}

Parameters

callable $transformer

through()

through(callable  $handler) 

{@inheritDoc}

Parameters

callable $handler

zip()

zip(  $items) 

{@inheritDoc}

Parameters

$items

zipWith()

zipWith(  $items,   $callable) 

{@inheritDoc}

Parameters

$items
$callable

chunk()

chunk(  $chunkSize) 

{@inheritDoc}

Parameters

$chunkSize

chunkWithKeys()

chunkWithKeys(  $chunkSize,   $preserveKeys = true) 

{@inheritDoc}

Parameters

$chunkSize
$preserveKeys

isEmpty()

isEmpty() 

{@inheritDoc}

unwrap()

unwrap() 

{@inheritDoc}

_unwrap()

_unwrap() 

cartesianProduct()

cartesianProduct(callable|null  $operation = null, callable|null  $filter = null) : \Cake\Collection\CollectionInterface

Parameters

callable|null $operation

Operation

callable|null $filter

Filter

Throws

\LogicException

Returns

\Cake\Collection\CollectionInterface

count()

count() : integer

{@inheritDoc}

Returns

integer

countKeys()

countKeys() : integer

{@inheritDoc}

Returns

integer

__construct()

__construct(\RecursiveIterator  $items, string|callable  $valuePath, string|callable  $keyPath, string  $spacer, integer  $mode = \RecursiveIteratorIterator::SELF_FIRST) 

Constructor

Parameters

\RecursiveIterator $items

The iterator to flatten.

string|callable $valuePath

The property to extract or a callable to return the display value.

string|callable $keyPath

The property to use as iteration key or a callable returning the key value.

string $spacer

The string to use for prefixing the values according to their depth in the tree.

integer $mode

Iterator mode.

key()

key() : mixed

Returns the current iteration key

Returns

mixed

current()

current() : string

Returns the current iteration value

Returns

string

next()

next() : void

Advances the cursor one position

optimizeUnwrap()

optimizeUnwrap() : \Traversable|array

Unwraps this iterator and returns the simplest traversable that can be used for getting the data out

Returns

\Traversable|array

_fetchCurrent()

_fetchCurrent() : mixed

Returns the current iteration element and caches its value

Returns

mixed