[TYPO3-mvc] Best way to convert "tx_ext_domain_model_foo:1" into object?

Bastian Waidelich bastian at typo3.org
Mon Mar 12 11:39:37 CET 2012


Tim Schoch | GSTALTIG wrote:

Hi Tim,

> Instead of DI'ing it with an inject method I would have called it directly:
> $this->objectManager->get( ' Tx_Extbase_Persistence_Manager' )->getObjectByIdentifier( ' tx_ext_domain_model_foo:1' );
> I only need the Persistence Manager in one of my Actions and I don't want to
> pollute the RAM with mostly unnecessary stuff.

Why do you think, that DI would pollute the RAM?
In fact the Persistence Manager is a singleton so it should not affect 
your RAM usage no matter how you instantiate it.

Best,
Bastian



More information about the TYPO3-project-typo3v4mvc mailing list