When you say 'merged two forms' did you use the embedForm() or mergeForm() or did you do this manually?
Assuming that the table_a_id is the foreign key for the record in table b, Symfony will deal with this for you if you use merged or embedded forms - see "Doing More With Symfony" - Advanced Forms: http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-Forms On Jun 21, 8:00 am, Tom Ptacnik <to...@tomor.cz> wrote: > I think that the solution might be owerwriting the doSave method .. or > some method where the saving of the object is done. You need to save > the foreign object first - to obtain the id from the database, then > save the main object. > > On 19 čvn, 12:24, titiyoyo <terence.pi...@gmail.com> wrote: > > > > > Hi there, > > > i'm new to symfony and am bumping into a problem here. > > I merged two forms from 2 different models and need to get a foreign > > key from table A to put in this table B form. > > > Basically, i have to > > - create a record in table A and get this record's id > > - create a record in table B an set it's table_a_id to the value i > > just got > > - fill out the rest of the info that will be put in table B > > > My question is : > > how can i get the needed id ? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en