/**
  * @param AbstractBaseQuery $class
  * @param PlaceholderWriter $placeholderWriter
  * @param array             $parts
  */
 public static function writeLimitCondition(AbstractBaseQuery $class, PlaceholderWriter $placeholderWriter, array &$parts)
 {
     if (!is_null($class->getLimitStart())) {
         $start = $placeholderWriter->add($class->getLimitStart());
         $parts[] = "LIMIT {$start}";
     }
 }
예제 #2
0
 /**
  * @param string $column
  * @param string $direction
  * @param null   $table
  *
  * @return $this
  */
 public function orderBy($column, $direction = OrderBy::ASC, $table = null)
 {
     $current = parent::orderBy($column, $direction, $table);
     if ($this->getParentQuery() != null) {
         $this->getParentQuery()->orderBy($column, $direction, \is_null($table) ? $this->getTable() : $table);
     }
     return $current;
 }
예제 #3
0
 /**
  * @param \NilPortugues\Sql\QueryBuilder\Manipulation\AbstractBaseQuery
  *
  * @return \NilPortugues\Sql\QueryBuilder\Manipulation\AbstractBaseQuery
  */
 protected function injectBuilder(AbstractBaseQuery $query)
 {
     return $query->setBuilder($this);
 }