1 | 2 | simandl | <?php |
2 | | | |
3 | | | namespace Phem\Libraries\UI\Model; |
4 | | | |
5 | | | use Phem\Core\Collection; |
6 | | | |
7 | | | /** |
8 | | | * @author Jakub PetrĹžĂlka <petrzilka@czweb.net> |
9 | | | */ |
10 | | | class SelectBox extends Control |
11 | | | { |
12 | | | |
13 | | | private $options; |
14 | | | private $enabled = true; |
15 | | | |
16 | | | /** |
17 | | | * @\Phem\Libraries\UI\Annotations\DomAttr(name="value") |
18 | | | */ |
19 | | | private $selected; |
20 | | | private $onChange; |
21 | | | |
22 | | | function __construct($parent) |
23 | | | { |
24 | | | parent::__construct($parent); |
25 | | | $this->onChange = new Collection(); |
26 | | | } |
27 | | | |
28 | | | public function getOptions() |
29 | | | { |
30 | | | return $this->options; |
31 | | | } |
32 | | | |
33 | | | public function getSelected() |
34 | | | { |
35 | | | return $this->selected; |
36 | | | } |
37 | | | |
38 | | | protected function setOptions($options) |
39 | | | { |
40 | | | $this->options = $options; |
41 | | | } |
42 | | | |
43 | | | protected function setSelected($selected) |
44 | | | { |
45 | | | $this->selected = $selected; |
46 | | | } |
47 | | | |
48 | | | |
49 | | | public function getEnabled() |
50 | | | { |
51 | | | return $this->enabled; |
52 | | | } |
53 | | | |
54 | | | protected function setEnabled($enabled) |
55 | | | { |
56 | | | $this->enabled = $enabled; |
57 | | | } |
58 | | | |
59 | | | public function OnChange() |
60 | | | { |
61 | | | return $this->onChange; |
62 | | | } |
63 | | | |
64 | | | public function getValue() |
65 | | | { |
66 | | | return $this->getText(); |
67 | | | } |
68 | | | |
69 | | | protected function setValue($value) |
70 | | | { |
71 | | | $this->setText($value); |
72 | | | } |
73 | | | |
74 | | | } |