Author: Elliot Levin (elliotlevin@hotmail.com)
Inheritance: extends Segment
コード例 #1
0
 public function visitRange(Segments\Range $query)
 {
     if (!$query instanceof StaticRange) {
         throw new PinqDemoSqlException('Range must be a static range class');
     }
     // As the LIMIT clause will always be the last clause in the compiled SELECT
     // query, we do not need to wrap the SELECT in a derived table as this will
     // always be evaluated after the previous segment.
     $this->compilation->sql .= ' LIMIT ';
     if ($query->hasAmount()) {
         $this->compilation->sql .= $this->compilation->expressionCompiler->compile(O\Expression::value($query->getAmount()));
     } else {
         $this->compilation->sql .= '18446744073709551615';
     }
     $this->compilation->sql .= ' OFFSET ';
     $this->compilation->sql .= $this->compilation->expressionCompiler->compile(O\Expression::value($query->getStart()));
 }
コード例 #2
0
 public function visitRange(Segments\Range $segment)
 {
     $this->parameters->addId($segment->getStartId(), ParameterHasher::valueType());
     $this->parameters->addId($segment->getAmountId(), ParameterHasher::valueType());
     return parent::visitRange($segment);
 }
コード例 #3
0
ファイル: ScopeEvaluator.php プロジェクト: timetoogo/pinq
 public function visitRange(Segments\Range $query)
 {
     $this->traversable = $this->traversable->slice($this->resolvedParameters[$query->getStartId()], $this->resolvedParameters[$query->getAmountId()]);
 }
コード例 #4
0
 public function visitRange(Segments\Range $segment)
 {
     return parent::visitRange(new StaticRange($this->parameters->getResolvedParameters()[$segment->getStartId()], $this->parameters->getResolvedParameters()[$segment->getAmountId()]));
 }
コード例 #5
0
 public function __construct($start, $amount)
 {
     parent::__construct('', '');
     $this->start = $start;
     $this->amount = $amount;
 }