Browse Source

Fix Model again

Visman 5 years ago
parent
commit
6a14abd55b
1 changed files with 3 additions and 2 deletions
  1. 3 2
      app/Models/Model.php

+ 3 - 2
app/Models/Model.php

@@ -67,7 +67,7 @@ class Model
     }
 
     /**
-     * Удаляет вычесленные зависимые свойства
+     * Удаляет вычисленные зависимые свойства
      *
      * @param mixed $name
      */
@@ -88,12 +88,13 @@ class Model
      */
     public function __set($name, $value)
     {
+        $this->unsetCalc($name);
+
         if (\method_exists($this, $method = 'set' . $name)) {
             $this->$method($value);
         } else {
             $this->zAttrs[$name] = $value;
         }
-        $this->unsetCalc($name);
     }
 
     /**