1 | <?php |
||
13 | final class CreateDamageCommandHandler |
||
14 | { |
||
15 | /** |
||
16 | * @var FlightDamageRepository |
||
17 | */ |
||
18 | private $damageRepository; |
||
19 | |||
20 | /** |
||
21 | * @var \DoliDB |
||
22 | */ |
||
23 | private $db; |
||
24 | |||
25 | /** |
||
26 | * @param \DoliDB $db |
||
27 | * @param FlightDamageRepository $damageRepository |
||
28 | */ |
||
29 | public function __construct(\DoliDB $db, FlightDamageRepository $damageRepository) |
||
34 | |||
35 | |||
36 | /** |
||
37 | * @param CreateDamageCommand $command |
||
38 | * |
||
39 | * @throws \Exception |
||
40 | */ |
||
41 | public function __invoke(CreateDamageCommand $command) |
||
53 | |||
54 | /** |
||
55 | * @param int $damageId |
||
56 | * @param int $invoiceId |
||
57 | * |
||
58 | * @throws \Exception |
||
59 | */ |
||
60 | private function linkSupplierInvoice($damageId, $invoiceId) |
||
68 | |||
69 | /** |
||
70 | * @param int $damageId |
||
71 | * @param int $flightId |
||
72 | */ |
||
73 | private function linkFlight($damageId, $flightId) |
||
77 | |||
78 | /** |
||
79 | * @param int $damageId |
||
80 | * @param int $targetId |
||
81 | * @param string $targetType |
||
82 | */ |
||
83 | private function insertLinks($damageId, $targetId, $targetType){ |
||
104 | |||
105 | } |