From 74cb576a2ed037faebf1194ca2a012cc13035a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sat, 8 Jul 2023 14:36:22 +0200 Subject: [PATCH] where should accept $relation as null --- src/Database/Query/Select.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Database/Query/Select.php b/src/Database/Query/Select.php index 4eb53a0..32b409c 100644 --- a/src/Database/Query/Select.php +++ b/src/Database/Query/Select.php @@ -97,28 +97,28 @@ class Select return $this; } - public function where($column, string $relation = null, $value = null): Select + public function where($column, ?string $relation = null, $value = null): Select { $this->addWhereCondition('AND', $column, $relation, $value); return $this; } - public function orWhere($column, string $relation = null, $value = null): Select + public function orWhere($column, ?string $relation = null, $value = null): Select { $this->addWhereCondition('OR', $column, $relation, $value); return $this; } - public function having($column, string $relation = null, $value = null): Select + public function having($column, ?string $relation = null, $value = null): Select { $this->addHavingCondition('AND', $column, $relation, $value); return $this; } - public function orHaving($column, string $relation = null, $value = null): Select + public function orHaving($column, ?string $relation = null, $value = null): Select { $this->addHavingCondition('OR', $column, $relation, $value); @@ -211,12 +211,12 @@ class Select $this->joins[] = [$type, $table, $column1, $relation, $column2]; } - private function addWhereCondition(string $logic, $column, string $relation, $value): void + private function addWhereCondition(string $logic, $column, ?string $relation, $value): void { $this->conditions[self::CONDITION_WHERE][] = [$logic, $column, $relation, $value]; } - private function addHavingCondition(string $logic, $column, string $relation, $value): void + private function addHavingCondition(string $logic, $column, ?string $relation, $value): void { $this->conditions[self::CONDITION_HAVING][] = [$logic, $column, $relation, $value]; }