silverstripe / developer-docs

Developer documentation for Silverstripe CMS
Other
6 stars 61 forks source link

DOC Update `cascade_deletes` information for `has_many` relationships #523

Closed edwilde closed 4 months ago

edwilde commented 4 months ago

Description

Given that this issue has been open for some time, we should update the documentation which is giving incorrect information to developers.

I have added an example of how best to manage cascade_deletes between many_many related objects.

To avoid adding confusion, I decided against adding the alternative solution using onBeforeDelete() and removeAll(). However this can also be added if you think it is needed, or better?

Issues

Pull request checklist

edwilde commented 4 months ago

Thanks for the speedy turnaround @GuySartorelli 🚀