1 | <?php |
||
15 | class ColumnStatus extends Column |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * @var callable[] |
||
20 | */ |
||
21 | public $onChange = []; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $key; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $options = []; |
||
32 | |||
33 | /** |
||
34 | * @var boolean |
||
35 | */ |
||
36 | protected $caret = TRUE; |
||
37 | |||
38 | |||
39 | /** |
||
40 | * @param DataGrid $grid |
||
41 | * @param string $key |
||
42 | * @param string $column |
||
43 | * @param string $name |
||
44 | */ |
||
45 | public function __construct(DataGrid $grid, $key, $column, $name) |
||
53 | |||
54 | |||
55 | /** |
||
56 | * @return string |
||
57 | */ |
||
58 | public function getKey() |
||
62 | |||
63 | |||
64 | /** |
||
65 | * @return array |
||
66 | */ |
||
67 | public function getOptions() |
||
71 | |||
72 | |||
73 | /** |
||
74 | * @return string |
||
75 | */ |
||
76 | public function getColumn() |
||
80 | |||
81 | |||
82 | /** |
||
83 | * Find selected option for current item/row |
||
84 | * @param Row $row |
||
85 | * @return Option|NULL |
||
86 | */ |
||
87 | public function getCurrentOption(Row $row) |
||
97 | |||
98 | |||
99 | /** |
||
100 | * Add option to status select |
||
101 | * @param mixed $value |
||
102 | * @param string $text |
||
103 | */ |
||
104 | public function addOption($value, $text) |
||
112 | |||
113 | |||
114 | /** |
||
115 | * Column can have variables that will be passed to custom template scope |
||
116 | * @return array |
||
117 | */ |
||
118 | public function getTemplateVariables() |
||
126 | |||
127 | |||
128 | /** |
||
129 | * Should be a "caret" present in status dropdown? |
||
130 | * @param bool $use_caret |
||
131 | * @return static |
||
132 | */ |
||
133 | public function setCaret($use_caret) |
||
139 | |||
140 | |||
141 | /** |
||
142 | * @return boolean |
||
143 | */ |
||
144 | public function hasCaret() |
||
148 | |||
149 | } |
||
150 |