Conditions | 2 |
Paths | 2 |
Total Lines | 24 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
35 | public function __invoke(AddMenuTranslationCommand $command) |
||
36 | { |
||
37 | $menu = $this->repository->menuOfId( |
||
38 | MenuId::generate( |
||
39 | $command->menuId() |
||
40 | ) |
||
41 | ); |
||
42 | if (!$menu instanceof Menu) { |
||
43 | throw new MenuDoesNotExistException(); |
||
44 | } |
||
45 | |||
46 | $menu->addTranslation( |
||
47 | new MenuTranslation( |
||
48 | MenuTranslationId::generate(), |
||
49 | new Locale( |
||
50 | $command->locale() |
||
51 | ), |
||
52 | new MenuName( |
||
53 | $command->name() |
||
54 | ) |
||
55 | ) |
||
56 | ); |
||
57 | $this->repository->persist($menu); |
||
58 | } |
||
59 | } |
||
60 |