Commit 12b8a13b authored by Ad Schellevis's avatar Ad Schellevis

(model) remove namespace from Constraints type

parent c85f821c
...@@ -372,7 +372,7 @@ abstract class BaseField ...@@ -372,7 +372,7 @@ abstract class BaseField
$constraint = $this->internalConstraints[$name]; $constraint = $this->internalConstraints[$name];
if (!empty($constraint['type'])) { if (!empty($constraint['type'])) {
try { try {
$constr_class = new \ReflectionClass($constraint['type']); $constr_class = new \ReflectionClass('OPNsense\\Base\\Constraints\\'.$constraint['type']);
if ($constr_class->getParentClass()->name == 'OPNsense\Base\Constraints\BaseConstraint') { if ($constr_class->getParentClass()->name == 'OPNsense\Base\Constraints\BaseConstraint') {
$constraint['name'] = $name; $constraint['name'] = $name;
$constraint['node'] = $this; $constraint['node'] = $this;
......
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
<Constraints> <Constraints>
<check001> <check001>
<ValidationMessage>Both throttling parameters should either be filled or empty</ValidationMessage> <ValidationMessage>Both throttling parameters should either be filled or empty</ValidationMessage>
<type>OPNsense\Base\Constraints\AllOrNoneConstraint</type> <type>AllOrNoneConstraint</type>
<addFields> <addFields>
<field1>perHostTrotteling</field1> <field1>perHostTrotteling</field1>
</addFields> </addFields>
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
<Constraints> <Constraints>
<check001> <check001>
<ValidationMessage>Filename should be unique</ValidationMessage> <ValidationMessage>Filename should be unique</ValidationMessage>
<type>OPNsense\Base\Constraints\UniqueConstraint</type> <type>UniqueConstraint</type>
</check001> </check001>
</Constraints> </Constraints>
</filename> </filename>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<Constraints> <Constraints>
<check001> <check001>
<ValidationMessage>number should be unique</ValidationMessage> <ValidationMessage>number should be unique</ValidationMessage>
<type>OPNsense\Base\Constraints\UniqueConstraint</type> <type>UniqueConstraint</type>
<addFields> <addFields>
<field1>optfield</field1> <field1>optfield</field1>
</addFields> </addFields>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<Constraints> <Constraints>
<check001> <check001>
<ValidationMessage>All fields should contain data or none of them</ValidationMessage> <ValidationMessage>All fields should contain data or none of them</ValidationMessage>
<type>OPNsense\Base\Constraints\AllOrNoneConstraint</type> <type>AllOrNoneConstraint</type>
<addFields> <addFields>
<field2>value2</field2> <field2>value2</field2>
<field3>value3</field3> <field3>value3</field3>
......
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