2008-09-29 05:18:23 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Contents of an UserDefinedForm submission
|
|
|
|
* @package cms
|
|
|
|
*/
|
|
|
|
class SubmittedForm extends DataObject {
|
|
|
|
static $has_one = array(
|
|
|
|
"SubmittedBy" => "Member",
|
|
|
|
"Parent" => "UserDefinedForm",
|
|
|
|
);
|
|
|
|
|
|
|
|
static $has_many = array(
|
|
|
|
"FieldValues" => "SubmittedFormField"
|
|
|
|
);
|
2009-04-15 00:59:46 +02:00
|
|
|
|
|
|
|
/**
|
2009-04-15 06:23:43 +02:00
|
|
|
* Before we delete this form make sure we delete all the
|
|
|
|
* field values so that we don't leave old data round
|
2009-04-15 00:59:46 +02:00
|
|
|
*
|
|
|
|
*/
|
2009-04-15 06:23:43 +02:00
|
|
|
protected function onBeforeDelete() {
|
|
|
|
if($this->FieldValues()) {
|
|
|
|
foreach($this->FieldValues() as $value) {
|
|
|
|
$value->delete();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
parent::onBeforeDelete();
|
2008-09-29 05:18:23 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|