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())); }
public function visitRange(Segments\Range $segment) { $this->parameters->addId($segment->getStartId(), ParameterHasher::valueType()); $this->parameters->addId($segment->getAmountId(), ParameterHasher::valueType()); return parent::visitRange($segment); }
public function visitRange(Segments\Range $query) { $this->traversable = $this->traversable->slice($this->resolvedParameters[$query->getStartId()], $this->resolvedParameters[$query->getAmountId()]); }
public function visitRange(Segments\Range $segment) { return parent::visitRange(new StaticRange($this->parameters->getResolvedParameters()[$segment->getStartId()], $this->parameters->getResolvedParameters()[$segment->getAmountId()])); }
public function __construct($start, $amount) { parent::__construct('', ''); $this->start = $start; $this->amount = $amount; }