Beispiel #1
0
 /**
  * @inheritDoc
  */
 protected function compileBase(DriverInterface $driver)
 {
     if ($this->valuesBag->isEmpty()) {
         throw new CompileException('No values found for update query.');
     }
     return 'UPDATE ' . $this->table->compile($driver) . ' SET ' . $this->valuesBag->concat($driver, ', ');
 }
Beispiel #2
0
 /**
  * @inheritDoc
  */
 protected function compileBase(DriverInterface $driver)
 {
     if ($this->columnsBag->isEmpty()) {
         throw new CompileException('Select query requires columns list.');
     }
     return 'SELECT ' . $this->columnsBag->concat($driver, ', ') . ' FROM ' . $this->table->compile($driver);
 }
Beispiel #3
0
 /**
  * @inheritDoc
  */
 public function compile(DriverInterface $driver)
 {
     if ($this->columnsBag->isEmpty()) {
         throw new CompileException('The table definition requires columns list.');
     }
     return 'CREATE TABLE ' . $this->table->compile($driver) . '(' . $this->columnsBag->concat($driver, ', ') . ')';
 }
Beispiel #4
0
 /**
  * @inheritDoc
  */
 public function compile(DriverInterface $driver)
 {
     if ($this->expressions->isEmpty()) {
         return '1';
     }
     $compiled = $this->expressions->concat($driver, ' ' . $this->operator . ' ');
     if ($this->expressions->count() > 1) {
         return '(' . $compiled . ')';
     }
     return $compiled;
 }