la méthode find de l'objet retourne l'objet lui même
This commit is contained in:
@@ -66,16 +66,15 @@ class Model
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function find(mixed $key): bool
|
||||
{
|
||||
$res = false;
|
||||
public function find(mixed $key): mixed
|
||||
{
|
||||
$qb = $this->newQueryBuilder();
|
||||
$find = $qb->find($key);
|
||||
if ($find !== null) {
|
||||
$this->fillData($find->getValues());
|
||||
$res = true;
|
||||
return $this;
|
||||
}
|
||||
return $res;
|
||||
return null;
|
||||
}
|
||||
|
||||
public function save(): bool
|
||||
|
||||
Reference in New Issue
Block a user