Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function deleteVehicle(string $globalId): string |
||
33 | { |
||
34 | $id = AppGlobalId::getIdFromGlobalId($globalId); |
||
35 | |||
36 | if (!$vehicle = $this->vehicleRepository->find($id)) { |
||
37 | throw new UserError(sprintf('Vehicle [%s] not found', $globalId)); |
||
38 | } |
||
39 | |||
40 | $this->vehicleRepository->delete($vehicle); |
||
41 | |||
42 | return $globalId; |
||
43 | } |
||
44 | |||
55 |