Author: Elliot Levin (elliotlevin@hotmail.com)
Inheritance: extends pinq\ITraversable
Exemplo n.º 1
0
 public function testComputesResultsFromUsingMostApplicableParentRequest()
 {
     $sourceExpression = $this->queryable->getExpression();
     $this->queryResultsCollection->saveResults($sourceExpression, \Pinq\Traversable::from([1])->select(function () {
         $this->assertTrue(false, 'Source expression results should not be called');
     })->getIterator());
     $subscopeQueryable = $this->queryable->skip(5);
     $this->queryResultsCollection->saveResults($subscopeQueryable->getExpression(), [5, 6, 7, 8, 0]);
     $subSubscopeQueryable = $subscopeQueryable->select(function ($i) {
         return $i * 10;
     })->indexBy(function ($i) {
         return $i / 5;
     });
     $this->assertTrue($this->queryResultsCollection->tryComputeResults($subSubscopeQueryable->getExpression(), $results));
     $this->assertInstanceOf(ITraversable::ITRAVERSABLE_TYPE, $results);
     /** @var $results ITraversable */
     $this->assertSame([10 => 50, 12 => 60, 14 => 70, 16 => 80, 0 => 0], $results->asArray());
 }
Exemplo n.º 2
0
 public function interpretScopeSource(IQueryable $queryable)
 {
     $this->queryable = $queryable;
     $this->appendToHash($queryable->getSourceInfo()->getHash());
 }
Exemplo n.º 3
0
 public function interpretScopeSource(IQueryable $queryable)
 {
     $this->sourceInfo = $queryable->getSourceInfo();
 }