Elgg  Version 1.11
Public Member Functions | List of all members
Elgg\Structs\Collection Interface Reference
Inheritance diagram for Elgg\Structs\Collection:
Elgg\Structs\ArrayCollection

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...
 

Detailed Description

Definition at line 35 of file Collection.php.

Member Function Documentation

Elgg\Structs\Collection::contains (   $item)

Returns true iff the item is in this collection at least once.

Parameters
mixed$itemThe object or value to check for
Returns
boolean

Implemented in Elgg\Structs\ArrayCollection.

Elgg\Structs\Collection::filter ( callable  $filter)

Returns a new collection only containing the elements which pass the filter.

Parameters
callable$filterReceives an item. Return true to keep the item.
Returns
Collection

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.

Parameters
callable$mapperReturns the mapped value
Returns
Collection

Implemented in Elgg\Structs\ArrayCollection.


The documentation for this interface was generated from the following file: