1 | <?php |
||
14 | class Option extends Nette\Object |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * @var ColumnStatus |
||
19 | */ |
||
20 | protected $columnStatus; |
||
21 | |||
22 | /** |
||
23 | * @var mixed |
||
24 | */ |
||
25 | protected $value; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $text; |
||
31 | |||
32 | /** |
||
33 | * @var string|callable |
||
34 | */ |
||
35 | protected $title; |
||
36 | |||
37 | /** |
||
38 | * @var string|callable |
||
39 | */ |
||
40 | protected $class = 'btn-success'; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $class_secondary = 'ajax btn btn-xs'; |
||
46 | |||
47 | /** |
||
48 | * @var string|callable |
||
49 | */ |
||
50 | protected $icon; |
||
51 | |||
52 | |||
53 | /** |
||
54 | * [__construct description] |
||
55 | * @param ColumnStatus $columnStatus |
||
56 | * @param mixed $value |
||
57 | * @param string $text |
||
58 | */ |
||
59 | public function __construct(ColumnStatus $columnStatus, $value, $text) |
||
65 | |||
66 | |||
67 | /** |
||
68 | * @return mixed |
||
69 | */ |
||
70 | public function getValue() |
||
74 | |||
75 | |||
76 | /** |
||
77 | * End option fluent interface and return parent |
||
78 | * @return ColumnStatus |
||
79 | */ |
||
80 | public function endOption() |
||
84 | |||
85 | |||
86 | /** |
||
87 | * @param string $title |
||
88 | * @return static |
||
89 | */ |
||
90 | public function setTitle($title) |
||
96 | |||
97 | |||
98 | /** |
||
99 | * @return string |
||
100 | */ |
||
101 | public function getTitle() |
||
105 | |||
106 | |||
107 | /** |
||
108 | * @param string $class |
||
109 | * @param string $class_secondary |
||
110 | * @return static |
||
111 | */ |
||
112 | public function setClass($class, $class_secondary = NULL) |
||
122 | |||
123 | |||
124 | /** |
||
125 | * @return string |
||
126 | */ |
||
127 | public function getClass() |
||
131 | |||
132 | |||
133 | /** |
||
134 | * @param string $class_secondary |
||
135 | */ |
||
136 | public function setClassSecondary($class_secondary) |
||
140 | |||
141 | |||
142 | /** |
||
143 | * @return string |
||
144 | */ |
||
145 | public function getClassSecondary() |
||
149 | |||
150 | |||
151 | /** |
||
152 | * @param string $icon |
||
153 | * @return static |
||
154 | */ |
||
155 | public function setIcon($icon) |
||
161 | |||
162 | |||
163 | /** |
||
164 | * @return string |
||
165 | */ |
||
166 | public function getIcon() |
||
170 | |||
171 | |||
172 | /** |
||
173 | * @return string |
||
174 | */ |
||
175 | public function getText() |
||
179 | |||
180 | } |
||
181 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: