1 | <?php |
||
23 | abstract class AbstractRepository extends BaseRepository implements RepositoryInterface |
||
24 | { |
||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $orderBy; |
||
29 | |||
30 | /** |
||
31 | * @var bool |
||
32 | */ |
||
33 | protected $skipPresenter = true; |
||
34 | |||
35 | /** |
||
36 | * Reset Model |
||
37 | * |
||
38 | * @return AbstractRepository |
||
39 | * @throws RepositoryException |
||
40 | */ |
||
41 | 9 | public function resetModel() |
|
46 | |||
47 | /** |
||
48 | * Get Query |
||
49 | * |
||
50 | * @return Builder |
||
51 | */ |
||
52 | 2 | public function getQuery() |
|
59 | |||
60 | /** |
||
61 | * Search All |
||
62 | * |
||
63 | * @param array $input Array Imput |
||
64 | * @param string $orderBy String Order By |
||
65 | * @param int $limit Integer Limit |
||
66 | * @param bool $skipPresenter Boolean Skip Presenter |
||
67 | * |
||
68 | * @return BuilderResultset |
||
69 | */ |
||
70 | 1 | public function searchAll(array $input, $orderBy = '', $limit = null, $skipPresenter = true) |
|
84 | |||
85 | /** |
||
86 | * Search Paginator |
||
87 | * |
||
88 | * @param array $input Array Input |
||
89 | * @param string $orderBy String Order By |
||
90 | * @param int|null $limit Integer Limit |
||
91 | * @param bool $skipPresenter Boolean Skip Presenter |
||
92 | * |
||
93 | * @return Paginator |
||
94 | */ |
||
95 | 1 | public function search(array $input, $orderBy = '', $limit = null, $skipPresenter = true) |
|
105 | |||
106 | /** |
||
107 | * Get an array with the values of a given column. |
||
108 | * |
||
109 | * @param string $column String Column |
||
110 | * @param string $key String Key |
||
111 | * |
||
112 | * @return \Illuminate\Support\Collection |
||
113 | */ |
||
114 | 1 | public function pluck($column, $key = null) |
|
124 | |||
125 | /** |
||
126 | * Add an "order by" clause to the query. |
||
127 | * |
||
128 | * @param string $columns String Columns |
||
129 | * @param string $direction String Direction |
||
130 | * |
||
131 | * @return RepositoryInterface |
||
132 | */ |
||
133 | 3 | public function orderBy($columns, $direction = 'asc') |
|
153 | |||
154 | /** |
||
155 | * Random |
||
156 | * |
||
157 | * @return RepositoryInterface |
||
158 | */ |
||
159 | 4 | public function random() |
|
178 | |||
179 | /** |
||
180 | * Count |
||
181 | * |
||
182 | * @param array $input Array Input |
||
183 | * |
||
184 | * @return int |
||
185 | */ |
||
186 | 1 | public function count(array $input = array()) |
|
198 | |||
199 | /** |
||
200 | * Max |
||
201 | * |
||
202 | * @param mixed $field Mixed Field |
||
203 | * @param array $input Array Input |
||
204 | * |
||
205 | * @return mixed |
||
206 | */ |
||
207 | 1 | public function max($field, array $input = array()) |
|
219 | |||
220 | /** |
||
221 | * Min |
||
222 | * |
||
223 | * @param mixed $field Mixed Field |
||
224 | * @param array $input Array Input |
||
225 | * |
||
226 | * @return mixed |
||
227 | */ |
||
228 | 1 | public function min($field, array $input = array()) |
|
240 | |||
241 | /** |
||
242 | * Sum |
||
243 | * |
||
244 | * @param mixed $field Mixed Field |
||
245 | * @param array $input Array Input |
||
246 | * |
||
247 | * @return float |
||
248 | */ |
||
249 | 1 | public function sum($field, array $input = array()) |
|
261 | |||
262 | /** |
||
263 | * Average |
||
264 | * |
||
265 | * @param mixed $field Mixed Field |
||
266 | * @param array $input Array Input |
||
267 | * |
||
268 | * @return int |
||
269 | */ |
||
270 | 1 | public function avg($field, array $input = array()) |
|
282 | |||
283 | /** |
||
284 | * Reorder |
||
285 | * |
||
286 | * @param string $field Field Order |
||
287 | * |
||
288 | * @return boolean |
||
289 | */ |
||
290 | 4 | public function reorder($field, $input = null) |
|
333 | |||
334 | /** |
||
335 | * Where InputCriteria |
||
336 | * |
||
337 | * @param array $input Array Input |
||
338 | * |
||
339 | * @return RepositoryInterface |
||
340 | */ |
||
341 | 8 | public function whereInputCriteria(array $input = array()) |
|
350 | |||
351 | /** |
||
352 | * Save a new model in repository |
||
353 | * |
||
354 | * @throws ValidatorException |
||
355 | * @param array $attributes Array Attributes |
||
356 | * @return mixed |
||
357 | */ |
||
358 | 1 | public function create(array $attributes) |
|
378 | |||
379 | /** |
||
380 | * Update a model in repository by id |
||
381 | * |
||
382 | * @throws ValidatorException |
||
383 | * @param array $attributes Array Attributes |
||
384 | * @param int $id Integer Id |
||
385 | * @return mixed |
||
386 | */ |
||
387 | 1 | public function update(array $attributes, $id) |
|
416 | |||
417 | /** |
||
418 | * Handle dynamic method calls into the method. |
||
419 | * |
||
420 | * @param string $method |
||
421 | * @param array $parameters |
||
422 | * @return mixed |
||
423 | * |
||
424 | * @throws BadMethodCallException |
||
425 | */ |
||
426 | 7 | public function __call($method, $parameters) |
|
437 | } |
||
438 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.