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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Removing many_many relationships for deleted objects


Go to End


3 Posts   1843 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?