Closed brndusic closed 6 years ago
Use constructor injection
I strongly recommend you do not modify the resources. You probably just need a query provider instead.
@brndusic For every method in DoctrineResource there is an event you can subscribe to which will allow you to stop the method and return an ApiProblem.
If you're trying to do more than what an event before and after the hydrator is used on the target resource then that means you're not actually targeting a resource. Maybe a RPC is what you need?
@brndusic Did you resolve your issue? You've got two good suggestions, please reopen the issue if you have any further questions.
How can we add a dependency to a resource? Can someone explain how can we use a custom service inside a resource because we do not have access to ServiceManager anymore.
What I want to accomplish is for example to totally override one method inside a resource as others remain untouched.