/** * @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, ', '); }
/** * @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); }
/** * @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, ', ') . ')'; }
/** * @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; }