1 | <?php |
||
10 | trait HasCallbacks |
||
11 | { |
||
12 | /** |
||
13 | * Set createdRow option value. |
||
14 | * |
||
15 | * @param mixed $script |
||
16 | * @return $this |
||
17 | * @see https://datatables.net/reference/option/createdRow |
||
18 | */ |
||
19 | public function createdRow($script) |
||
25 | |||
26 | /** |
||
27 | * Set drawCallback option value. |
||
28 | * |
||
29 | * @param mixed $script |
||
30 | * @return $this |
||
31 | * @see https://datatables.net/reference/option/drawCallback |
||
32 | */ |
||
33 | public function drawCallback($script) |
||
39 | |||
40 | /** |
||
41 | * Set drawCallback option value with Livewire integration. |
||
42 | * Solution as per issue https://github.com/yajra/laravel-datatables/issues/2401. |
||
43 | * |
||
44 | * @param mixed|null $script |
||
45 | * @return $this |
||
46 | * @see https://datatables.net/reference/option/drawCallback |
||
47 | */ |
||
48 | public function drawCallbackWithLivewire($script = null) |
||
62 | |||
63 | /** |
||
64 | * Set footerCallback option value. |
||
65 | * |
||
66 | * @param mixed $script |
||
67 | * @return $this |
||
68 | * @see https://datatables.net/reference/option/footerCallback |
||
69 | */ |
||
70 | public function footerCallback($script) |
||
76 | |||
77 | /** |
||
78 | * Set formatNumber option value. |
||
79 | * |
||
80 | * @param mixed $script |
||
81 | * @return $this |
||
82 | * @see https://datatables.net/reference/option/formatNumber |
||
83 | */ |
||
84 | public function formatNumber($script) |
||
90 | |||
91 | /** |
||
92 | * Set headerCallback option value. |
||
93 | * |
||
94 | * @param mixed $script |
||
95 | * @return $this |
||
96 | * @see https://datatables.net/reference/option/headerCallback |
||
97 | */ |
||
98 | public function headerCallback($script) |
||
104 | |||
105 | /** |
||
106 | * Set infoCallback option value. |
||
107 | * |
||
108 | * @param mixed $script |
||
109 | * @return $this |
||
110 | * @see https://datatables.net/reference/option/infoCallback |
||
111 | */ |
||
112 | public function infoCallback($script) |
||
118 | |||
119 | /** |
||
120 | * Set initComplete option value. |
||
121 | * |
||
122 | * @param mixed $script |
||
123 | * @return $this |
||
124 | * @see https://datatables.net/reference/option/initComplete |
||
125 | */ |
||
126 | public function initComplete($script) |
||
132 | |||
133 | /** |
||
134 | * Set preDrawCallback option value. |
||
135 | * |
||
136 | * @param mixed $script |
||
137 | * @return $this |
||
138 | * @see https://datatables.net/reference/option/preDrawCallback |
||
139 | */ |
||
140 | public function preDrawCallback($script) |
||
146 | |||
147 | /** |
||
148 | * Set rowCallback option value. |
||
149 | * |
||
150 | * @param mixed $script |
||
151 | * @return $this |
||
152 | * @see https://datatables.net/reference/option/rowCallback |
||
153 | */ |
||
154 | public function rowCallback($script) |
||
160 | |||
161 | /** |
||
162 | * Set stateLoadCallback option value. |
||
163 | * |
||
164 | * @param mixed $script |
||
165 | * @return $this |
||
166 | * @see https://datatables.net/reference/option/stateLoadCallback |
||
167 | */ |
||
168 | public function stateLoadCallback($script) |
||
174 | |||
175 | /** |
||
176 | * Set stateLoaded option value. |
||
177 | * |
||
178 | * @param mixed $script |
||
179 | * @return $this |
||
180 | * @see https://datatables.net/reference/option/stateLoaded |
||
181 | */ |
||
182 | public function stateLoaded($script) |
||
188 | |||
189 | /** |
||
190 | * Set stateLoadParams option value. |
||
191 | * |
||
192 | * @param mixed $script |
||
193 | * @return $this |
||
194 | * @see https://datatables.net/reference/option/stateLoadParams |
||
195 | */ |
||
196 | public function stateLoadParams($script) |
||
202 | |||
203 | /** |
||
204 | * Set stateSaveCallback option value. |
||
205 | * |
||
206 | * @param mixed $script |
||
207 | * @return $this |
||
208 | * @see https://datatables.net/reference/option/stateSaveCallback |
||
209 | */ |
||
210 | public function stateSaveCallback($script) |
||
216 | |||
217 | /** |
||
218 | * Set stateSaveParams option value. |
||
219 | * |
||
220 | * @param mixed $script |
||
221 | * @return $this |
||
222 | * @see https://datatables.net/reference/option/stateSaveParams |
||
223 | */ |
||
224 | public function stateSaveParams($script) |
||
230 | } |
||
231 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: