-
-
Notifications
You must be signed in to change notification settings - Fork 848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impossible to add filter in a custom controller #360
Comments
@alexcandy91 it has been a while but i noticed that your resource.store calls have arguments flipped between initItemOperations and initCollectionOperations |
Yes I already see that. However, thank you so much! |
This can be closed imo |
soyuka
pushed a commit
to soyuka/core
that referenced
this issue
Aug 2, 2017
soyuka
pushed a commit
to soyuka/core
that referenced
this issue
Aug 3, 2017
soyuka
pushed a commit
to soyuka/core
that referenced
this issue
Aug 3, 2017
soyuka
pushed a commit
to soyuka/core
that referenced
this issue
Aug 4, 2017
soyuka
pushed a commit
to soyuka/core
that referenced
this issue
Aug 7, 2017
soyuka
pushed a commit
to soyuka/core
that referenced
this issue
Aug 7, 2017
soyuka
pushed a commit
to soyuka/core
that referenced
this issue
Aug 28, 2017
soyuka
pushed a commit
to soyuka/core
that referenced
this issue
Aug 28, 2017
soyuka
pushed a commit
to soyuka/core
that referenced
this issue
Sep 5, 2017
dunglas
added a commit
that referenced
this issue
Sep 7, 2017
fix api-platform/#360 QueryChecker with class join
hoangnd25
pushed a commit
to hoangnd25/core
that referenced
this issue
Feb 23, 2018
hoangnd25
pushed a commit
to hoangnd25/core
that referenced
this issue
Feb 23, 2018
fix api-platform/api-platform#360 QueryChecker with class join
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I'm trying to add filters in a custom controller but the initFilter function dosesn't work.
Why I'm using a customerControler?
Because I have 3 need of my application:
So, if I try to add filters using custom controller the bundle add the filters only to the ItemOperation method and not to the CollectionOperation.
Is this a bug?
this is my service:
This is my customController:
getDoctrine()->getManager(); $store = $em->getRepository('AppBundle:Store')->findOneBySiteId($number); $groups = ['groups' => ['details']]; $resource = new Resource('AppBundle\Entity\Store'); $resource->initNormalizationContext($groups); $object = $this->findOrThrowNotFound($resource, $store->getId()); $this->get('event_dispatcher')->dispatch(Events::RETRIEVE, new DataEvent($resource, $object)); return $this->getSuccessResponse($resource, $object); } public function getListAction(Request $request) { $groups = ['groups' => ['list']]; $resource = new Resource('AppBundle\Entity\Store'); $resource->initNormalizationContext($groups); $data = $this->getCollectionData($resource, $request); if ( $request->get($this->container->getParameter('api.collection.pagination.page_parameter_name')) && 0 === count($data) ) { throw $this->createNotFoundException(); } $this->get('event_dispatcher')->dispatch(Events::RETRIEVE_LIST, new DataEvent($resource, $data)); return $this->getSuccessResponse($resource, $data, 200, [], ['request_uri' => $request->getRequestUri()]); } } ``` I would like to use the bundle because I's better to use the hidra information, the impagination and so on... Thank you so much for the answers. RegardsThe text was updated successfully, but these errors were encountered: