component extends="coldbox.system.orm.hibernate.VirtualEntityService"
singleton {
public UserService function init(){
super.init(entityName="User");
return this;
}
}
I don't see how wirebox can come into play? I'd like the User object
be created by wirebox so inside of User, it can be injected with other
objects
component name="User" {
property name="whateverobj" inject="coldbox:whatever";
}
Just to expand, this is in my config:
binder.map("UserService").toDSL("entityService:User").asSingleton();
In my handlers, is this:
property name="userService" inject="model:userService";
in my events, is this:
User = userService.get(UserID);
in my User obj, is this (just for testing to see if it actually gets
injected)
property name="userService" inject="model:userService";
but, when I dump the User object, userService is '[empty string]'
So, I'm really confused. Its wired in the binder, the handler &
events get the service, create the User object (right?) but, the User
object doesnt get injected with anything.
No luck...
I had everything like you said, except
properties={entityInjection=true}, so.. I turned that one, no luck
I wasn't quite sure where or how that should be declared, so in
Config.cfc, Wirebox.cfc and in my ModuleConfig.cfc in the module im
trying to create, each one had both of these:
listeners =
[{class="coldbox.system.interceptors.Autowire",properties={entityInjection
= true}}];
interceptors =
[{class="coldbox.system.interceptors.Autowire",properties={entityInjection=true}}];
ah! hah! Thanks Curt, that actually did work, I misspelled the
injector property.. but, Just to make sure, which one of those is
correct listeners/interceptors and, it can just be in the moduleconfig
right?