mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
(mvc) some style fixes in ApiMutableModelControllerBase.php from https://github.com/opnsense/core/pull/1134
This commit is contained in:
parent
e14a6b7e57
commit
f67ef5e787
@ -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();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user