]> _ Git - cubist_cms-back.git/commitdiff
#2810
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 12 Jun 2019 13:49:00 +0000 (15:49 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 12 Jun 2019 13:49:00 +0000 (15:49 +0200)
src/app/Magic/Fields/Model.php
src/app/Magic/Models/CubistMagicAbstractModel.php

index e3602a995aad2b8a795fecc1755c1a9a942fffc1..da06a4041d59856120fcb66a6cf5e2745a25edc1 100644 (file)
@@ -3,18 +3,22 @@
 
 namespace Cubist\Backpack\app\Magic\Fields;
 
-use Cubist\Backpack\app\Magic\Models\CubistMagicAbstractModel;
 
 class Model extends Field
 {
     public function getColumnData()
     {
         $res = parent::getColumnData();
-        $res['model'] = $this->getAttribute('model');
+        $res['model'] = $this->getAttribute('optionsmodel');
         $res['attribute'] = $this->getAttribute('attribute');
         return $res;
     }
 
+    protected function _postSetAttributes()
+    {
+        parent::_postSetAttributes();
+    }
+
     public function getDefaultAttributes()
     {
         return array_merge(parent::getDefaultAttributes(), ['attribute' => 'name', 'allows_null' => false, 'allows_multiple' => $this->_multiple]);
@@ -22,7 +26,7 @@ class Model extends Field
 
     protected function _getOptions()
     {
-        $modelClass = $this->getAttribute('model');
+        $modelClass = $this->getAttribute('optionsmodel');
         $inst = new $modelClass();
 
         return $modelClass::all()->pluck($this->getAttribute('attribute'), $inst->getPrimaryKey());
index 7d9d15173c61b475c5b5c3210b9dd0e1f66b9f03..7e66ebec0c76f7928bcf819d9f7cdc9fb744e71b 100644 (file)
@@ -448,4 +448,6 @@ class CubistMagicAbstractModel extends Model implements HasMedia
     {
         return $this->{$this->getPrimaryKey()};
     }
+
+
 }