Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
29 | public function __invoke(DeleteFamilyLog $command): void |
||
30 | { |
||
31 | $familyLogToDelete = $this->repository->findChildren($command->uuid()); |
||
32 | |||
33 | if (true === $familyLogToDelete->hasChildren()) { |
||
34 | throw new \DomainException('This FamilyLog has children, and cannot be deleted'); |
||
35 | } |
||
36 | |||
37 | $this->repository->delete($familyLogToDelete->uuid()); |
||
38 | } |
||
40 |