OSDN Git Service

Произведено изменение схемы хранения данных. Для моделей создана отдельная таблица...
[invent/invent.git] / models / Models.php
index 38cc2fb..1948aa6 100644 (file)
@@ -65,4 +65,9 @@ class Models extends \yii\db\ActiveRecord
     {
         return $this->hasOne(Types::className(), ['id' => 'type_id']);
     }
+
+    public function getItems()
+    {
+        return $this->hasMany(Items::className(), ['model_id' => 'id']);
+    }
 }