[TYPO3-mvc] Persistence/ObjectStorage: Model seems to be unimpressed by modifying its properties

Franz Koch typo3.RemoveForMessage at elements-net.de
Wed Jul 20 12:13:54 CEST 2011


Hey,

> Why are changes to my model not persisted?
>
> The following lines of code are from within one of my controller
> actions.
>
> // Removing all content from ObjectStorage (?)
> $antrag->getAllgemeineVoraussetzungen()->removeAll($antrag->getAllgemeineVoraussetzungen());
>
> // Assigning new content
> $antrag->setAllgemeineVoraussetzungen($newAllgemeineVoraussetzungen);
>
> I'm not sure about the "removeAll" statement. Anyway, nothing get's
> removed nor added.

I suppose you're "getAllgemeineVoraussetzungen" method is returning a 
clone of the objectStorage.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list