[TYPO3-mvc] RFC #11311: Bug: Enable dependency injection for domain objects
Pascal Jungblut
mail at pascal-jungblut.com
Tue Dec 14 00:31:50 CET 2010
This is an SVN patch request.
Type: Bugfix
Bugtracker references:
http://forge.typo3.org/issues/11311
Branches:
trunk
Problem:
Dependency injection is not possible with DomainObjects and Entities, because they are created with the "new" keyword.
Solution:
Replace the new $className calls with $objectManager->create() and create a function Tx_Extbase_Object_Container_Container->getEmptyObject() for reconstitution of objects (using DI).
Note:
Also added unit test getEmptyObjectReturnsInstanceOfSimpleClass(). Not sure if it's sufficient.
Regards
Pascal
More information about the TYPO3-project-typo3v4mvc
mailing list