[TYPO3-mvc] odd relational issue with attach
Toke Herkild
th at t3cms.dk
Tue Feb 21 09:24:38 CET 2012
Den 20-02-2012 17:54, Claus Due skrev:
> Hi Toke,
>
>> Anyone who'd care to axplain why ObjectStorage isn't loaded by default ?
>
> If I am not mistaken, doing this right after your repository->update() will populate the ObjectStorage properties:
>
> $this->objectManager->get('Tx_Extbase_Persistence_Manager')->persistAll();
>
> The full answer to your question is a bit too detailed for the time I have - but it lies in the Persistence layer and how it persists objects (after Request ends, unless you manually persistAll).
>
> --
> Cheers,
> Claus
> http://fedext.net
>
Hi Claus,
I know, but I was of the understanding that when the main model was
instantiated at the initialization of the function, it would have been
fetched from repository, that doesn't seem to be the case. Atleast not
when you're doing an updateAction().
Even doing the PersistAll(); won't do you any good untill you have
fetched the model from repository first, atleast if it's a 1:m relation.
But I guess that one day when I have a little more time on my hands I'll
take a dive into the odd workings of the repository and controllers.
But thanks for your help, it was invaluable in regards to figure out
were to look for clues.
Regards,
Toke
More information about the TYPO3-project-typo3v4mvc
mailing list