[TYPO3-mvc] (Lazy)ObjectStorage and sorting

Franz Koch typo3.RemoveForMessage at elements-net.de
Mon Oct 4 18:38:41 CEST 2010


Hey,

> i have problem with the ObjectStorage and sorting.
>
> I have a MM relation defined in TCA. When creating new objects the
> sorting is ok. I attach my object in the order i like to have and this
> works.
> Now i like to update something. My object structure is defined in XML -
> therefore i have a Service that converts DOMDocument into my Domain Model.
>
> The logic is the following if the object exists:
>
> - remove all childrens (without cascade remove).
> - parse the children and add them one by one by using attach again.
>
> but the order gets broken in some cases.
>
> Lets assume i have one object with two childrens and the second child
> got modified. After the Service is done the second child becomes the first.
>
> Anybody familiar with (Lazy)ObjectStorage, MM-relations and sorting, who
> can gimme a hint whats going on there?

did you rewind your ObjectStorage? Maybe the internal pointer is simply 
not reset and thus traversing the objects is resulting in some fancy 
sorting?

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list