1 | <?php namespace Distilleries\DatatableBuilder; |
||
9 | abstract class EloquentDatatable |
||
10 | { |
||
11 | |||
12 | protected $model; |
||
13 | protected $colomns; |
||
14 | protected $form = null; |
||
15 | protected $colomnsDisplay = []; |
||
16 | protected $datatableOptions = []; |
||
17 | |||
18 | // 0 can be an integer to represents the column's number or it can be a string that references the column's name |
||
19 | protected $defaultOrder = [[0, 'desc']]; |
||
20 | |||
21 | // ------------------------------------------------------------------------------------------------ |
||
22 | 8 | ||
23 | public function __construct(Model $model = null) |
||
27 | |||
28 | /** |
||
29 | * @param Eloquent $model |
||
30 | 4 | */ |
|
31 | public function setModel(Model $model) |
||
35 | |||
36 | |||
37 | // ------------------------------------------------------------------------------------------------ |
||
38 | |||
39 | /** |
||
40 | * @param string $name |
||
41 | * @param \Closure $closure |
||
42 | 8 | */ |
|
43 | public function add($name, $closure = null, $translation = '') |
||
59 | |||
60 | /** |
||
61 | * @param string $translation |
||
62 | * @param string $name |
||
63 | */ |
||
64 | public function addTranslation($name, $translation) |
||
68 | 6 | ||
69 | // ------------------------------------------------------------------------------------------------ |
||
70 | |||
71 | public function applyFilters() |
||
83 | 3 | ||
84 | 3 | // ------------------------------------------------------------------------------------------------ |
|
85 | 3 | ||
86 | public function generateColomns() |
||
117 | 4 | ||
118 | 4 | public function setClassRow($datatable) |
|
127 | |||
128 | 4 | // ------------------------------------------------------------------------------------------------ |
|
129 | 4 | public function generateHtmlRender($template = 'datatable-builder::part.datatable', $route = '') |
|
139 | 8 | ||
140 | 8 | // ------------------------------------------------------------------------------------------------ |
|
141 | 8 | public function addDefaultAction($template = 'datatable-builder::form.components.datatable.actions', $route = '') |
|
153 | 4 | ||
154 | 4 | // ------------------------------------------------------------------------------------------------ |
|
155 | 4 | // ------------------------------------------------------------------------------------------------ |
|
156 | 4 | // ------------------------------------------------------------------------------------------------ |
|
157 | 8 | ||
158 | 6 | ||
159 | protected function addFilter($template = 'datatable-builder::form.components.datatable.filter') |
||
172 | 8 | ||
173 | // ------------------------------------------------------------------------------------------------ |
||
174 | // ------------------------------------------------------------------------------------------------ |
||
175 | 8 | // ------------------------------------------------------------------------------------------------ |
|
176 | |||
177 | |||
178 | protected function addOptions() |
||
203 | 8 | ||
204 | 6 | // ------------------------------------------------------------------------------------------------ |
|
205 | 6 | ||
206 | 8 | protected function getControllerNameForAction() |
|
213 | 8 | ||
214 | 8 | // ------------------------------------------------------------------------------------------------ |
|
215 | |||
216 | public function filters() |
||
222 | |||
223 | // ------------------------------------------------------------------------------------------------ |
||
224 | 3 | // ------------------------------------------------------------------------------------------------ |
|
225 | // ------------------------------------------------------------------------------------------------ |
||
226 | |||
227 | abstract public function build(); |
||
228 | } |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: