Author: Elliot Levin (elliotlevin@hotmail.com)
Inheritance: extends Segment
Ejemplo n.º 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()));
 }
 public function visitRange(Segments\Range $segment)
 {
     $this->parameters->addId($segment->getStartId(), ParameterHasher::valueType());
     $this->parameters->addId($segment->getAmountId(), ParameterHasher::valueType());
     return parent::visitRange($segment);
 }
Ejemplo n.º 3
0
 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()]));
 }
Ejemplo n.º 5
0
 public function __construct($start, $amount)
 {
     parent::__construct('', '');
     $this->start = $start;
     $this->amount = $amount;
 }