@@ 61-79 (lines=19) @@ | ||
58 | $this->repository->persist($menu); |
|
59 | } |
|
60 | ||
61 | private function buildTree(MenuTranslation $menuTranslation, array $items, MenuItemId $parentId = null) |
|
62 | { |
|
63 | foreach ($items as $item) { |
|
64 | $menuItemId = MenuItemId::generate(); |
|
65 | ||
66 | $menuTranslation->addItem( |
|
67 | new MenuItemLink( |
|
68 | $item['label'], |
|
69 | $item['url'] |
|
70 | ), |
|
71 | $parentId, |
|
72 | $menuItemId |
|
73 | ); |
|
74 | ||
75 | if (isset($item['children'])) { |
|
76 | $this->buildTree($menuTranslation, $item['children'], $menuItemId); |
|
77 | } |
|
78 | } |
|
79 | } |
|
80 | } |
|
81 |
@@ 63-81 (lines=19) @@ | ||
60 | } |
|
61 | } |
|
62 | ||
63 | private function buildTree(MenuTranslation $menuTranslation, array $items, MenuItemId $parentId = null) |
|
64 | { |
|
65 | foreach ($items as $item) { |
|
66 | $menuItemId = MenuItemId::generate(); |
|
67 | ||
68 | $menuTranslation->addItem( |
|
69 | new MenuItemLink( |
|
70 | $item['label'], |
|
71 | $item['url'] |
|
72 | ), |
|
73 | $parentId, |
|
74 | $menuItemId |
|
75 | ); |
|
76 | ||
77 | if (isset($item['children'])) { |
|
78 | $this->buildTree($menuTranslation, $item['children'], $menuItemId); |
|
79 | } |
|
80 | } |
|
81 | } |
|
82 | } |
|
83 |