Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
7b19a9b6
Commit
7b19a9b6
authored
Jan 29, 2016
by
Ad Schellevis
Committed by
Franco Fichtner
Jan 31, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(mvc) extend basemodel
(cherry picked from commit
c1a58cdd
)
parent
907937c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
BaseModel.php
src/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php
+4
-3
No files found.
src/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php
View file @
7b19a9b6
...
...
@@ -326,10 +326,10 @@ abstract class BaseModel
* perform a validation on changed model fields, using the (renamed) internal reference as a source pointer
* for the requestor to identify its origin
* @param null|string $sourceref source reference, for example model.section
* @param
null|string $targetref target reference, for example sectio
n
* @param
string $targetref target reference, for example section. used as prefix if no source give
n
* @return array list of validation errors, indexed by field reference
*/
public
function
validate
(
$sourceref
=
null
,
$targetref
=
null
)
public
function
validate
(
$sourceref
=
null
,
$targetref
=
""
)
{
$result
=
array
();
$valMsgs
=
$this
->
performValidation
();
...
...
@@ -339,7 +339,8 @@ abstract class BaseModel
$fieldnm
=
str_replace
(
$sourceref
,
$targetref
,
$msg
->
getField
());
$result
[
$fieldnm
]
=
$msg
->
getMessage
();
}
else
{
$result
[
$msg
->
getField
()]
=
$msg
->
getMessage
();
$fieldnm
=
$targetref
.
$msg
->
getField
()
;
$result
[
$fieldnm
]
=
$msg
->
getMessage
();
}
}
return
$result
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment