silverstripe-userforms/code/submissions/SubmittedForm.php
Will Rossiter 3c1d81d014 ENHANCEMENT: added test coverage for UserDefinedForm.php and placeholders for other sections. API change: processNewFormFields removed
API change: refactored Form() into getFormFields(), getFormActions(), getRequiredFields()

ENHANCEMENT: added updateForm* extension hooks to allow customization of userforms
BUGFIX: gave custom scripts their own ID to enable it to be blocked.
2010-09-03 05:06:13 +00:00

32 lines
599 B
PHP
Executable File

<?php
/**
* Contents of an UserDefinedForm submission
*
* @package userforms
*/
class SubmittedForm extends DataObject {
static $has_one = array(
"SubmittedBy" => "Member",
"Parent" => "UserDefinedForm",
);
static $has_many = array(
"FieldValues" => "SubmittedFormField"
);
/**
* Before we delete this form make sure we delete all the
* field values so that we don't leave old data round
*
*/
protected function onBeforeDelete() {
if($this->FieldValues()) {
foreach($this->FieldValues() as $value) {
$value->delete();
}
}
parent::onBeforeDelete();
}
}