Browse Source

Move getAttrs() method

Visman 2 years ago
parent
commit
d564cc5de8
2 changed files with 9 additions and 8 deletions
  1. 0 8
      app/Models/DataModel.php
  2. 9 0
      app/Models/Model.php

+ 0 - 8
app/Models/DataModel.php

@@ -54,14 +54,6 @@ class DataModel extends Model
         return $this;
     }
 
-    /**
-     * Возвращает значения свойств в массиве
-     */
-    public function getAttrs(): array
-    {
-        return $this->zAttrs; //????
-    }
-
     /**
      * Возвращает массив имен измененных свойств модели
      */

+ 9 - 0
app/Models/Model.php

@@ -147,6 +147,15 @@ class Model
         return \array_key_exists($name, $this->zAttrs) ? $this->zAttrs[$name] : $default;
     }
 
+    /**
+     * Возвращает значения свойств в массиве
+     * Без вычислений
+     */
+    public function getAttrs(): array
+    {
+        return $this->zAttrs;
+    }
+
     /**
      * Выполняет подгружаемый метод при его наличии
      */