You are here

public function ArrayCollection::map in Plug 7

Applies the given function to each element in the collection and returns a new collection with the elements returned by the function.

Parameters

Closure $func:

Return value

Collection

Overrides Collection::map

File

lib/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php, line 285

Class

ArrayCollection
An ArrayCollection is a Collection implementation that wraps a regular PHP array.

Namespace

Doctrine\Common\Collections

Code

public function map(Closure $func) {
  return new static(array_map($func, $this->elements));
}