Hi there thanks for that.
for now i have this : public function executeNew(sfWebRequest $request) { $fiche = new Fiche(); $fiche->save(); $artiste = new Artiste(); $a = $fiche->getId(); $artiste->setIdFiche($a); $this->form = new ArtisteForm($artiste); } i got the needed id in $a, but when the form is saved no id is written in db... On 21 juin, 09:00, 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