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 | * |
||
219 | * @return mixed |
||
220 | */ |
||
221 | 11 | public function first(array $with = []) |
|
232 | |||
233 | /** |
||
234 | * @param array $with |
||
235 | * |
||
236 | * @return mixed |
||
237 | */ |
||
238 | public function firstOrFail(array $with = []) |
||
249 | |||
250 | /** |
||
251 | * @param array $with |
||
252 | * |
||
253 | * @return void |
||
254 | */ |
||
255 | protected function addWithCriteria(array $with = []) |
||
261 | |||
262 | protected function refresh() |
||
271 | |||
272 | /** |
||
273 | * @param bool $status |
||
274 | * |
||
275 | 9 | * @return $this |
|
276 | */ |
||
277 | 9 | public function skipCriteria($status = true) |
|
283 | 9 | ||
284 | /** |
||
285 | 9 | * @return Collection |
|
286 | */ |
||
287 | public function getCriteria() |
||
291 | |||
292 | /** |
||
293 | * @param Criteria $criteria |
||
294 | * |
||
295 | * @return $this |
||
296 | */ |
||
297 | public function getByCriteria(Criteria $criteria) |
||
303 | |||
304 | /** |
||
305 | * @param Criteria $criteria |
||
306 | * |
||
307 | * @return $this |
||
308 | */ |
||
309 | public function pushCriteria(Criteria $criteria) |
||
315 | |||
316 | /** |
||
317 | * @return $this |
||
318 | */ |
||
319 | public function applyCriteria() |
||
331 | } |
||
332 |
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.