Browse Source

added more constraints check for dbo deserialization

develop
Robin Thoni 8 years ago
parent
commit
83f8044592
1 changed files with 1 additions and 4 deletions
  1. 1
    4
      src/Utils/Dbo/LuDbo.php

+ 1
- 4
src/Utils/Dbo/LuDbo.php View File

137
 
137
 
138
             $value = null;
138
             $value = null;
139
             if (isset($json[$name])) {
139
             if (isset($json[$name])) {
140
-                $value = static::deserializeValue($json[$name], $type);
140
+                $value = static::deserializeValue($json[$name], $type, $doc->getConstraints());
141
             }
141
             }
142
 
142
 
143
             if ($doc->isNotNull() && is_null($value)) {
143
             if ($doc->isNotNull() && is_null($value)) {
144
                 throw new LuDboConstraintException("Field '" . $name . "' can not be null");
144
                 throw new LuDboConstraintException("Field '" . $name . "' can not be null");
145
             }
145
             }
146
 
146
 
147
-            if (!is_null($doc) && !is_null($value)) {
148
-                $value->checkConstraints($doc->getConstraints());
149
-            }
150
             $property->setAccessible(true);
147
             $property->setAccessible(true);
151
             $property->setValue($dbo, $value);
148
             $property->setValue($dbo, $value);
152
         }
149
         }

Loading…
Cancel
Save