1 | <?php |
||
20 | abstract class NavigationItemFactory extends HydratorContainer implements ItemFactory |
||
21 | { |
||
22 | const OPTIONS_ITEMS = 'items'; |
||
23 | |||
24 | /** @var PropertyFactory */ |
||
25 | private $factory; |
||
26 | |||
27 | public function __construct(PropertyFactory $factory) |
||
31 | |||
32 | public function addHydrator(ItemConfig $config) |
||
36 | |||
37 | /** |
||
38 | * @param RootNavigationItem $navigation |
||
39 | */ |
||
40 | public function build(RootNavigationItem &$navigation) |
||
48 | |||
49 | /** |
||
50 | * @param array $item |
||
51 | * @return Item |
||
52 | */ |
||
53 | public function create(array $item): Item |
||
68 | |||
69 | /** |
||
70 | * @param NavigationItem $child |
||
71 | * @return array |
||
72 | */ |
||
73 | public function flatten(NavigationItem $child): array |
||
90 | |||
91 | /** |
||
92 | * @return PropertyFactory |
||
93 | */ |
||
94 | protected function getFactory(): PropertyFactory |
||
98 | |||
99 | /** |
||
100 | * @param RootNavigationItem $navigation |
||
101 | * @return array |
||
102 | */ |
||
103 | abstract protected function getData(RootNavigationItem &$navigation): array; |
||
104 | |||
105 | /** |
||
106 | * @param Item $item |
||
107 | * @param array $config |
||
108 | * |
||
109 | * @return void |
||
110 | */ |
||
111 | private function addMatchObjects(Item &$item, array $config) |
||
123 | |||
124 | /** |
||
125 | * @param array $config |
||
126 | * @param NavigationItem $item |
||
127 | * |
||
128 | * @return void |
||
129 | */ |
||
130 | private function addMatchesConfig(array &$config, NavigationItem $item) |
||
140 | } |
||
141 |