[TYPO3-mvc] Problem getting an instance of an object in controller

Henjo Hoeksma me at henjohoeksma.nl
Wed Apr 6 16:48:47 CEST 2011


On 2011-04-06 15:25:31 +0200, Franz Koch said:

> Hey,
> 
>> I need to compare a XML posted object to an object in the database.
>> 
>> What I do is something like:
>> 
>> $rep = t3lib_div::makeInstance('Object_Repos');
>> $objectInDb = $rep->findByProperty('PropertyValue');
> ...
>> Is this due to the new inject dependency ?
> 
> if your using Extbase 1.3+ then yes. You have to create the instance of 
> the repository using the objectManager.
> 
> $rep = $this->objectManager->get('Tx_Ext_Domain_Repository_ObjectRepository');
> ...

In addition:

In the debug it states the'object' is not an object but a query result:

15 
Tx_Extbase_Persistence_Repository::remove(Tx_Extbase_Persistence_QueryResult)

Henjo 




More information about the TYPO3-project-typo3v4mvc mailing list