mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Add getEditableField() helper
This commit is contained in:
parent
23963e2a47
commit
e8e41826da
@ -78,4 +78,20 @@ class SubmittedFormField extends DataObject {
|
|||||||
public function getExportValue() {
|
public function getExportValue() {
|
||||||
return $this->Value;
|
return $this->Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find equivalent editable field for this submission.
|
||||||
|
*
|
||||||
|
* Note the field may have been modified or deleted from the original form
|
||||||
|
* so this may not always return the data you expect. If you need to save
|
||||||
|
* a particular state of editable form field at time of submission, copy
|
||||||
|
* that value to the submission.
|
||||||
|
*
|
||||||
|
* @return EditableFormField
|
||||||
|
*/
|
||||||
|
public function getEditableField() {
|
||||||
|
return $this->Parent()->Parent()->Fields()->filter(array(
|
||||||
|
'Name' => $this->Name
|
||||||
|
))->First();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user