[Flow] Constructor injection and IDE

Christian Loock chl at vkf-renzel.de
Fri Aug 9 11:14:26 CEST 2013


Am 09.08.2013 11:08, schrieb Mathis Hoffmann:
> ng constructor parameter. I tried to set a default value 
> (__construct(..,.., \My\Injected\Type $parameter = null)) but that 
> disabled constructor injection.Does anyone have a solution for that? 
I dont understand that exactly.

When you use constructor injection, you dont have to declare anything at 
you constructor at all. At least if I understood the concept correctly.

You use constructor injection by using the Inject Annotation like this:

/**
  * @Flow\Inject
  * @var TYPO3\Flow\Object\ObjectManager
protected $objectManager;

You dont even need a constructor to get this work, since flow generates 
it in its proxy classes and does the injection magics in it.

Im not 100% sure if this works for your example, but then also I dont 
get why you dont Inject everything else that gets passed to the constructor.


More information about the Flow mailing list