[TYPO3-mvc] Dependency injection in domain objects

Franz Koch typo3.RemoveForMessage at elements-net.de
Thu Jan 27 11:45:31 CET 2011


Hey Christian,

...
> $repository =
> t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager')->get('Tx_MyExt_Domain_Repository_MyRepository');
>
>
> Are there any drawbacks I need to consider?

no, there are no drawbacks currently. The objectManager is a singleton, 
thus already correctly initialized when you're instantiating it via 
t3lib_div::makeInstance. So no issues here.

> [1] For my calendar exception I use an MM-table that relates to an
> Exception- and an ExceptionGroup-table. What I want to be returned is
> just all the exceptions. So I need some custom logic for that - expect
> that Extbase does not support "group" yet.

It sort of has already, but only for regular MM relations and you have 
to also set 'foreign_table' in your TCA to get it work (see it like 
faking a select field). But native support is coming - I'm working on it.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list