Contact Mails
This commit is contained in:
@@ -59,7 +59,7 @@ class AlterTable extends Query {
|
||||
public function getConstraint(): ?Constraint { return $this->constraint; }
|
||||
public function getTable(): string { return $this->table; }
|
||||
|
||||
public function build(array &$params, Query $context = NULL): ?string {
|
||||
public function build(array &$params): ?string {
|
||||
$tableName = $this->sql->tableName($this->getTable());
|
||||
$action = $this->getAction();
|
||||
$column = $this->getColumn();
|
||||
|
||||
@@ -36,7 +36,7 @@ class CreateProcedure extends Query {
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function build(array &$params, Query $context = NULL): ?string {
|
||||
public function build(array &$params): ?string {
|
||||
$head = $this->sql->getProcedureHead($this);
|
||||
$body = $this->sql->getProcedureBody($this);
|
||||
$tail = $this->sql->getProcedureTail();
|
||||
|
||||
@@ -61,7 +61,7 @@ class CreateTrigger extends Query {
|
||||
public function getTable(): string { return $this->tableName; }
|
||||
public function getProcedure(): CreateProcedure { return $this->procedure; }
|
||||
|
||||
public function build(array &$params, Query $context = NULL): ?string {
|
||||
public function build(array &$params): ?string {
|
||||
$name = $this->sql->tableName($this->getName());
|
||||
$time = $this->getTime();
|
||||
$event = $this->getEvent();
|
||||
|
||||
@@ -24,7 +24,7 @@ class Delete extends Query {
|
||||
public function getTable(): string { return $this->table; }
|
||||
public function getConditions(): array { return $this->conditions; }
|
||||
|
||||
public function build(array &$params, Query $context = NULL): ?string {
|
||||
public function build(array &$params): ?string {
|
||||
$table = $this->sql->tableName($this->getTable());
|
||||
$where = $this->sql->getWhereClause($this->getConditions(), $params);
|
||||
return "DELETE FROM $table$where";
|
||||
|
||||
@@ -23,7 +23,7 @@ class Drop extends Query {
|
||||
return $this->table;
|
||||
}
|
||||
|
||||
public function build(array &$params, Query $context = NULL): ?string {
|
||||
public function build(array &$params): ?string {
|
||||
return "DROP TABLE " . $this->sql->tableName($this->getTable());
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ class Insert extends Query {
|
||||
public function onDuplicateKey(): ?Strategy { return $this->onDuplicateKey; }
|
||||
public function getReturning(): ?string { return $this->returning; }
|
||||
|
||||
public function build(array &$params, Query $context = NULL): ?string {
|
||||
public function build(array &$params): ?string {
|
||||
$tableName = $this->sql->tableName($this->getTableName());
|
||||
$columns = $this->getColumns();
|
||||
$rows = $this->getRows();
|
||||
|
||||
@@ -24,4 +24,6 @@ abstract class Query extends Expression {
|
||||
public function execute() {
|
||||
return $this->sql->executeQuery($this);
|
||||
}
|
||||
|
||||
public abstract function build(array &$params): ?string;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ class Select extends Query {
|
||||
public function getOffset(): int { return $this->offset; }
|
||||
public function getGroupBy(): array { return $this->groupColumns; }
|
||||
|
||||
public function build(array &$params, Query $context = NULL): ?string {
|
||||
public function build(array &$params): ?string {
|
||||
$columns = $this->sql->columnName($this->getColumns());
|
||||
$tables = $this->getTables();
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class Truncate extends Query {
|
||||
|
||||
public function getTable(): string { return $this->tableName; }
|
||||
|
||||
public function build(array &$params, Query $context = NULL): ?string {
|
||||
public function build(array &$params): ?string {
|
||||
return "TRUNCATE " . $this->sql->tableName($this->getTable());
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ class Update extends Query {
|
||||
public function getConditions(): array { return $this->conditions; }
|
||||
public function getValues(): array { return $this->values; }
|
||||
|
||||
public function build(array &$params, Query $context = NULL): ?string {
|
||||
public function build(array &$params): ?string {
|
||||
$table = $this->sql->tableName($this->getTable());
|
||||
|
||||
$valueStr = array();
|
||||
|
||||
@@ -315,6 +315,8 @@ abstract class SQL {
|
||||
protected function createExpression(Expression $exp, array &$params) {
|
||||
if ($exp instanceof Column) {
|
||||
return $this->columnName($exp);
|
||||
} else if ($exp instanceof Query) {
|
||||
return "(" . $exp->build($params) . ")";
|
||||
} else {
|
||||
$this->lastError = "Unsupported expression type: " . get_class($exp);
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user