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\Actions; |
| 3 | |
| 4 | use Apie\Core\BoundedContext\BoundedContext; |
| 5 | use Apie\Core\BoundedContext\BoundedContextId; |
| 6 | use Apie\Core\Context\ApieContext; |
| 7 | use Apie\Core\Datalayers\Lists\EntityListInterface; |
| 8 | use Apie\Core\Entities\EntityInterface; |
| 9 | use Apie\Core\Identifiers\IdentifierInterface; |
| 10 | use Apie\Core\Lists\ItemHashmap; |
| 11 | use Apie\Core\Lists\ItemList; |
| 12 | use ReflectionClass; |
| 13 | use ReflectionMethod; |
| 14 | |
| 15 | interface ApieFacadeInterface |
| 16 | { |
| 17 | /** |
| 18 | * @template T of EntityInterface |
| 19 | * @param class-string<T>|ReflectionClass<T> $class |
| 20 | * @return EntityListInterface<T> |
| 21 | */ |
| 22 | public function all(string|ReflectionClass $class, BoundedContext|BoundedContextId $boundedContext): EntityListInterface; |
| 23 | |
| 24 | /** |
| 25 | * @template T of EntityInterface |
| 26 | * @param IdentifierInterface<T> $identifier |
| 27 | * @return T |
| 28 | */ |
| 29 | public function find(IdentifierInterface $identifier, BoundedContext|BoundedContextId $boundedContext): EntityInterface; |
| 30 | |
| 31 | /** |
| 32 | * @template T of EntityInterface |
| 33 | * @param T $entity |
| 34 | * @return T |
| 35 | */ |
| 36 | public function persistNew(EntityInterface $entity, BoundedContext|BoundedContextId $boundedContext): EntityInterface; |
| 37 | |
| 38 | /** |
| 39 | * @template T of EntityInterface |
| 40 | * @param T $entity |
| 41 | * @return T |
| 42 | */ |
| 43 | public function persistExisting(EntityInterface $entity, BoundedContext|BoundedContextId $boundedContext): EntityInterface; |
| 44 | |
| 45 | /** |
| 46 | * @template T of EntityInterface |
| 47 | * @param T $entity |
| 48 | * @return T |
| 49 | */ |
| 50 | public function upsert(EntityInterface $entity, BoundedContext|BoundedContextId $boundedContext): EntityInterface; |
| 51 | |
| 52 | public function removeExisting(EntityInterface $entity, BoundedContext|BoundedContextId $boundedContext): void; |
| 53 | |
| 54 | public function normalize(mixed $object, ApieContext $apieContext): string|int|float|bool|ItemList|ItemHashmap|null; |
| 55 | |
| 56 | /** |
| 57 | * @param string|int|float|bool|ItemList<mixed>|ItemHashmap<mixed>|array<string, mixed>|null $object |
| 58 | */ |
| 59 | public function denormalizeNewObject(string|int|float|bool|ItemList|ItemHashmap|array|null $object, string $desiredType, ApieContext $apieContext): mixed; |
| 60 | |
| 61 | /** |
| 62 | * @template T of object |
| 63 | * @param T $existingObject |
| 64 | * @return T |
| 65 | */ |
| 66 | public function denormalizeOnExistingObject(ItemHashmap $object, object $existingObject, ApieContext $apieContext): mixed; |
| 67 | |
| 68 | /** |
| 69 | * @param string|int|float|bool|ItemList<mixed>|ItemHashmap<mixed>|array<string, mixed>|null $input |
| 70 | */ |
| 71 | public function denormalizeOnMethodCall(string|int|float|bool|ItemList|ItemHashmap|array|null $input, ?object $object, ReflectionMethod $method, ApieContext $apieContext): mixed; |
| 72 | |
| 73 | public function createAction(ApieContext $apieContext): ActionInterface; |
| 74 | } |