Trait CollectionTrait
Offers a handful of method to manipulate iterators
- Cake\Collection\CollectionTrait uses Cake\Collection\ExtractTrait
Direct Users
Indirect Users
- Cake\Collection\Iterator\BufferedIterator
- Cake\Collection\Iterator\ExtractIterator
- Cake\Collection\Iterator\FilterIterator
- Cake\Collection\Iterator\InsertIterator
- Cake\Collection\Iterator\NestIterator
- Cake\Collection\Iterator\NoChildrenIterator
- Cake\Collection\Iterator\ReplaceIterator
- Cake\Collection\Iterator\SortIterator
- Cake\Datasource\ResultSetDecorator
Method Summary
-
_unwrap() public deprecated
Backwards compatible wrapper for unwrap() -
append() public
-
buffered() public
-
cartesianProduct() public
-
chunk() public
-
combine() public
-
compile() public
-
contains() public
-
countBy() public
-
each() public
-
every() public
-
extract() public
-
filter() public
-
first() public
-
firstMatch() public
-
groupBy() public
-
indexBy() public
-
insert() public
-
isEmpty() public
-
jsonSerialize() public
-
last() public
-
listNested() public
-
map() public
-
match() public
-
max() public
-
min() public
-
nest() public
-
reduce() public
-
reject() public
-
sample() public
-
shuffle() public
-
skip() public
-
some() public
-
sortBy() public
-
stopWhen() public
-
sumOf() public
-
take() public
-
through() public
-
toArray() public
-
toList() public
-
transpose() public
-
unfold() public
-
unwrap() public
-
zip() public
-
zipWith() public
Method Detail
_unwrap() public deprecated ¶
_unwrap( )
Backwards compatible wrapper for unwrap()
Deprecated
Returns
cartesianProduct() public ¶
cartesianProduct( callable $operation = null , callable $filter = null )
Methods used from Cake\Collection\ExtractTrait
_createMatcherFilter() protected ¶
_createMatcherFilter( array $conditions )
Returns a callable that receives a value and will return whether or not it matches certain condition.
Parameters
- array $conditions
A key-value list of conditions to match where the key is the property path to get from the current item and the value is the value to be compared the item with.
Returns
_extract() protected ¶
_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 {*}
Parameters
- array|ArrayAccess $data
- Data.
- array $path
- Path to extract from.
Returns
_propertyExtractor() protected ¶
_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.
Parameters
- string|callable $callback
A dot separated path of column to follow so that the final one can be returned or a callable that will take care of doing that.
Returns
_simpleExtract() protected ¶
_simpleExtract( array|ArrayAccess $data , array $path )
Returns a column from $data that can be extracted by iterating over the column names contained in $path
Parameters
- array|ArrayAccess $data
- Data.
- array $path
- Path to extract from.