Interface und Fehlerklassen für die Repositories bestimmt.

This commit is contained in:
2021-03-30 13:31:18 +02:00
parent e6b9180432
commit 5141fff827
5 changed files with 91 additions and 0 deletions
@@ -0,0 +1,28 @@
<?php
namespace TorstenHettstedt\TimekeepingApi\Repositories;
/**
* @template T of \TorstenHettstedt\TimekeepingApi\Models\ModelInterface
*/
interface RepositoryReaderInterface
{
/**
*
* Gibt alle vorhandenen Einträge zurück
*
* @return T[]
*/
public function findAll(): array;
/**
* Gibt den Eintrag zurück, der durch die ID
*
* @param mixed $primary_key
*
* @return T
* @throws RepositoryRecordNotFoundException
*/
public function findByKey(mixed $primary_key);
}