feat: reset definers on new query start

This commit is contained in:
Victor Westerlund 2024-02-26 13:37:16 +01:00
parent 98ed26a375
commit 831266d195

View file

@ -65,6 +65,11 @@
// Use the following table name
public function for(string $table): self {
// Reset all definers when a new query begins
$this->where();
$this->limit();
$this->order();
$this->table = $table;
return $this;
}
@ -151,7 +156,7 @@
}
// SQL LIMIT string
public function limit(?int $limit, ?int $offset = null): self {
public function limit(?int $limit = null, ?int $offset = null): self {
// Unset row limit if null was passed
if ($limit === null) {
$this->limit = null;
@ -182,7 +187,7 @@
}
// Return SQL SORT BY string from assoc array of columns and direction
public function order(?array $order_by): self {
public function order(?array $order_by = null): self {
// Unset row order by if null was passed
if ($order_by === null) {
$this->order_by = null;