Total Complexity | 3 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
13 | abstract class SimpleCommandHandler |
||
14 | { |
||
15 | private $repository; |
||
16 | |||
17 | public function __construct(Repository $repository) |
||
18 | { |
||
19 | $this->repository = $repository; |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * @param EntityIdentifier $aggregateId |
||
24 | * |
||
25 | * @return IdentifiableEventSourcedEntity |
||
26 | */ |
||
27 | protected function loadFromRepository(EntityIdentifier $aggregateId): EventSourcedEntity |
||
28 | { |
||
29 | return $this->repository->load($aggregateId); |
||
30 | } |
||
31 | |||
32 | protected function saveToRepository(IdentifiableEventSourcedEntity $aggregate): void |
||
35 | } |
||
36 | } |
||
37 |