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

Sebastian Kurfürst sebastian at typo3.org
Wed Apr 6 17:15:53 CEST 2011


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


More information about the TYPO3-project-typo3v4mvc mailing list