Метод |
Описание |
|
add ( $item ) : collections\CollectionInterface |
Returns a collection with $item added. |
|
at ( $index ) : mixed |
Returns the item in the collection at $index. |
|
clear ( ) : collections\CollectionInterface |
Removes every item from the collection. |
|
contains ( callable $condition ) : boolean |
Returns true if the collection contains any items that satisfy
$condition, returns false if it contains none. |
|
count ( ) : integer |
Returns the number of items in the collection. |
|
drop ( $num ) : Collection |
Removes all of the items in the collection starting at index $num. |
|
dropRight ( $num ) : Collection |
Removes all of the items in the collectioin between index 0 and $num. |
|
dropWhile ( callable $condition ) : Collection |
Iteratively drops items in the collection that satisfy $condition until
an item is encountered that does not satisfy $condition. |
|
each ( callable $callable ) |
Applies the callback function $callable to each item in the collection. |
|
every ( callable $condition ) : boolean |
Returns true if every item in the collection satisfies $condition,
returns false if not. |
|
filter ( callable $condition ) : collections\CollectionInterface |
Returns a collection that only contains the items which satisfy
$condition. |
|
find ( callable $condition ) : mixed |
Returns the first item in the collection that satisfies
$condition, returns false if no such item exists. |
|
findIndex ( callable $condition ) : integer |
Returns the index of the first item in the collection that satisfies
$condition, returns -1 if no such item exists. |
|
findLast ( callable $condition ) : mixed |
Returns the last item in the collection that satisfies $condition,
returns false if no such item exists. |
|
findLastIndex ( callable $condition ) : integer |
Returns the index of the last item in the collection that satisfies
$condition, returns -1 if no such item exists. |
|
getIterator ( ) : ArrayIterato\ArrayIterator |
Returns an array iterator for the collection. |
|
getType ( ) : string |
Returns the type of the collection. |
|
indexExists ( $index ) : boolean |
Returns true if $index is within the collection's range and returns false
if it is not. |
|
insert ( $index, $item ) |
Inserts $item at $index. |
|
insertRange ( $index, array $items ) |
Inserts the range $items at $index. |
|
map ( callable $callable ) : collections\CollectionInterface |
Returns a new instance of the collection with the callback function
$callable applied to each item. |
|
merge ( $items ) : collections\CollectionInterface |
Adds every member of $items to the collection. |
|
reduce ( callable $callable, null $initial = null ) : mixed |
Iteratively reduces the collection to a single value using the callback
function $callable. |
|
reduceRight ( callable $callable, null $initial = null ) : mixed |
Iteratively reduces the collection to a single value using the callback
function $callable starting at the rightmost index. |
|
removeAt ( $index ) : collections\CollectionInterface |
Removes the item at $index. |
|
reverse ( ) : collections\CollectionInterface |
Reverses the order of the items in the collection. |
|
shuffle ( ) : collections\CollectionInterface |
Randomly reorders the items in the collection. |
|
slice ( $start, $end ) : collections\CollectionInterface |
Returns a collection that contains the subset of items ranging from the
index $start to $end. |
|
sort ( callable $callback ) : collections\CollectionInterface |
Sorts the items in the collection using the user supplied comparison
function $callback. |
|
tail ( ) : Collection |
Removes the first item in the collection. |
|
take ( $num ) : Collection |
Removes all of the items in the collection starting at index $num. |
|
takeRight ( $num ) : Collection |
Removes all of the items in the collection before index $num. |
|
takeWhile ( callable $condition ) : Collection |
Iterates through the collection until an item is encountered that does
not satisfy $condition, then drops all of the items starting at that
index. |
|
toArray ( ) : array |
Returns an array containing the items in the collection. |
|
without ( callable $condition ) : Collection |
Removes all of the items that satisfy $condition. |
|