You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a concrete example, let's say an entity has to be created from an RPC controller. A DoctrineResource::create method is then called. Thus, when calling it, data is filtered through a ZF\Apigility\Doctrine\Server\Query\CreateFilter\DefaultCreateFilter (by default, should no extra configuration provided) as shown here
In this concrete class (DefaultCreateFilter), the event is not used at all.
Although filtering is mandatory through the DoctrineResource::create implementation, the event may not be available.
That should not stopped the process of creating an entity through its dedicated Resource.
@jguittardDoctrineResource extends AbstractResourceListener and method create is not called directly but via dispatch method so the event is there always available.
Can you show example when the event is not available in create method?
I think he meant if you call DoctrineResource::create() directly since it's a public function. Maybe the API for the class can be simplified to avoid confusion by making the methods of that type protected in the future (but it's a BC break)
Oh, yeah, this is what he meant probably :) Thanks @gsomoza. I misunderstood. Sorry @jguittard :)
I have a lot of concerns about PR #281 and it seems to be also BC Break.
We can't change these methods to protected - as these are from ZF\Rest\AbstractResourceListener.
I'm afraid that the library doesn't support RPC endpoints at all right now. There is something in codebase already (DoctrineRpcServiceModel, ...), so before somebody has it in mind. Maybe we can add it.
Of course it will be nice to resolve also this issue somehow, to allow usage create/fetch/patch/... methods without the event. Hm... what if we override getEvent method to returns always ResourceEvent?
As a concrete example, let's say an entity has to be created from an RPC controller. A
DoctrineResource::create
method is then called. Thus, when calling it,data
is filtered through aZF\Apigility\Doctrine\Server\Query\CreateFilter\DefaultCreateFilter
(by default, should no extra configuration provided) as shown hereDefaultCreateFilter
), the event is not used at all.DoctrineResource::create
implementation, the event may not be available.Originally posted by @jguittard at zfcampus/zf-apigility-doctrine#280
The text was updated successfully, but these errors were encountered: