public function ArrayCollection::filter

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

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php, line 384

Class

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

Namespace

Doctrine\Common\Collections

Code

public function filter(Closure $p) {
  return new static(array_filter($this->_elements, $p));
}