Pinq\Iterators\IIteratorScheme::groupedIterator PHP Method

groupedIterator() public method

Returns an iterator which will group the elements according to the supplied function and wrap each group in a traversable implementation from the supplied factory.
public groupedIterator ( Traversable $iterator, callable $groupKeyFunction, callable $traversableFactory ) : Pinq\Iterators\IWrapperIterator
$iterator Traversable
$groupKeyFunction callable
$traversableFactory callable
return Pinq\Iterators\IWrapperIterator
    public function groupedIterator(\Traversable $iterator, callable $groupKeyFunction, callable $traversableFactory);

Usage Example

Beispiel #1
0
 public function groupBy(callable $function)
 {
     return $this->constructScopedSelf($this->scheme->groupedIterator($this->elements, $function, $this->scopedSelfFactory()));
 }