Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Removing many_many relationships for deleted objects


Reply


3 Posts   1233 Views

Avatar
micahsheets

Community Member, 165 Posts

16 July 2009 at 9:43am

When a DataObject is deleted does it take care of removing any entries in a $many_many table or do I have to write my own functions in onBeforeDelete to take care of clean up?

Avatar
Sean

Forum Moderator, 922 Posts

16 July 2009 at 10:06pm

You'll have to perform your own cleanup at this point. I believe we have a ticket in our open source tracker to make this automatic.

For now, write your own code to remove the relationships and any related objects if necessary.

Thanks,
Sean

Avatar
jthomerson

Community Member, 5 Posts

15 February 2012 at 6:06am

Any update on this?