1 <?php
2 3 4 5 6
7
8 class SubmittedForm extends DataObject {
9
10 static $has_one = array(
11 "SubmittedBy" => "Member",
12 "Parent" => "UserDefinedForm",
13 );
14
15 static $has_many = array(
16 "Values" => "SubmittedFormField"
17 );
18
19 20 21 22 23
24 protected function onBeforeDelete() {
25
26 if($this->Values()) {
27 foreach($this->Values() as $value) {
28 $value->delete();
29 }
30 }
31
32 parent::onBeforeDelete();
33 }
34 }
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the
Silverstripe Forums to ask development related questions.
-