Hooking into event when record deleted from custom plugin We are using a plugin that has created its own record for storing private messages. When deleting a message, it's calling the delete() method on an instance of the record, which appears to be using the CActiveRecord's implementation of delete.

In CActiveRecord::delete(), it has a $this-&gt;afterDelete() method, which looks like it should be raising an onAfterDelete event, but I haven't had any luck hooking into it.

I've tried craft()-&gt;on('pluginhandle_messageRecord.onAfterDelete', ...) and craft()-&gt;on('cActiveRecord.onAfterDelete', ...), but neither gets triggered.

Does anyone know the correct syntax for hooking into this event for this specific custom record?

Thanks!
Because that's a Yii event, it doesn't follow the same component.eventName syntax that the other Craft events use and you can't use craft->on() to register to listen to it.

Completely untested, but you should be able to use the traditional Yii method, though. Something like this:

$myRecord-&gt;onAfterDelete = function (Event $event) {
    // Do your thing.
};