[TYPO3-mvc] I'm too stupid for repository->add?

Franz Koch typo3.RemoveForMessage at elements-net.de
Wed Dec 1 11:27:33 CET 2010


Hey Manfred,

>> which version of Extbase do you have? If you use trunk, you should use
>> the dependency injection features.
>
> Hi Sebastian,
>
> i have double checked all my files. It seems all ok. How can i debug the
> way of the objects? In the Perstistence/Manager.php in the method i can
> find my repsoitories, but in $reconstitutedObject i didn`t find my user
> object. Can you tell me how is the way to track my object to the way to my
> table? It`s a little bit important now :(

have you tried using dependency injection for the persistenceManager? Or 
at least tried to instantiate it using the objectManager (which is also 
working for me btw):

// using the object manager
$persistenceManager = 
$this->objectManager->get('Tx_Extbase_Persistence_Manager');
$persistenceManager->persistAll();

----------------------

// example using DI
/**
  * @var Tx_Extbase_Persistence_Manager
  */
protected $persistenceManager;


/**
  * Injector for the persistenceManager
  * @param Tx_Extbase_Persistence_Manager $persistenceManager
  * @return void
  */
public function injectPersistenceManager(Tx_Extbase_Persistence_Manager 
$persistenceManager) {
	$this->persistenceManager = $persistenceManager;
}


public function yourCreateAction() {
	$repository->add($object);
	$this->persistenceManager->persistAll();
}

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list