public function ArrayCollection::filter in Plug 7
Returns all the elements of this collection that satisfy the predicate p. The order of the elements is preserved.
Parameters
Closure $p The predicate used for filtering.:
Return value
Collection A collection with the results of the filter operation.
Overrides Collection::filter
File
- lib/
doctrine/ collections/ lib/ Doctrine/ Common/ Collections/ ArrayCollection.php, line 293
Class
- ArrayCollection
- An ArrayCollection is a Collection implementation that wraps a regular PHP array.
Namespace
Doctrine\Common\CollectionsCode
public function filter(Closure $p) {
return new static(array_filter($this->elements, $p));
}