Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | namespace Apie\Core\Datalayers; |
| 3 | |
| 4 | use Apie\Core\BoundedContext\BoundedContextId; |
| 5 | use Apie\Core\Datalayers\Lists\EntityListInterface; |
| 6 | use Apie\Core\Entities\EntityInterface; |
| 7 | use Apie\Core\Identifiers\IdentifierInterface; |
| 8 | use ReflectionClass; |
| 9 | |
| 10 | interface ApieDatalayer |
| 11 | { |
| 12 | /** |
| 13 | * @template T of EntityInterface |
| 14 | * @param ReflectionClass<T> $class |
| 15 | * @return EntityListInterface<T> |
| 16 | */ |
| 17 | public function all(ReflectionClass $class, ?BoundedContextId $boundedContextId = null): EntityListInterface; |
| 18 | |
| 19 | /** |
| 20 | * @template T of EntityInterface |
| 21 | * @param IdentifierInterface<T> $identifier |
| 22 | * @return T |
| 23 | */ |
| 24 | public function find(IdentifierInterface $identifier, ?BoundedContextId $boundedContextId = null): EntityInterface; |
| 25 | |
| 26 | /** |
| 27 | * @template T of EntityInterface |
| 28 | * @param T $entity |
| 29 | * @return T |
| 30 | */ |
| 31 | public function persistNew(EntityInterface $entity, ?BoundedContextId $boundedContextId = null): EntityInterface; |
| 32 | |
| 33 | /** |
| 34 | * @template T of EntityInterface |
| 35 | * @param T $entity |
| 36 | * @return T |
| 37 | */ |
| 38 | public function persistExisting(EntityInterface $entity, ?BoundedContextId $boundedContextId = null): EntityInterface; |
| 39 | |
| 40 | public function removeExisting(EntityInterface $entity, ?BoundedContextId $boundedContextId = null): void; |
| 41 | |
| 42 | /** |
| 43 | * @template T of EntityInterface |
| 44 | * @param T $entity |
| 45 | * @return T |
| 46 | */ |
| 47 | public function upsert(EntityInterface $entity, ?BoundedContextId $boundedContextId): EntityInterface; |
| 48 | } |