[TYPO3-english] Constructor injection not working after serializing+deserializing an object? (Jan Kornblum

Jan Kornblum jan.kornblum at gmx.de
Mon Jul 20 15:59:15 CEST 2015


> Can't you use another example on the page you linked?

What do you exactly mean? Using the injectObjectManager() instead of 
constructor injection?

> class Tx_Foo_Controller_MyController {
>
> /**
>  * @var Tx_Extbase_Object_ObjectManagerInterface
>  */
> protected $objectManager;
>
> /**
>  * @param Tx_Extbase_Object_ObjectManagerInterface $objectManager
>  */
> public function
> injectObjectManager(Tx_Extbase_Object_ObjectManagerInterface
> $objectManager) {
> $this->objectManager = $objectManager;
> }
>  public function foo() {
> $logFile = $this->objectManager->create('Tx_Foo_LogFile');
> }
> }

Kind regards, Jan




More information about the TYPO3-english mailing list