$_buffer
$_buffer : \SplDoublyLinkedList
The in-memory cache containing results from previous iterators
Creates an iterator from another iterator that will keep the results of the inner iterator in memory, so that results don't have to be re-calculated.
count() : integer
Returns the number or items in this collection
On certain type of collections, calling this method may render unusable afterwards. That is, you may not be able to get elements out of it, or to iterate on it anymore.
Specifically any collection wrapping a Generator (a function with a yield statement)
or a unbuffered database cursor will not accept any other function calls after calling
count()
on it.
Create a new collection with buffered()
method to overcome this problem.
Any collection constructed by appending collections together, or by having internal iterators returning duplicate keys, will report a larger amount of elements using this functions than the final amount of elements when converting the collections to a keyed array. This is because duplicate keys will be collapsed into a single one in the final array, whereas this count method is only concerned by the amount of elements after converting it to a plain list.
If you need the count of elements after taking the keys in consideration
(the count of unique keys), you can call countKeys()
Calling this method at the same time that you are iterating this collections, for example in a foreach, will result in undefined behavior. Avoid doing this.
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}