[TYPO3-mvc] How to persist forms editing only a childObject

Franz Koch typo3.RemoveForMessage at elements-net.de
Fri Nov 26 15:10:15 CET 2010


Hey there,

before I have yet another try and error session with this current 
extension, I'd like to ask you guys what's the official way to persist 
child objects after they got edited.

Here's my scenario:

I've created my own user account which I can enrich with custom data and 
permission models. This account as a among others also a userData 
property, holding information about the user itself (something like 
fe_users, but without credentials - those are separate).

Now I'd like to create a edit for just for the userData and I'm 
wondering how to correctly persist the modified object after editing. I 
was thinking about two possibilities:

a) fetch the child object from the main object and pass it as clone to 
the view. After it's edited and ready for storing (update action) I 
thought I just update it in the repository (which I would have to create 
only for that purpose, I don't need it otherways) and I'm fine.

b) assign the main object (the account) to the view and grab the child 
object directly from there in the view. In the update action then simply 
overwrite the incoming object in the main object.


Both should work, but which one is the preferred way and probably more 
safe? The clone version?

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list