1 | <?php |
||
13 | class Repository implements RepositoryContract, CriteriaPerformer |
||
14 | { |
||
15 | /** |
||
16 | * @var EloquentModel |
||
17 | */ |
||
18 | protected $model; |
||
19 | |||
20 | /** |
||
21 | * @var Collection |
||
22 | */ |
||
23 | protected $criteria; |
||
24 | |||
25 | /** |
||
26 | * @var bool |
||
27 | */ |
||
28 | protected $skipCriteria = false; |
||
29 | |||
30 | public function __construct(EloquentModel $model) |
||
31 | 17 | { |
|
32 | $this->model = $model; |
||
33 | 17 | $this->criteria = new Collection(); |
|
34 | 17 | } |
|
35 | 17 | ||
36 | /** |
||
37 | * @return EloquentModel |
||
38 | */ |
||
39 | public function getModel() |
||
40 | 1 | { |
|
41 | return $this->model; |
||
42 | 1 | } |
|
43 | |||
44 | /** |
||
45 | * @param array $with |
||
46 | * |
||
47 | * @return Collection |
||
48 | */ |
||
49 | 1 | public function all(array $with = []) |
|
60 | |||
61 | /** |
||
62 | * @param int $perPage |
||
63 | * |
||
64 | * @return mixed |
||
65 | 1 | */ |
|
66 | public function paginate($perPage = 15, array $with = []) |
||
77 | |||
78 | /** |
||
79 | * @param array $data |
||
80 | * |
||
81 | 7 | * @return EloquentModel |
|
82 | */ |
||
83 | 7 | public function create(array $data) |
|
91 | |||
92 | /** |
||
93 | * @param array $data |
||
94 | * @param $id |
||
95 | * @param string $field |
||
96 | 2 | * |
|
97 | * @return EloquentModel |
||
98 | 2 | */ |
|
99 | public function update(array $data, $id, $field = 'id') |
||
113 | |||
114 | /** |
||
115 | 3 | * @param $id |
|
116 | * |
||
117 | 3 | * @return int |
|
118 | */ |
||
119 | 3 | public function delete($id) |
|
127 | |||
128 | 3 | /** |
|
129 | * @param $id |
||
130 | 3 | * |
|
131 | 3 | * @return mixed |
|
132 | */ |
||
133 | 3 | public function find($id, array $with = []) |
|
144 | 1 | ||
145 | /** |
||
146 | 1 | * @param $id |
|
147 | 1 | * |
|
148 | * @return mixed|Exception |
||
149 | 1 | */ |
|
150 | public function findOrFail($id, array $with = []) |
||
161 | 1 | ||
162 | /** |
||
163 | 1 | * @param $field |
|
164 | 1 | * @param $value |
|
165 | * |
||
166 | 1 | * @return mixed |
|
167 | */ |
||
168 | 1 | public function findBy($field, $value, array $with = []) |
|
179 | |||
180 | 1 | /** |
|
181 | 1 | * @param $field |
|
182 | * @param $value |
||
183 | 1 | * |
|
184 | * @return mixed |
||
185 | 1 | */ |
|
186 | public function findByOrFail($field, $value, array $with = []) |
||
197 | 1 | ||
198 | 1 | /** |
|
199 | * @param $field |
||
200 | 1 | * @param $value |
|
201 | * |
||
202 | 1 | * @return mixed |
|
203 | */ |
||
204 | 1 | public function findAllBy($field, $value, array $with = []) |
|
215 | |||
216 | 9 | /** |
|
217 | * @param array $with |
||
218 | * @return mixed |
||
219 | */ |
||
220 | public function first(array $with = []) |
||
231 | |||
232 | /** |
||
233 | * @param array $with |
||
234 | * @return mixed |
||
235 | */ |
||
236 | public function firstOrFail(array $with = []) |
||
247 | 9 | ||
248 | /** |
||
249 | * @param array $with |
||
250 | * |
||
251 | * @return void |
||
252 | */ |
||
253 | protected function addWithCriteria(array $with = []) |
||
259 | |||
260 | protected function refresh() |
||
269 | |||
270 | /** |
||
271 | * @param bool $status |
||
272 | * |
||
273 | * @return $this |
||
274 | */ |
||
275 | 9 | public function skipCriteria($status = true) |
|
281 | 9 | ||
282 | /** |
||
283 | 9 | * @return Collection |
|
284 | */ |
||
285 | 9 | public function getCriteria() |
|
289 | |||
290 | /** |
||
291 | * @param Criteria $criteria |
||
292 | * |
||
293 | * @return $this |
||
294 | */ |
||
295 | public function getByCriteria(Criteria $criteria) |
||
301 | |||
302 | /** |
||
303 | * @param Criteria $criteria |
||
304 | * |
||
305 | * @return $this |
||
306 | */ |
||
307 | public function pushCriteria(Criteria $criteria) |
||
313 | |||
314 | /** |
||
315 | * @return $this |
||
316 | */ |
||
317 | public function applyCriteria() |
||
329 | } |
||
330 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.