Is it possible to add a listener for all events? we have some global logic to implement based on event type (the event name suffix, e.g:
Ideally we’d like a listener on
*.suffix but would be happy to catch everything and filter as needed.
I don’t think you can add a “wildcard” listener for multiple events, but you can add a listener for
Model.afterDelete or the like. The “generic” model events are triggered regardless of which model they are for. You can then filter out, if need be, based on the class of the entity passed in.
Yeah we tend to use Behaviors for hooking into the generic model events. Our use case is for custom events that we fire from within our app that we want follow on logic for (eg. log to influxdb or queue external webhooks),
Didn’t think wildcards were supported but just wanted to sanity check - we’ll look at adding a PR perhaps.