You are here

public function Collection::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.

2 methods override Collection::filter()
AbstractLazyCollection::filter in lib/doctrine/collections/lib/Doctrine/Common/Collections/AbstractLazyCollection.php
Returns all the elements of this collection that satisfy the predicate p. The order of the elements is preserved.
ArrayCollection::filter in lib/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php
Returns all the elements of this collection that satisfy the predicate p. The order of the elements is preserved.

File

lib/doctrine/collections/lib/Doctrine/Common/Collections/Collection.php, line 206

Class

Collection
The missing (SPL) Collection/Array/OrderedMap interface.

Namespace

Doctrine\Common\Collections

Code

public function filter(Closure $p);