ajout retour en collection, modification des tests en conséquences

This commit is contained in:
Gregory Letellier
2023-10-31 10:47:11 +01:00
parent 42d3d38a0a
commit fe6d2f27b8
2 changed files with 18 additions and 17 deletions

View File

@@ -124,7 +124,7 @@ class QueryBuilder
$this->columns = ["*"];
$data = $this->getData();
if (count($data) > 0) {
return $this->prepareModels($data)[0];
return $this->prepareModels($data)->first();
}
return null;
}
@@ -172,7 +172,7 @@ class QueryBuilder
$model = new Model();
$ret[] = $model->setPk($this->pk)->setTable($this->table)->fillData($row);
}
return $ret;
return new Collection($ret);
}
private function getData(): mixed