Pinq\Iterators\IIteratorScheme::groupedIterator PHP 메소드

groupedIterator() 공개 메소드

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
리턴 Pinq\Iterators\IWrapperIterator
    public function groupedIterator(\Traversable $iterator, callable $groupKeyFunction, callable $traversableFactory);

Usage Example

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