[TYPO3-mvc] Problem getting an instance of an object in controller
Henjo Hoeksma
me at henjohoeksma.nl
Wed Apr 6 21:33:40 CEST 2011
On 2011-04-06 17:15:53 +0200, Sebastian Kurfürst said:
> Hey,
>
>> $objectInDb = $rep->findByProperty('PropertyValue');
> findByProperty returns a *list* of objects. So you need to do:
> foreach ($objectsInDb as $objectInDb) {
> $rep->remove($objectInDb);
> }
>
> or alternatively, use "findOneByProperty", returning just a single object.
>
> Greets,
> Sebastian
Lol, forgot I was adding fervently ending up with multiple instances of
the same object in the db...
Thanks!
Henjo
More information about the TYPO3-project-typo3v4mvc
mailing list