1 | <?php |
||
10 | trait HasNavigation |
||
11 | { |
||
12 | protected $icon; |
||
13 | |||
14 | protected $parentPageId; |
||
15 | |||
16 | protected $priority = 100; |
||
17 | |||
18 | /** |
||
19 | * @return mixed |
||
20 | */ |
||
21 | public function getIcon() |
||
25 | |||
26 | /** |
||
27 | * @param mixed $icon |
||
28 | * |
||
29 | * @return $this |
||
30 | */ |
||
31 | public function setIcon($icon) |
||
37 | |||
38 | /** |
||
39 | * @return mixed |
||
40 | */ |
||
41 | public function getParentPageId() |
||
45 | |||
46 | /** |
||
47 | * @param mixed $parentPageId |
||
48 | * |
||
49 | * @return $this |
||
50 | */ |
||
51 | public function setParentPageId($parentPageId) |
||
57 | |||
58 | public function hasParentPageId() |
||
62 | |||
63 | /** |
||
64 | * @return int |
||
65 | */ |
||
66 | public function getPriority(): int |
||
70 | |||
71 | /** |
||
72 | * @param int $priority |
||
73 | * |
||
74 | * @return $this |
||
75 | */ |
||
76 | public function setPriority(int $priority) |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function getNavigation() |
||
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | public function addToNavigation($badge = null) |
||
115 | |||
116 | /** |
||
117 | * page |
||
118 | * |
||
119 | * @param null $badge |
||
120 | * |
||
121 | * @return \Sco\Admin\Navigation\Page |
||
122 | */ |
||
123 | protected function makePage($badge = null) |
||
143 | |||
144 | /** |
||
145 | * @param array $parameters |
||
146 | * |
||
147 | * @return string |
||
148 | */ |
||
149 | public function getViewUrl(array $parameters = []) |
||
155 | } |
||
156 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: