1 | <?php |
||
2 | declare(strict_types=1); |
||
3 | |||
4 | namespace Nexendrie\Menu; |
||
5 | |||
6 | use Nette\Localization\ITranslator; |
||
7 | |||
8 | /** |
||
9 | * Menu |
||
10 | * |
||
11 | * @author Jakub Konečný |
||
12 | */ |
||
13 | 1 | class Menu extends Collection { |
|
14 | public string $title = ""; |
||
15 | public string $name; |
||
16 | public string $htmlId; |
||
17 | public ITranslator $translator; |
||
18 | |||
19 | public function __construct(string $name = "default", string $htmlId = "menu") { |
||
20 | 1 | parent::__construct(); |
|
21 | 1 | $this->name = $name; |
|
22 | 1 | $this->htmlId = $htmlId; |
|
23 | 1 | $this->translator = new class implements ITranslator { |
|
0 ignored issues
–
show
|
|||
24 | public function translate($message, ... $parameters): string { |
||
25 | 1 | return $message; |
|
26 | } |
||
27 | }; |
||
28 | 1 | } |
|
29 | |||
30 | /** |
||
31 | * @deprecated Access the property directly |
||
32 | */ |
||
33 | public function getTitle(): string { |
||
34 | return $this->title; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @deprecated Access the property directly |
||
39 | */ |
||
40 | public function setTitle(string $title): void { |
||
41 | $this->title = $title; |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @deprecated Access the property directly |
||
46 | */ |
||
47 | public function getName(): string { |
||
48 | return $this->name; |
||
49 | } |
||
50 | |||
51 | protected function setName(string $name): void { |
||
52 | $this->name = $name; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @deprecated Access the property directly |
||
57 | */ |
||
58 | public function getHtmlId(): string { |
||
59 | return $this->htmlId; |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @deprecated Access the property directly |
||
64 | */ |
||
65 | public function setHtmlId(string $htmlId): void { |
||
66 | $this->htmlId = $htmlId; |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * @deprecated Access the property directly |
||
71 | */ |
||
72 | public function getTranslator(): ITranslator { |
||
73 | return $this->translator; |
||
74 | } |
||
75 | |||
76 | /** |
||
77 | * @deprecated Access the property directly |
||
78 | */ |
||
79 | public function setTranslator(ITranslator $translator): void { |
||
80 | 1 | $this->translator = $translator; |
|
81 | 1 | } |
|
82 | } |
||
83 | ?> |
This interface has been deprecated. The supplier of the interface has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the interface will be removed and what other interface to use instead.