Remove the relation as well as delete the object

This commit is contained in:
Sean Harvey 2008-05-14 07:16:38 +00:00
parent 652c0af4c2
commit 626c272b6f

View File

@ -41,9 +41,10 @@ class MultiFormSession extends DataObject {
* These actions are performed when delete() is called on this object.
*/
public function onBeforeDelete() {
// delete dependent form steps
// delete dependent form steps and relation
$steps = $this->FormSteps();
if($steps) foreach($steps as $step) {
$steps->remove($step);
$step->delete();
}