1 | <?php |
||
24 | trait RestCrudTrait |
||
25 | { |
||
26 | /** |
||
27 | * @param Request $request |
||
28 | * @param array $additionalResponseVars |
||
29 | * |
||
30 | * @return Response |
||
31 | * |
||
32 | * @throws \Exception |
||
33 | */ |
||
34 | public function restCrudObjectList(Request $request, array $additionalResponseVars = array()) |
||
88 | |||
89 | public function restCrudObjectCreate(Request $request) |
||
92 | |||
93 | public function restCrudObjectRead(Request $request, $id) |
||
96 | |||
97 | public function restCrudObjectUpdate(Request $request, $id) |
||
100 | |||
101 | public function restCrudObjectPartialUpdate(Request $request, $id) |
||
104 | |||
105 | public function restCrudObjectDelete(Request $request, $id) |
||
108 | |||
109 | /** |
||
110 | * @return string |
||
111 | */ |
||
112 | protected function restCrudListRole() |
||
116 | |||
117 | /** |
||
118 | * @return string |
||
119 | */ |
||
120 | protected function restCrudListRoute() |
||
124 | |||
125 | /** |
||
126 | * @param Request $request |
||
127 | * |
||
128 | * @return FormInterface|null |
||
129 | */ |
||
130 | protected function restCrudListForm(Request $request) |
||
138 | |||
139 | /** |
||
140 | * @param Request $request |
||
141 | * |
||
142 | * @return FormTypeInterface|null |
||
143 | */ |
||
144 | protected function restCrudListFormType(Request $request) |
||
148 | |||
149 | /** |
||
150 | * @param Request $request |
||
151 | * @param array $formData |
||
152 | * |
||
153 | * @return array |
||
154 | */ |
||
155 | protected function restCrudListFormDataEnrich(Request $request, array $formData) |
||
159 | |||
160 | /** |
||
161 | * @param Request $request |
||
162 | * @param array $replace |
||
163 | * |
||
164 | * @return string |
||
165 | */ |
||
166 | protected function restCrudGenerateListUrl(Request $request, array $replace = array()) |
||
170 | |||
171 | /** |
||
172 | * @return string |
||
173 | */ |
||
174 | protected function restCrudRolePattern() |
||
178 | |||
179 | /** |
||
180 | * @return string |
||
181 | */ |
||
182 | protected function restCrudRoutePattern() |
||
186 | |||
187 | /** |
||
188 | * @param mixed $attributes |
||
189 | * @param mixed $object |
||
190 | * |
||
191 | * @return bool |
||
192 | * |
||
193 | * @throws \Exception |
||
194 | */ |
||
195 | protected function restCrudIsGranted($attributes, $object = null) |
||
203 | |||
204 | /** |
||
205 | * @param FormTypeInterface $type |
||
206 | * @param mixed $data |
||
207 | * @param array $options |
||
208 | * |
||
209 | * @return FormInterface |
||
210 | */ |
||
211 | protected function restCrudForm(FormTypeInterface $type, $data = null, array $options = array()) |
||
215 | |||
216 | /** |
||
217 | * @param string $class |
||
218 | * |
||
219 | * @return ObjectManager |
||
220 | * |
||
221 | * @throws \Exception |
||
222 | */ |
||
223 | protected function restCrudManagerForClass($class) |
||
233 | |||
234 | /** |
||
235 | * @param string $class |
||
236 | * |
||
237 | * @return ObjectRepository |
||
238 | */ |
||
239 | protected function restCrudRepositoryForClass($class) |
||
243 | |||
244 | /** |
||
245 | * @param object $target |
||
246 | * @param Request $request |
||
247 | * |
||
248 | * @return AbstractPagination |
||
249 | */ |
||
250 | protected function restCrudPaginate($target, Request $request) |
||
258 | |||
259 | /** |
||
260 | * @param string $name |
||
261 | * @param array $parameters |
||
262 | * |
||
263 | * @return string |
||
264 | */ |
||
265 | protected function restCrudGenerateRoute($name, array $parameters = array()) |
||
269 | |||
270 | /** |
||
271 | * @return int |
||
272 | */ |
||
273 | protected function restCrudListPerPage() |
||
277 | |||
278 | /** |
||
279 | * @return string |
||
280 | */ |
||
281 | abstract protected function restCrudName(); |
||
282 | |||
283 | /** |
||
284 | * @return string |
||
285 | */ |
||
286 | abstract protected function restCrudObjectClass(); |
||
287 | |||
288 | /** |
||
289 | * @return AuthorizationCheckerInterface |
||
290 | * |
||
291 | * @throws ServiceNotFoundException |
||
292 | */ |
||
293 | protected function restCrudAuthorizationChecker() |
||
300 | |||
301 | /** |
||
302 | * @return SecurityContextInterface |
||
303 | * |
||
304 | * @throws ServiceNotFoundException |
||
305 | */ |
||
306 | protected function restCrudSecurity() |
||
313 | |||
314 | /** |
||
315 | * @return FormFactoryInterface |
||
316 | * |
||
317 | * @throws ServiceNotFoundException |
||
318 | */ |
||
319 | protected function restCrudFormFactory() |
||
326 | |||
327 | /** |
||
328 | * @return ManagerRegistry |
||
329 | * |
||
330 | * @throws ServiceNotFoundException |
||
331 | */ |
||
332 | protected function restCrudDoctrine() |
||
339 | |||
340 | /** |
||
341 | * @return PaginatorInterface |
||
342 | * |
||
343 | * @throws ServiceNotFoundException |
||
344 | */ |
||
345 | protected function restCrudPaginator() |
||
352 | |||
353 | /** |
||
354 | * @return UrlGeneratorInterface |
||
355 | * |
||
356 | * @throws ServiceNotFoundException |
||
357 | */ |
||
358 | protected function restCrudUrlGenerator() |
||
365 | |||
366 | /** |
||
367 | * @return SerializerInterface |
||
368 | * |
||
369 | * @throws ServiceNotFoundException |
||
370 | */ |
||
371 | protected function restCrudSerializer() |
||
378 | } |
||
379 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: