[TYPO3-mvc] Does the Persistence Layer not respect dirty objects?
Thomas "Thasmo" Deinhamer
thasmo at gmail.com
Thu Jun 7 02:35:58 CEST 2012
Sorry, missed a bit of logic there. Here something more correct:
--------------------------------------------------
$name = 'test';
foreach(...) {
$object = $this->repository->findOneByName($name);
if(!$object) {
$object = t3lib_div::makeInstance('Tx_MyExt_Domain_Model_Object');
$object->setName($name);
$this->repository->add($object);
}
print $object->getName();
}
--------------------------------------------------
Thanks,
Thomas
Thomas "Thasmo" Deinhamer schrieb:
> --------------------------------------------------
> $name = 'test';
>
> foreach(...) {
> $object = $this->repository->findByName($name);
>
> if(!$object) {
> $this->repository->add($object);
> }
> }
>
> print $object->getName();
> --------------------------------------------------
More information about the TYPO3-project-typo3v4mvc
mailing list