mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Add onPopulateFromPostData extension hook
This commit is contained in:
parent
73cfcc6791
commit
a9aefe38ea
@ -337,14 +337,16 @@ class EditableFormField extends DataObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* How to save the data submitted in this field into
|
||||
* the database object which this field represents.
|
||||
* How to save the data submitted in this field into the database object
|
||||
* which this field represents.
|
||||
*
|
||||
* Any class's which call this should also call
|
||||
* {@link parent::populateFromPostData()} to ensure
|
||||
* that this method is called
|
||||
* {@link parent::populateFromPostData()} to ensure that this method is
|
||||
* called
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param array $data
|
||||
*/
|
||||
public function populateFromPostData($data) {
|
||||
$this->Title = (isset($data['Title'])) ? $data['Title']: "";
|
||||
@ -385,7 +387,8 @@ class EditableFormField extends DataObject {
|
||||
|
||||
$this->CustomRules = serialize($rules);
|
||||
}
|
||||
|
||||
|
||||
$this->extend('onPopulateFromPostData', $data);
|
||||
$this->write();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user