Frontend, Bugfixes
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace Driver\SQL\Query;
|
||||
|
||||
use Driver\SQL\Condition\CondOr;
|
||||
|
||||
class Delete extends Query {
|
||||
|
||||
private string $table;
|
||||
@@ -14,7 +16,7 @@ class Delete extends Query {
|
||||
}
|
||||
|
||||
public function where(...$conditions) {
|
||||
$this->conditions = array_merge($this->conditions, $conditions);
|
||||
$this->conditions[] = (count($conditions) === 1 ? $conditions : new CondOr($conditions));
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,16 @@ use Driver\SQL\SQL;
|
||||
abstract class Query {
|
||||
|
||||
protected SQL $sql;
|
||||
public bool $dump;
|
||||
|
||||
public function __construct($sql) {
|
||||
$this->sql = $sql;
|
||||
$this->dump = false;
|
||||
}
|
||||
|
||||
public function dump() {
|
||||
$this->dump = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public abstract function execute();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Driver\SQL\Query;
|
||||
|
||||
use Driver\SQL\Condition\CondOr;
|
||||
use Driver\SQL\Join;
|
||||
|
||||
class Select extends Query {
|
||||
@@ -33,7 +34,7 @@ class Select extends Query {
|
||||
}
|
||||
|
||||
public function where(...$conditions) {
|
||||
$this->conditions = array_merge($this->conditions, $conditions);
|
||||
$this->conditions[] = (count($conditions) === 1 ? $conditions : new CondOr($conditions));
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace Driver\SQL\Query;
|
||||
|
||||
use Driver\SQL\Condition\CondOr;
|
||||
|
||||
class Update extends Query {
|
||||
|
||||
private array $values;
|
||||
@@ -16,7 +18,7 @@ class Update extends Query {
|
||||
}
|
||||
|
||||
public function where(...$conditions) {
|
||||
$this->conditions = array_merge($this->conditions, $conditions);
|
||||
$this->conditions[] = (count($conditions) === 1 ? $conditions : new CondOr($conditions));
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user