Currently the implemented schemes are as follows: - Generators, >= 5.5.0 - Iterators, >= 5.4.0
Author: Elliot Levin (elliotlevin@hotmail.com)
示例#1
0
 public function __construct(Providers\IQueryProvider $provider, Queries\ISourceInfo $sourceInfo, O\TraversalExpression $queryExpression = null, IIteratorScheme $scheme = null)
 {
     parent::__construct($provider);
     $this->sourceInfo = $sourceInfo;
     $this->expression = $queryExpression ?: O\Expression::value($this);
     $this->scheme = $scheme ?: Iterators\SchemeProvider::getDefault();
 }
示例#2
0
 public function orderedMaps()
 {
     $orderedMaps = [];
     foreach (\Pinq\Iterators\SchemeProvider::getAvailableSchemes() as $scheme) {
         $orderedMaps[] = [$scheme->createOrderedMap(), $scheme];
     }
     return $orderedMaps;
 }
示例#3
0
 protected final function implementationsFor(array $data)
 {
     $implementations = [];
     foreach (\Pinq\Iterators\SchemeProvider::getAvailableSchemes() as $scheme) {
         $implementations = array_merge($implementations, [[new \Pinq\Traversable($data, $scheme), $data], [(new \Pinq\Providers\Traversable\Provider(new \Pinq\Traversable($data, $scheme)))->createQueryable(), $data]]);
     }
     return $implementations;
 }
示例#4
0
 public function schemes()
 {
     $schemes = [];
     foreach (SchemeProvider::getAvailableSchemes() as $scheme) {
         $schemes[] = [$scheme];
     }
     return $schemes;
 }
 protected function buildIteratorScheme()
 {
     return Iterators\SchemeProvider::getDefault();
 }
示例#6
0
 public function __construct($elements = [], IIteratorScheme $scheme = null, Traversable $source = null)
 {
     $this->scheme = $scheme ?: Iterators\SchemeProvider::getDefault();
     $this->source = $source;
     $this->elements = $this->scheme->toIterator($elements);
 }