2024-06-18
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user