1 | <?php |
||
19 | class Column extends Fluent |
||
20 | { |
||
21 | /** |
||
22 | * @param array $attributes |
||
23 | */ |
||
24 | public function __construct($attributes = []) |
||
48 | |||
49 | /** |
||
50 | * Create a computed column that is not searchable/orderable. |
||
51 | * |
||
52 | * @param string $data |
||
53 | * @return Column |
||
54 | */ |
||
55 | public static function computed($data) |
||
59 | |||
60 | /** |
||
61 | * Set column searchable flag. |
||
62 | * |
||
63 | * @param bool $flag |
||
64 | * @return $this |
||
65 | */ |
||
66 | public function searchable(bool $flag = true) |
||
72 | |||
73 | /** |
||
74 | * Set column orderable flag. |
||
75 | * |
||
76 | * @param bool $flag |
||
77 | * @return $this |
||
78 | */ |
||
79 | public function orderable(bool $flag = true) |
||
85 | |||
86 | /** |
||
87 | * Make a new column instance. |
||
88 | * |
||
89 | * @param string $data |
||
90 | * @param string $name |
||
91 | * @return Column |
||
92 | */ |
||
93 | public static function make($data, $name = '') |
||
102 | |||
103 | /** |
||
104 | * Create a checkbox column. |
||
105 | * |
||
106 | * @return Column |
||
107 | */ |
||
108 | public static function checkbox() |
||
116 | |||
117 | /** |
||
118 | * Set column class name. |
||
119 | * |
||
120 | * @param string $class |
||
121 | * @return $this |
||
122 | */ |
||
123 | public function className($class) |
||
129 | |||
130 | /** |
||
131 | * Set column default content. |
||
132 | * |
||
133 | * @param string $value |
||
134 | * @return $this |
||
135 | */ |
||
136 | public function content($value) |
||
142 | |||
143 | /** |
||
144 | * Set column exportable flag. |
||
145 | * |
||
146 | * @param bool $flag |
||
147 | * @return $this |
||
148 | */ |
||
149 | public function exportable(bool $flag = true) |
||
155 | |||
156 | /** |
||
157 | * Set column printable flag. |
||
158 | * |
||
159 | * @param bool $flag |
||
160 | * @return $this |
||
161 | */ |
||
162 | public function printable(bool $flag = true) |
||
168 | |||
169 | /** |
||
170 | * Set column width value. |
||
171 | * |
||
172 | * @param int|string $value |
||
173 | * @return $this |
||
174 | */ |
||
175 | public function width($value) |
||
181 | |||
182 | /** |
||
183 | * Set column title. |
||
184 | * |
||
185 | * @param string $value |
||
186 | * @return $this |
||
187 | */ |
||
188 | public function title($value) |
||
194 | |||
195 | /** |
||
196 | * Set column name. |
||
197 | * |
||
198 | * @param string $value |
||
199 | * @return $this |
||
200 | */ |
||
201 | public function name($value) |
||
207 | |||
208 | /** |
||
209 | * Set column renderer. |
||
210 | * |
||
211 | * @param mixed $value |
||
212 | * @return $this |
||
213 | */ |
||
214 | public function render($value) |
||
220 | |||
221 | /** |
||
222 | * Parse render attribute. |
||
223 | * |
||
224 | * @param mixed $value |
||
225 | * @return string|null |
||
226 | */ |
||
227 | public function parseRender($value) |
||
248 | |||
249 | /** |
||
250 | * Check if given key & value is a valid datatables built-in renderer function. |
||
251 | * |
||
252 | * @param string $value |
||
253 | * @return bool |
||
254 | */ |
||
255 | private function isBuiltInRenderFunction($value) |
||
263 | |||
264 | /** |
||
265 | * Display render value as is. |
||
266 | * |
||
267 | * @param mixed $value |
||
268 | * @return string |
||
269 | */ |
||
270 | private function parseRenderAsString($value) |
||
274 | |||
275 | /** |
||
276 | * @return array |
||
277 | */ |
||
278 | public function toArray() |
||
282 | } |
||
283 |