Closed nicodmf closed 3 years ago
are you talking about messenger
? Yes it's available per-operation IIRC.
https://api-platform.com/docs/core/messenger/#dispatching-a-resource-through-the-message-bus
It is not indicated in the documentation, but, this works for a builtin post action. For an item action, in my test a patch operation, the handler isn't dispatched. Another impossible case : a delete on collection which by exemple delete all order begin and not ended in the last year : the delete on collection demand a controller and a route, and the handler isn't called at least in my tests.
As messager requests are mainly linked to a resource (ex : in the doc, the request password is clearly relative to an user), it could be a good idea to defined messager directly in a operation not only for POST method but too for DELETE, PATCH, PUT. In this context, the resource could be better defined, as an action on a resource should be a part of this resource. This feature permits too to not use custom controllers.
Exemple :
The handler could be finded by recognise the input.
Maybe this kind of definition is possible now. But i don't find how.