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.
$_path protected arrayAn array containing each of the properties to be traversed to reach the point where the values should be inserted.
$_target protected string$_validValues protected boolean$_values protected Constructs a new collection that will dynamically add properties to it out of the values found in $values.
Returns the current element in the target collection after inserting the value from the source collection into the specified path.
__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 The target collection to which the values will be inserted at the specified path.
$path A dot separated list of properties that need to be traversed to insert the value into the target collection.
$values The source collection from which the values will be inserted at the specified path.
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.
IteratorIterator::current() next( )
Advances the cursor to the next record
IteratorIterator::next() __call( string $name , array $args )
Throws an exception.
Collection doesn't permit access to methods of the inner iterator.
$name $args __debugInfo( )
Returns an array that can be used to describe the internal state of this object.
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 )
avg( $matcher null )
cartesianProduct( callable $operation null , callable $filter null )
Cake\Collection\CollectionInterfacechunk( $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\TreeIteratormatch( array $conditions )
max( $callback , $type SORT_NUMERIC )
median( $matcher null )
min( $callback , $type SORT_NUMERIC )
nest( $idPath , $parentPath , $nestingKey 'children' )
optimizeUnwrap( )
Unwraps this iterator and returns the simplest traversable that can be used for getting the data out
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 array
An array containing each of the properties to be traversed to reach the point where the values should be inserted.
protected boolean
Holds whether the values collection is still valid. (has more records)
true
protected Cake\Collection\Collection
The collection from which to extract the values to be inserted
© 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.5/class-Cake.Collection.Iterator.InsertIterator.html