Elgg
Version master
|
Uses native PHP array to implement the Collection interface. More...
Public Member Functions | ||||
contains ($item) | ||||
Returns true iff the item is in this collection at least once.
| ||||
count () | ||||
current () | ||||
filter (callable $filter) | ||||
Returns a new collection only containing the elements which pass the filter.
| ||||
key () | ||||
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.
| ||||
next () | ||||
rewind () | ||||
valid () | ||||
Static Public Member Functions | |
static | fromArray (array $items) |
Factory function for converting from an array to a ton of items. More... | |
Uses native PHP array to implement the Collection interface.
Definition at line 13 of file InMemory.php.
Elgg\Structs\Collection\InMemory::contains | ( | $item | ) |
Returns true iff the item is in this collection at least once.
mixed | $item | The object or value to check for |
Implements Elgg\Structs\Collection.
Definition at line 26 of file InMemory.php.
Elgg\Structs\Collection\InMemory::count | ( | ) |
Definition at line 34 of file InMemory.php.
Elgg\Structs\Collection\InMemory::current | ( | ) |
Definition at line 42 of file InMemory.php.
Elgg\Structs\Collection\InMemory::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. |
Implements Elgg\Structs\Collection.
Definition at line 49 of file InMemory.php.
|
static |
Factory function for converting from an array to a ton of items.
array | $items | The list of objects to include. Generics come later. |
Definition at line 112 of file InMemory.php.
Elgg\Structs\Collection\InMemory::key | ( | ) |
Definition at line 65 of file InMemory.php.
Elgg\Structs\Collection\InMemory::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 |
Implements Elgg\Structs\Collection.
Definition at line 72 of file InMemory.php.
Elgg\Structs\Collection\InMemory::next | ( | ) |
Definition at line 85 of file InMemory.php.
Elgg\Structs\Collection\InMemory::rewind | ( | ) |
Definition at line 93 of file InMemory.php.
Elgg\Structs\Collection\InMemory::valid | ( | ) |
Definition at line 101 of file InMemory.php.