Doctrine\Common\Collections\Collection::partition
Partitions this collection in two collections according to a predicate.
Keys are preserved in the resulting collections.
Signature
public function partition(Closure
$p )
Parameters
$p
— Closure- The predicate on which to partition.
Returns
- 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.