mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
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 e55feb1eb5419ed6d4e4d53ec7410a5ae1b05e9a.
This commit is contained in:
parent
5d9fe42511
commit
34c6a6db04
@ -106,6 +106,22 @@ abstract class ApiMutableModelControllerBase extends ApiControllerBase
|
||||
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
|
||||
* @param $node reference node, to use as relative offset
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user