This iterator will insert values into a property of each of the records returned. The values to be inserted come out of another traversal object. This is useful when you have two separate collections and want to merge them together by placing each of the values from one collection into a property inside the other collection.
__construct( array|Traversable $into , string $path , array|Traversable $values )
Constructs a new collection that will dynamically add properties to it out of the values found in $values.
$into
$path
$values
InvalidArgumentException
Cake\Collection\Collection::__construct()
current( )
Returns the current element in the target collection after inserting the value from the source collection into the specified path.
mixed
__debugInfo( )
Returns an array that can be used to describe the internal state of this object.
array
count( )
Throws an exception.
Issuing a count on a Collection can have many side effects, some making the Collection unusable after the count operation.
LogicException
serialize( )
Returns a string representation of this object that can be used to reconstruct it
string
Serializable::serialize()
unserialize( string $collection )
Unserializes the passed string and rebuilds the Collection instance
$collection
Serializable::unserialize()
_unwrap( )
Backwards compatible wrapper for unwrap()
Iterator
append( mixed $items )
Cake\Collection\CollectionInterface::append()
buffered( )
Cake\Collection\Iterator\BufferedIterator
Cake\Collection\CollectionInterface::buffered()
chunk( mixed $chunkSize )
Cake\Collection\CollectionInterface::chunk()
combine( mixed $keyPath , mixed $valuePath , mixed $groupPath null )
Cake\Collection\CollectionInterface::combine()
compile( mixed $preserveKeys true )
Cake\Collection\CollectionInterface::compile()
contains( mixed $value )
Cake\Collection\CollectionInterface::contains()
countBy( mixed $callback )
Cake\Collection\CollectionInterface::countBy()
every( callable $c )
Cake\Collection\CollectionInterface::every()
extract( mixed $matcher )
Cake\Collection\CollectionInterface::extract()
filter( callable $c null )
Cake\Collection\Iterator\FilterIterator
Cake\Collection\CollectionInterface::filter()
firstMatch( array $conditions )
Cake\Collection\CollectionInterface::firstMatch()
groupBy( mixed $callback )
Cake\Collection\CollectionInterface::groupBy()
indexBy( mixed $callback )
Cake\Collection\CollectionInterface::indexBy()
insert( mixed $path , mixed $values )
Cake\Collection\Iterator\InsertIterator
Cake\Collection\CollectionInterface::insert()
jsonSerialize( )
Cake\Collection\CollectionInterface::jsonSerialize()
listNested( mixed $dir 'desc' , mixed $nestingKey 'children' )
Cake\Collection\Iterator\TreeIterator
Cake\Collection\CollectionInterface::listNested()
map( callable $c )
Cake\Collection\Iterator\ReplaceIterator
Cake\Collection\CollectionInterface::map()
match( array $conditions )
Cake\Collection\CollectionInterface::match()
max( mixed $callback , mixed $type SORT_NUMERIC )
Cake\Collection\CollectionInterface::max()
min( mixed $callback , mixed $type SORT_NUMERIC )
Cake\Collection\CollectionInterface::min()
nest( mixed $idPath , mixed $parentPath )
Cake\Collection\CollectionInterface::nest()
reduce( callable $c , mixed $zero null )
Cake\Collection\CollectionInterface::reduce()
reject( callable $c )
Cake\Collection\Iterator\FilterIterator
Cake\Collection\CollectionInterface::reject()
sample( mixed $size 10 )
Cake\Collection\CollectionInterface::sample()
skip( mixed $howMany )
Cake\Collection\CollectionInterface::skip()
sortBy( mixed $callback , mixed $dir SORT_DESC , mixed $type SORT_NUMERIC )
Cake\Collection\CollectionInterface::sortBy()
stopWhen( mixed $condition )
Cake\Collection\Iterator\StoppableIterator
Cake\Collection\CollectionInterface::stopWhen()
sumOf( mixed $matcher null )
Cake\Collection\CollectionInterface::sumOf()
take( mixed $size 1 , mixed $from 0 )
Cake\Collection\CollectionInterface::take()
through( callable $handler )
Cake\Collection\CollectionInterface::through()
toArray( mixed $preserveKeys true )
Cake\Collection\CollectionInterface::toArray()
unfold( callable $transformer null )
Cake\Collection\CollectionInterface::unfold()
zipWith( mixed $items , mixed $callable )
Cake\Collection\CollectionInterface::zipWith()
_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
© 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.InsertIterator.html