2024-06-18

This commit is contained in:
Juan Pablo Vial
2024-06-18 22:41:03 -04:00
parent 6169089475
commit 390e79ad6d
60 changed files with 3162 additions and 155 deletions

View File

@ -37,6 +37,9 @@ abstract class Repository implements Define\Repository
$this->connection->execute($query, [$model->id]);
}
/**
* @throws EmptyResult
*/
public function fetchById(int $id): Define\Model
{
$query = $this->connection->getQueryBuilder()
@ -45,6 +48,10 @@ abstract class Repository implements Define\Repository
->where("{$this->getKey()} = ?");
return $this->fetchOne($query, [$id]);
}
/**
* @throws EmptyResult
*/
public function fetchAll(null|string|array $ordering = null): array
{
$query = $this->connection->getQueryBuilder()