1 | <?php |
||
16 | class ColumnStatus extends Column |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * @var callable[] |
||
21 | */ |
||
22 | public $onChange = []; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $key; |
||
28 | |||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $options = []; |
||
33 | |||
34 | /** |
||
35 | * @var boolean |
||
36 | */ |
||
37 | protected $caret = TRUE; |
||
38 | |||
39 | |||
40 | /** |
||
41 | * @param DataGrid $grid |
||
42 | * @param string $key |
||
43 | * @param string $column |
||
44 | * @param string $name |
||
45 | */ |
||
46 | public function __construct(DataGrid $grid, $key, $column, $name) |
||
54 | |||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | public function getKey() |
||
63 | |||
64 | |||
65 | /** |
||
66 | * @return array |
||
67 | */ |
||
68 | public function getOptions() |
||
72 | |||
73 | |||
74 | /** |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getColumn() |
||
81 | |||
82 | |||
83 | /** |
||
84 | * Find selected option for current item/row |
||
85 | * @param Row $row |
||
86 | * @return Option|NULL |
||
87 | */ |
||
88 | public function getCurrentOption(Row $row) |
||
98 | |||
99 | |||
100 | /** |
||
101 | * Add option to status select |
||
102 | * @param mixed $value |
||
103 | * @param string $text |
||
104 | */ |
||
105 | public function addOption($value, $text) |
||
117 | |||
118 | |||
119 | /** |
||
120 | * @param mixed $value |
||
121 | * @return void |
||
122 | */ |
||
123 | public function removeOption($value) |
||
131 | |||
132 | |||
133 | /** |
||
134 | * Column can have variables that will be passed to custom template scope |
||
135 | * @return array |
||
136 | */ |
||
137 | public function getTemplateVariables() |
||
146 | |||
147 | |||
148 | /** |
||
149 | * Should be a "caret" present in status dropdown? |
||
150 | * @param bool $use_caret |
||
151 | * @return static |
||
152 | */ |
||
153 | public function setCaret($use_caret) |
||
159 | |||
160 | |||
161 | /** |
||
162 | * @return boolean |
||
163 | */ |
||
164 | public function hasCaret() |
||
168 | |||
169 | } |
||
170 |