1 | <?php |
||
13 | class Navigation |
||
14 | { |
||
15 | /** |
||
16 | * Guard is needed to show only allowed navigation sections and items. |
||
17 | * |
||
18 | * @var GuardInterface |
||
19 | */ |
||
20 | private $guard = null; |
||
21 | |||
22 | /** |
||
23 | * Navigation sections list. |
||
24 | * |
||
25 | * @var array |
||
26 | */ |
||
27 | private $sections = []; |
||
28 | |||
29 | /** |
||
30 | * Navigation constructor. |
||
31 | * |
||
32 | * @param GuardInterface $guard |
||
33 | * @param array $sections |
||
34 | */ |
||
35 | public function __construct(GuardInterface $guard, array $sections) |
||
40 | |||
41 | /** |
||
42 | * Get all navigation sections. This is generator. |
||
43 | * |
||
44 | * @generator |
||
45 | * @return \Generator |
||
46 | */ |
||
47 | public function getSections(): \Generator |
||
53 | } |