function Collection::partition

Partitions this collection in two collections according to a predicate. Keys are preserved in the resulting collections.

Parameters

Closure $p The predicate on which to partition.:

Return value

array An array with two elements. The first element contains the collection of elements where the predicate returned TRUE, the second element contains the collection of elements where the predicate returned FALSE.

1 method overrides Collection::partition()
ArrayCollection::partition in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php
Partitions this collection in two collections according to a predicate. Keys are preserved in the resulting collections.

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Collections/Collection.php, line 219

Class

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

Namespace

Doctrine\Common\Collections

Code

function partition(Closure $p);