function toDialectString(IDialect $dialect) { $querySlices = array(); $querySlices[] = 'DELETE FROM'; $querySlices[] = $dialect->quoteIdentifier($this->table); if ($this->condition) { $querySlices[] = 'WHERE'; $querySlices[] = $this->condition->toDialectString($dialect); } $compiledQuery = join(' ', $querySlices); return $compiledQuery; }
function toDialectString(IDialect $dialect) { $compiledSlices = array(); $compiledSlices[] = $this->getJoinMethod()->toDialectString($dialect); $compiledSlices[] = $this->getSource()->toDialectString($dialect); $compiledSlices[] = 'ON'; $compiledSlices[] = '('; $compiledSlices[] = $this->condition->toDialectString($dialect); $compiledSlices[] = ')'; $compiledString = join(' ', $compiledSlices); return $compiledString; }
function toDialectString(IDialect $dialect) { $querySlices = array(); $querySlices[] = 'SELECT'; if ($this->distinct) { $querySlices[] = 'DISTINCT'; } $querySlices[] = $this->get->toDialectString($dialect); if (!$this->sources->isEmpty()) { $querySlices[] = 'FROM'; $querySlices[] = $this->sources->toDialectString($dialect); } // WHERE if ($this->condition) { $querySlices[] = 'WHERE'; $querySlices[] = $this->condition->toDialectString($dialect); } // GROUP BY if (!$this->groups->isEmpty()) { $querySlices[] = 'GROUP BY'; $querySlices[] = $this->groups->toDialectString($dialect); } // HAVING if ($this->having) { $querySlices[] = 'HAVING'; $querySlices[] = $this->having->toDialectString($dialect); } if (!$this->order->isEmpty()) { $querySlices[] = $this->order->toDialectString($dialect); } if ($this->limit) { $querySlices[] = 'LIMIT'; $querySlices[] = $this->limit; } if ($this->offset) { $querySlices[] = 'OFFSET'; $querySlices[] = $this->offset; } $queryString = join(' ', $querySlices); return $queryString; }