It looks like the emitter is emitting events when channel field and category fields are added or updated, but there is no hook_id parameter similar to what the ChannelEntry model has. Would it be possible to add hook_ids to those so we can subscribe to the events? Can I use the Event service to subscribe to internal events or is the Event service more for creating and handling events in our own add-ons?
So after digging into this it appears pretty easy to make a core model fire event hooks that I can subscribe to. Just adding $_hook_id to the model does the trick. Is this something that could be added to all (or at least the prominent) models?
Attachments don’t appear to be working :( See screenshot: https://www.dropbox.com/s/adx3844khb4hvfe/Screenshot 2016-03-23 20.20.42.png?dl=0
Image exceeds our max size (dimensions and file size). With third-party services for file sharing being so ubiquitous, we’re content to let someone else handle storage and bandwidth. 😉
FWIW you can use a Markdown image link to display external images inline.
Will ping the team on your request!
We’re thinking of adding hooks almost exactly like ChannelEntry’s hooks: before
/after
insert
/update
/save
/delete
. Would that work for you? We’d rather there be one true way to do these sorts of things and extension hooks feel like the right way.
Just looking through the Models directory I can see the following benefiting from the hooks:
Ones that would make things easier for me in Publisher: ChannelField CategoryGroup, Template, TemplateGroup, TemplateRoute
Ones that I could see potential in having down the road, but don’t need now. File, MemberField, MemberGroup
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.