Exemplo 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()));
 }