Elgg  Version 6.1
Collection.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Structs;
4 
28 interface Collection extends \Countable, \Iterator {
29 
37  public function filter(callable $filter);
38 
46  public function contains($item);
47 
58  public function map(callable $mapper);
59 }
if(!$items) $item
Definition: delete.php:13
map(callable $mapper)
Take items of the collection and return a new collection with all the items having the $mapper applie...
$filter
Layout content filter.
Definition: filter.php:18
contains($item)
Returns true iff the item is in this collection at least once.
A read-only interface to a (possibly mutable) group of items.
Definition: Collection.php:28
filter(callable $filter)
Returns a new collection only containing the elements which pass the filter.