What about to overwrite the delete method?
On 28 čnc, 09:59, "pierre.use...@gmail.com" <pierre.use...@gmail.com> wrote: > Hi all, > > I've a problem with the delete method in my project. > > here is my schema : > > USER: > columns: > id: {type: integer(7), primary: true, autoincrement: true} > name: {type: string(20), primary: false} > relations: > USER_SESSION: > foreignAlias: Users > local: id_user > foreign: id_session > refClass: USER_SESSION > > SESSION: > columns: > id: {type: integer(7), primary: true, autoincrement: true} > name: {type: string(20), primary: false} > relations: > USER_SESSION: > foreignAlias: Sessions > local: id_session > foreign: id_user > refClass: USER_SESSION > > USER_SESSION: > columns: > id: {type: integer(7), primary: true, autoincrement: true} > id_user: {type: integer(7)} > id_session: {type: integer(7)} > deleted: {type: boolean, default: false} > relations: > SESSION: > foreignAlias: Users > local: id_session > foreign: id > onDelete: CASCADE > USER: > foreignAlias: Sessions > local: id_user > foreign: id > onDelete: CASCADE > > I've created the modules to manipulate Users and Sessions tables and > I'm able to add or remove Users, sessions and create or remove > relations USER_SESSION (it add or delete the corresponding row). This > is great ! > > The problem is that now I want that when I will update a user and > cancel a subscription to a session I don't want to delete the row in > the table USER_SESSION. I just want to update the boolean field of the > row and set it to true when I remove the relation in my form. > > Anybody know how to override the delete method to not delete the many > to many relation when calling the executeUpdate ? > > I've tried to override preDelete and postDelete but it continues to > remove the entry from the table. > > Thanks ! > regards, > Pierre. -- 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