diff --git a/lib/Db/QueryBuilderPropsTrait.php b/lib/Db/QueryBuilderPropsTrait.php index 8dde4a789..8f4416ad0 100644 --- a/lib/Db/QueryBuilderPropsTrait.php +++ b/lib/Db/QueryBuilderPropsTrait.php @@ -15,9 +15,9 @@ trait QueryBuilderPropsTrait /** * The name of the table * - * @var string|null + * @var string */ - protected $table; + protected $table = ''; /** * The column names of the table @@ -55,7 +55,7 @@ trait QueryBuilderPropsTrait protected $queryParts = [ 'select' => [], 'distinct' => null, - 'from' => null, + 'from' => '', 'join' => [], 'set' => [], 'where' => [], diff --git a/lib/Db/QueryBuilderTrait.php b/lib/Db/QueryBuilderTrait.php index ac7824bbc..86d094b08 100644 --- a/lib/Db/QueryBuilderTrait.php +++ b/lib/Db/QueryBuilderTrait.php @@ -520,7 +520,7 @@ public function getDbKeyConverter(): callable */ protected function getTable(): ?string { - return $this->table ?? null; + return $this->table; } /** diff --git a/lib/ModelTrait.php b/lib/ModelTrait.php index a367cfd34..900cccbb0 100644 --- a/lib/ModelTrait.php +++ b/lib/ModelTrait.php @@ -590,7 +590,7 @@ protected function toRet($merge = []): Ret */ protected function getTable(): string { - if (!isset($this->table)) { + if (!$this->table) { $str = $this->wei->str; $this->table = $str->pluralize($str->snake($this->getModelBaseName())); }