mirror of
https://codeberg.org/vlw/php-mysql.git
synced 2025-09-14 08:43:40 +02:00
feat: remove table model by passing null to with()
This commit is contained in:
parent
13720e772e
commit
bb3e91df36
1 changed files with 7 additions and 1 deletions
|
@ -48,7 +48,13 @@
|
|||
}
|
||||
|
||||
// Restrict query to array of column names
|
||||
public function with(array $model): self {
|
||||
public function with(?array $model = null): self {
|
||||
// Remove table model if empty
|
||||
if (!$model) {
|
||||
$this->model = null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
// Reset table model
|
||||
$this->model = [];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue