I see in your schema that you already marked fields in the recurso_contenido table as foreign key. Modify the onDelete attribute to delete, this way propel (or the DB engine, if it supports it) will take of the automatic deletion.
On Tue, Mar 17, 2009 at 00:46, Guido <[email protected]> wrote: > > Hi guys. I got a little question for you, hope anyone can help me. I > got two tables in my model. One is called "contenido", the other is > called "recurso". They got a many to many association which is made by > the table "recurso_contenido". The schema.yml part of these tables is > here: http://pastebin.com/m781b2762 > > I want the admin page of 'recurso' to delete all records of > recurso_contenido whenever I delete a recurso record. The ideal > behaviour would be a flash warning that the 'recurso' and all > 'recurso_contenido' references will be deleted and then -after user > confirmation- delete all. > > At first I created an action "executeListDelete()" which did the > delete, but couln't manage to add the javascript alert like the _delete > () action does (I followed day 12 of jobeet tutorial here). So, I > created an action called "executeDelete()" that overrides the default > delete behaviour. The code for this is here: http://pastebin.com/m4ae8addf > > By the way, I am not using any self made template, just the auto > generated by symfony. > > I also thought of creating a file "recursoGeneratorHelper.class.php" > and override the linkToDeleteAll HTML output, but had no success. > > As I am recently starting with symfony and the second thing was > something that just crossed my mind, I would like any advise possible > so I follow the *correct* (or better) method. > > Thanks in advance, > > Guido Sanchez > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
