You are here

public function AbstractLazyCollection::partition in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/collections/lib/Doctrine/Common/Collections/AbstractLazyCollection.php \Doctrine\Common\Collections\AbstractLazyCollection::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.

Overrides Collection::partition

File

vendor/doctrine/collections/lib/Doctrine/Common/Collections/AbstractLazyCollection.php, line 245

Class

AbstractLazyCollection
Lazy collection that is backed by a concrete collection

Namespace

Doctrine\Common\Collections

Code

public function partition(Closure $p) {
  $this
    ->initialize();
  return $this->collection
    ->partition($p);
}