$_callback
$_callback : callable
The function to use for zipping items together
Creates an iterator that returns elements grouped in pairs
$iterator = new ZipIterator([[1, 2], [3, 4]]);
$iterator->toList(); // Returns [[1, 3], [2, 4]]
You can also chose a custom function to zip the elements together, such as doing a sum by index:
$iterator = new ZipIterator([[1, 2], [3, 4]], function ($a, $b) {
return $a + $b;
});
$iterator->toList(); // Returns [4, 6]
filter(callable $c = null) : \Cake\Collection\Iterator\FilterIterator
{@inheritDoc}
callable | $c |
reject(callable $c) : \Cake\Collection\Iterator\FilterIterator
{@inheritDoc}
callable | $c |
map(callable $c) : \Cake\Collection\Iterator\ReplaceIterator
{@inheritDoc}
callable | $c |
insert( $path, $values) : \Cake\Collection\Iterator\InsertIterator
{@inheritDoc}
$path | ||
$values |
buffered() : \Cake\Collection\Iterator\BufferedIterator
{@inheritDoc}
listNested( $dir = 'desc', $nestingKey = 'children') : \Cake\Collection\Iterator\TreeIterator
{@inheritDoc}
$dir | ||
$nestingKey |
stopWhen( $condition) : \Cake\Collection\Iterator\StoppableIterator
{@inheritDoc}
$condition |
cartesianProduct(callable|null $operation = null, callable|null $filter = null) : \Cake\Collection\CollectionInterface
callable|null | $operation | Operation |
callable|null | $filter | Filter |
transpose() : \Cake\Collection\CollectionInterface
{@inheritDoc}
__construct(array $sets, callable|null $callable = null)
Creates the iterator to merge together the values by for all the passed iterators by their corresponding index.
array | $sets | The list of array or iterators to be zipped. |
callable|null | $callable | The function to use for zipping the elements of each iterator. |