1 | <?php |
||
13 | class SplitItem implements MenuItemInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private $text; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | private $items; |
||
24 | |||
25 | /** |
||
26 | * @var int |
||
27 | * -1 means no item selected |
||
28 | */ |
||
29 | private $selectedItemIndex = -1; |
||
30 | |||
31 | /** |
||
32 | * @var int |
||
33 | */ |
||
34 | private $margin = 2; |
||
35 | |||
36 | |||
37 | public function __construct(string $text, array $items) |
||
42 | |||
43 | /** |
||
44 | * The output text for the item |
||
45 | */ |
||
46 | public function getRows(MenuStyle $style, bool $selected = false) : array |
||
106 | |||
107 | /** |
||
108 | * |
||
109 | */ |
||
110 | public function setSelectedItemIndex(int $index) : void |
||
114 | |||
115 | /** |
||
116 | * |
||
117 | */ |
||
118 | public function getSelectedItemIndex() : int |
||
125 | |||
126 | /** |
||
127 | * |
||
128 | */ |
||
129 | public function getItems() : array |
||
133 | |||
134 | /** |
||
135 | * Can the item be selected |
||
136 | */ |
||
137 | public function canSelect() : bool |
||
141 | |||
142 | /** |
||
143 | * Execute the items callable if required |
||
144 | */ |
||
145 | public function getSelectAction() : ?callable |
||
149 | |||
150 | /** |
||
151 | * Whether or not the menu item is showing the menustyle extra value |
||
152 | */ |
||
153 | public function showsItemExtra() : bool |
||
157 | |||
158 | /** |
||
159 | * Enable showing item extra |
||
160 | */ |
||
161 | public function showItemExtra() : void |
||
165 | |||
166 | /** |
||
167 | * Disable showing item extra |
||
168 | */ |
||
169 | public function hideItemExtra() : void |
||
173 | |||
174 | /** |
||
175 | * Return the raw string of text |
||
176 | */ |
||
177 | public function getText() : string |
||
181 | } |
||
182 |