5 interface Collection extends \ArrayAccess, \Countable, \IteratorAggregate
14 public function add($element);
30 public function first();
37 public function last();
62 public function get(
$key);
67 public function remove($element);
75 public function set(
$key, $value);
map(\Closure $function)
Applies the given function to each element in the collection and returns a new collection with the el...
add($element)
Add an element to the collection.
last()
Return the last element from the collection.
filter(\Closure $filterFunction)
getOnlyElement()
Shorthand for getting a single element that also must be the only element in the collection.
first()
Return the first element from the collection.