Add onPopulateFromPostData extension hook

This commit is contained in:
Will Rossiter 2014-07-09 11:55:54 +12:00
parent 73cfcc6791
commit a9aefe38ea

View File

@ -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();
}