1 | <?php |
||
11 | class Model |
||
12 | { |
||
13 | /** |
||
14 | * Eloquent model instance of the grid model. |
||
15 | * |
||
16 | * @var EloquentModel |
||
17 | */ |
||
18 | protected $model; |
||
19 | |||
20 | /** |
||
21 | * Array of queries of the eloquent model. |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $queries = []; |
||
26 | |||
27 | /** |
||
28 | * Sort parameters of the model. |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $sort; |
||
33 | |||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $data = []; |
||
38 | |||
39 | /* |
||
40 | * 20 items per page as default. |
||
41 | * |
||
42 | * @var int |
||
43 | */ |
||
44 | protected $perPage = 20; |
||
45 | |||
46 | /** |
||
47 | * @var bool |
||
48 | */ |
||
49 | protected $usePaginate = true; |
||
50 | |||
51 | /** |
||
52 | * Create a new grid model instance. |
||
53 | * |
||
54 | * @param EloquentModel $model |
||
55 | */ |
||
56 | public function __construct(EloquentModel $model) |
||
62 | |||
63 | /** |
||
64 | * Get the eloquent model of the grid model. |
||
65 | * |
||
66 | * @return EloquentModel |
||
67 | */ |
||
68 | public function eloquent() |
||
72 | |||
73 | /** |
||
74 | * Enable or disable pagination. |
||
75 | * |
||
76 | * @param bool $use |
||
77 | */ |
||
78 | public function usePaginate($use = true) |
||
82 | |||
83 | /** |
||
84 | * Build. |
||
85 | * |
||
86 | * @return array |
||
87 | */ |
||
88 | public function buildData() |
||
96 | |||
97 | /** |
||
98 | * Add conditions to grid model. |
||
99 | * |
||
100 | * @param array $conditions |
||
101 | * |
||
102 | * @return void |
||
103 | */ |
||
104 | public function addConditions(array $conditions) |
||
110 | |||
111 | /** |
||
112 | * Get table of the model. |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | public function getTable() |
||
120 | |||
121 | /** |
||
122 | * @throws \Exception |
||
123 | * |
||
124 | * @return Collection |
||
125 | */ |
||
126 | protected function get() |
||
149 | |||
150 | /** |
||
151 | * Set the grid paginate. |
||
152 | * |
||
153 | * @return void |
||
154 | */ |
||
155 | protected function setPaginate() |
||
177 | |||
178 | /** |
||
179 | * Find query by method name. |
||
180 | * |
||
181 | * @param $method |
||
182 | * |
||
183 | * @return static |
||
184 | */ |
||
185 | protected function findQueryByMethod($method) |
||
191 | |||
192 | /** |
||
193 | * Set the grid sort. |
||
194 | * |
||
195 | * @return void |
||
196 | */ |
||
197 | protected function setSort() |
||
217 | |||
218 | /** |
||
219 | * Set relation sort. |
||
220 | * |
||
221 | * @param string $column |
||
222 | * |
||
223 | * @return void |
||
224 | */ |
||
225 | protected function setRelationSort($column) |
||
248 | |||
249 | /** |
||
250 | * Build join parameters. |
||
251 | * |
||
252 | * @param Relation $relation |
||
253 | * |
||
254 | * @return array |
||
255 | */ |
||
256 | protected function joinParameters(Relation $relation) |
||
265 | |||
266 | /** |
||
267 | * @param string $method |
||
268 | * @param array $arguments |
||
269 | * |
||
270 | * @return $this |
||
271 | */ |
||
272 | public function __call($method, $arguments) |
||
281 | |||
282 | /** |
||
283 | * @param $key |
||
284 | * |
||
285 | * @return mixed |
||
286 | */ |
||
287 | public function __get($key) |
||
295 | } |
||
296 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..