ColdBox / Lightwire - injecting a CB setting into a Transfer Decorator on init

Hi there,

Is it possible to inject a ColdBox setting into a Transfer Decorator
when that object is first called?

The scenario I have is this ....

I've got a Transfer "Login" object - in the Decorator I have a method
called "isUnlocked()" which checks to see if the internal counter of
login attempts has hit the limit and returns true / false for the

The actually limit just now is 6 but what I don't like is the fact
this setting is hardcoded into the top of my Decorator.

What I would like ideally is to have ColdBox / Lightwire inject this
into the object when I make a call like so:

var objLogin = super.getTransfer().readByPropertyMap('login',propMap);

Where an instance of Transfer is coming from my Base Service & then
I'm making a save to objLogin from the call to readByPropertyMap()

Is that possible as I don't really want to have to do something like
this everytime I call for this object -

var objLogin = super.getTransfer().readByPropertyMap('login',propMap);

Basically I need something like this but for LightWire :-


Ok a bit more investigation.... am I right in thinking I need to use
the TDOBeanInjectorObserver.cfc for this? Sounds along the same line
as Brian't CS approach

Managed to do it using the following documentation....

Guess the answer is - Always read the docs first :slight_smile:

LOL, I was about to answer, but it looks like you found it! Cool!

You can also do the same with ORM entities in ColdBox also using the ColdBox-Hibernate event handler and the Autowire interceptor.

Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform:
Linked In:
IECFUG Manager: