[FLOW3-general] Constructor injection in models?
Michael Sauter
mail at michaelsauter.net
Thu Apr 22 19:12:20 CEST 2010
Hi,
is constructor injection somehow possible in models (entities)?
I tried to use it, but upon adding/updating, I got an exception
("Missing constructor argument") inside PropertyMapper::buildObject().
The controller seems to try to get the constructor arguments from the
arguments passed from the form. But of course I don't want to pass
around my object ... I want to get it injected ;)
Am I doing something wrong there? If not, would it be possible to let
the object manager do its magic before we throw the excpetion in there?
Besides that - any other possibilites to solve this issue without
constructor injection? ATM, I can only think of a custom init()-method
that I have to call every time in my code before using the object ...
(which is not that bad, because setter/property injection works, and
that's already awesome!)
Thanks,
~michael
More information about the FLOW3-general
mailing list