Commit f67ef5e7 authored by Ad Schellevis's avatar Ad Schellevis

(mvc) some style fixes in ApiMutableModelControllerBase.php from...

(mvc) some style fixes in ApiMutableModelControllerBase.php from https://github.com/opnsense/core/pull/1134
parent e14a6b7e
......@@ -164,7 +164,6 @@ abstract class ApiMutableModelControllerBase extends ApiControllerBase
* setAction is called. This hook is called after a model has been
* constructed and validated but before it serialized to the configuration
* and written to disk
* @param $mdl The validated model containing the new state of the model
* @return Error message on error, or null/void on success
*/
protected function setActionHook()
......@@ -184,9 +183,9 @@ abstract class ApiMutableModelControllerBase extends ApiControllerBase
$mdl->setNodes($this->request->getPost(static::$internalModelName));
$result = $this->validate();
if (empty($result['result'])) {
$errorMessage = $this->setActionHook();
if (!empty($errorMessage)) {
$result['error'] = $errorMessage;
$hookErrorMessage = $this->setActionHook();
if (!empty($hookErrorMessage)) {
$result['error'] = $hookErrorMessage;
} else {
return $this->save();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment