CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Suggestion #36328

Model: injection of object storages

Added by Thorsten Boock about 1 year ago. Updated 3 months ago.

Status:Closed Start date:2012-04-19
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:Frontend
Target version:-
TYPO3 Version:4.6 Has patch:No
PHP Version:
Votes: 0

Description

When using config.tx_extbase.objects to "overload" e.g. Tx_News_Domain_Model_News, the extending class currently needs to take care of the initialization of object storage holding properties inherited from Tx_News_Domain_Model_News.
The reason for this is, that the extending class gets instantiated by Tx_Extbase_Object_Container_Container::getEmptyObject. Therefore the classes constructor isn't called. In the described case this is a problem, because in Tx_News_Domain_Model_News, the initialization of object storage holding properties is done by the constructor.

Injecting these properties instead could solve this. This was a pitfall for me as I didn't expect this behavior.

History

Updated by Georg Ringer 5 months ago

  • Status changed from New to Needs Feedback

do you wanne push a change to git.typo3.org? would be awesome, thanks!

Updated by Georg Ringer 3 months ago

  • Status changed from Needs Feedback to Closed

no reaction, closing

Also available in: Atom PDF