code cleanup

This commit is contained in:
2021-04-02 21:58:06 +02:00
parent 4a52ab2fd7
commit eea0aeacc6
67 changed files with 472 additions and 425 deletions

View File

@@ -3,19 +3,20 @@
namespace Driver\SQL\Query;
use Driver\SQL\Condition\CondOr;
use Driver\SQL\SQL;
class Delete extends Query {
private string $table;
private array $conditions;
public function __construct($sql, $table) {
public function __construct(SQL $sql, string $table) {
parent::__construct($sql);
$this->table = $table;
$this->conditions = array();
}
public function where(...$conditions) {
public function where(...$conditions): Delete {
$this->conditions[] = (count($conditions) === 1 ? $conditions : new CondOr($conditions));
return $this;
}
@@ -24,6 +25,6 @@ class Delete extends Query {
return $this->sql->executeDelete($this);
}
public function getTable() { return $this->table; }
public function getConditions() { return $this->conditions; }
public function getTable(): string { return $this->table; }
public function getConditions(): array { return $this->conditions; }
}