1 | <?php |
||
19 | class Column extends Fluent |
||
20 | { |
||
21 | /** |
||
22 | * @param array $attributes |
||
23 | */ |
||
24 | public function __construct($attributes = []) |
||
51 | |||
52 | /** |
||
53 | * Create a computed column that is not searchable/orderable. |
||
54 | * |
||
55 | * @param string $data |
||
56 | * @param string $title |
||
57 | * @return Column |
||
58 | */ |
||
59 | public static function computed($data, $title = '') |
||
63 | |||
64 | /** |
||
65 | * Set column searchable flag. |
||
66 | * |
||
67 | * @param bool $flag |
||
68 | * @return $this |
||
69 | */ |
||
70 | public function searchable(bool $flag = true) |
||
76 | |||
77 | /** |
||
78 | * Set column orderable flag. |
||
79 | * |
||
80 | * @param bool $flag |
||
81 | * @return $this |
||
82 | */ |
||
83 | public function orderable(bool $flag = true) |
||
89 | |||
90 | /** |
||
91 | * Set column visible flag. |
||
92 | * |
||
93 | * @param bool $flag |
||
94 | * @return $this |
||
95 | */ |
||
96 | public function visible(bool $flag = true) |
||
102 | |||
103 | /** |
||
104 | * Make a new column instance. |
||
105 | * |
||
106 | * @param string $data |
||
107 | * @param string $name |
||
108 | * @return Column |
||
109 | */ |
||
110 | public static function make($data, $name = '') |
||
119 | |||
120 | /** |
||
121 | * Create a checkbox column. |
||
122 | * |
||
123 | * @param string $title |
||
124 | * @return Column |
||
125 | */ |
||
126 | public static function checkbox($title = '') |
||
135 | |||
136 | /** |
||
137 | * Set column class name. |
||
138 | * |
||
139 | * @param string $class |
||
140 | * @return $this |
||
141 | */ |
||
142 | public function className($class) |
||
148 | |||
149 | /** |
||
150 | * Append a class name to field. |
||
151 | * |
||
152 | * @param string $class |
||
153 | * @return $this |
||
154 | */ |
||
155 | public function addClass($class) |
||
165 | |||
166 | /** |
||
167 | * Set column default content. |
||
168 | * |
||
169 | * @param string $value |
||
170 | * @return $this |
||
171 | */ |
||
172 | public function content($value) |
||
178 | |||
179 | /** |
||
180 | * Set column exportable flag. |
||
181 | * |
||
182 | * @param bool $flag |
||
183 | * @return $this |
||
184 | */ |
||
185 | public function exportable(bool $flag = true) |
||
191 | |||
192 | /** |
||
193 | * Set column printable flag. |
||
194 | * |
||
195 | * @param bool $flag |
||
196 | * @return $this |
||
197 | */ |
||
198 | public function printable(bool $flag = true) |
||
204 | |||
205 | /** |
||
206 | * Set column width value. |
||
207 | * |
||
208 | * @param int|string $value |
||
209 | * @return $this |
||
210 | */ |
||
211 | public function width($value) |
||
217 | |||
218 | /** |
||
219 | * Set column title. |
||
220 | * |
||
221 | * @param string $value |
||
222 | * @return $this |
||
223 | */ |
||
224 | public function title($value) |
||
230 | |||
231 | /** |
||
232 | * Set column name. |
||
233 | * |
||
234 | * @param string $value |
||
235 | * @return $this |
||
236 | */ |
||
237 | public function name($value) |
||
243 | |||
244 | /** |
||
245 | * Set column renderer. |
||
246 | * |
||
247 | * @param mixed $value |
||
248 | * @return $this |
||
249 | */ |
||
250 | public function render($value) |
||
256 | |||
257 | /** |
||
258 | * Parse render attribute. |
||
259 | * |
||
260 | * @param mixed $value |
||
261 | * @return string|null |
||
262 | */ |
||
263 | public function parseRender($value) |
||
284 | |||
285 | /** |
||
286 | * Check if given key & value is a valid datatables built-in renderer function. |
||
287 | * |
||
288 | * @param string $value |
||
289 | * @return bool |
||
290 | */ |
||
291 | private function isBuiltInRenderFunction($value) |
||
299 | |||
300 | /** |
||
301 | * Display render value as is. |
||
302 | * |
||
303 | * @param mixed $value |
||
304 | * @return string |
||
305 | */ |
||
306 | private function parseRenderAsString($value) |
||
310 | |||
311 | /** |
||
312 | * @return array |
||
313 | */ |
||
314 | public function toArray() |
||
318 | } |
||
319 |