Commit 34c6a6db authored by Ad Schellevis's avatar Ad Schellevis

Revert "(mvc) unused, pull part of https://github.com/opnsense/core/pull/1134"

When working on another plugin, I remembered why this was usefull ;)

This reverts commit e55feb1e.
parent 5d9fe425
...@@ -106,6 +106,22 @@ abstract class ApiMutableModelControllerBase extends ApiControllerBase ...@@ -106,6 +106,22 @@ abstract class ApiMutableModelControllerBase extends ApiControllerBase
return $this->modelHandle; return $this->modelHandle;
} }
/**
* validate and save model after update or insertion.
* Use the reference node and tag to rename validation output for a specific node to a new offset, which makes
* it easier to reference specific uuids without having to use them in the frontend descriptions.
* @param $node reference node, to use as relative offset
* @return array result / validation output
*/
protected function validateAndSave($node = null)
{
$result = $this->validate();
if (empty($result['result'])) {
return $this->save();
}
return $result;
}
/** /**
* validate this model * validate this model
* @param $node reference node, to use as relative offset * @param $node reference node, to use as relative offset
......
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