Extend Multiple Components

First off, I have searched this group and Google looking for a valid
answer to my problem and I'm down to asking out loud now.

I have a component (referralService) that extends VirtualEntityService
but I also need to fire off postInsert() after each save and obviously
I can't extend EventHandler, so can someone please point me in the
right direction as how to get postInsert() to fire off after each new


You can just add a postInsert() method to your referral CFC.

Curt Gratz
Computer Know How

I did and the functions inside were not fired off. Reading the docs
(http://wiki.coldbox.org/wiki/Extras:ORMEventHandler.cfm) it says I
have to extend the EventHandler in the CFC, but that's already being
used by VirtualEntityService, so can't do that.
Unless I'm doing something wrong.


It should also be noted that there are other ways to do this as well.

For example adding the event to the entity is certainly one way, but if you
require across multiple entities the other method would be to use
interceptors as well.

All of the ORM events can listened for in any registered interceptor.

Andrew Scott

ORM events in ColdBox can be done a number of ways.

1) They can use the persistent Entity to have a per Entity Event
2) They could extend a Global Event Handler as defined by the standard
3) You could use a base object that the component extends and then extends
the VirtualEntityService, or BaseORMService.
4) You could use interceptors for this as well.

Andrew Scott