Elgg
Version 1.11
|
Public Member Functions | |
filter (callable $filter) | |
Returns a new collection only containing the elements which pass the filter. More... | |
contains ($item) | |
Returns true iff the item is in this collection at least once. More... | |
map (callable $mapper) | |
Take items of the collection and return a new collection with all the items having the $mapper applied to them. More... | |
Definition at line 35 of file Collection.php.
Elgg\Structs\Collection::contains | ( | $item | ) |
Returns true iff the item is in this collection at least once.
mixed | $item | The object or value to check for |
Implemented in Elgg\Structs\ArrayCollection.
Elgg\Structs\Collection::filter | ( | callable | $filter | ) |
Returns a new collection only containing the elements which pass the filter.
callable | $filter | Receives an item. Return true to keep the item. |
Implemented in Elgg\Structs\ArrayCollection.
Elgg\Structs\Collection::map | ( | callable | $mapper | ) |
Take items of the collection and return a new collection with all the items having the $mapper applied to them.
The callable is not guaranteed to execute immediately for each item.
callable | $mapper | Returns the mapped value |
Implemented in Elgg\Structs\ArrayCollection.