Method |
Description |
|
batch ( Iterator $iterator, $chunkSize ) : BatchingIterator |
Returns the elements of $iterator grouped in chunks of $chunkSize |
|
cycle ( Iterator $iterator ) : InfiniteIterator |
Returns an iterator that cycles indefinitely over the elements of $iterator. |
|
filter ( Iterator $iterator, $predicate ) : FilteringIterator |
Returns the elements of $iterator that satisfy a predicate. |
|
first ( Iterator $iterator ) : mixed |
Returns the first element in iterator or throws an Exception if iterator is empty |
|
firstOr ( Iterator $iterator, $default ) : mixed |
Returns the first element in iterator or defaultValue. |
|
forArray ( $array ) : ArrayIterator |
Returns an iterator containing the elements of $array. |
|
generate ( $function ) : GeneratingIterator |
Returns an iterator that uses $function to generate elements
$function takes one argument which is the current position of the iterator. |
|
limit ( Iterator $iterator, $number ) : LimitIterator |
Creates an iterator returning the first $number elements of the given iterator. |
|
map ( Iterator $iterator, $function ) : TransformingIterator |
Returns an iterator that applies function to each element of $iterator. |
|
reindex ( Iterator $iterator ) : Iterator |
Returns an iterator that indexes elements numerically starting from 0 |
|
skip ( Iterator $iterator, $number ) : SkippingIterator |
Creates an iterator returning all but first $number elements of the given iterator. |
|
toArray ( Iterator $iterator ) : array |
Copies an iterator's elements into an array. |
|