1 | <?php |
||
18 | trait ChoiceAwareElementMethods |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * @var array List of options |
||
23 | */ |
||
24 | protected $options = []; |
||
25 | |||
26 | /** |
||
27 | * Sets element options |
||
28 | * |
||
29 | * @param array $options |
||
30 | * |
||
31 | * @return self|$this|ChoiceAwareElementInterface |
||
32 | */ |
||
33 | 34 | public function setOptions(array $options) |
|
38 | |||
39 | /** |
||
40 | * Get element options |
||
41 | * |
||
42 | * @return array |
||
43 | */ |
||
44 | 6 | public function getOptions() |
|
48 | |||
49 | /** |
||
50 | * Add an option to the options list |
||
51 | * |
||
52 | * @param string $key |
||
53 | * @param string $value |
||
54 | * |
||
55 | * @return self|$this|ChoiceAwareElementInterface |
||
56 | */ |
||
57 | 2 | public function addOption($key, $value) |
|
62 | } |