What is the best (for lack of a better word) way to implement additional logic for when particular properties on an entity change? For example, a syncing
property is changed from false
to true
. When the client PUT
s the resource with the modified field, an HTTP request needs to be sent to a 3rd party API to enable/disable this feature on their end.
The options I can't choose between are:
- Custom operation controllers to toggle the property value (e.g.
PUT /room/{id}/syncing
,DELETE /room/{id}/syncing
) - A controller for
PUT /room/{id}
and to check if the value has changed in the request compared to what exists in the database - An event listener on the
onKernelController
event, to detect changes to the property on the entity