]> _ Git - cubist_cms-back.git/commitdiff
wip #2837 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 17 Jun 2019 15:21:19 +0000 (17:21 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 17 Jun 2019 15:21:19 +0000 (17:21 +0200)
src/app/Magic/Fields/Field.php
src/app/Magic/Fields/SelectFromModel.php

index 7accbd28edfb7ff0fbc066afa645e67e30d1bcaf..aa88d1cb13b47edf2555c7ee528350e37d28d10f 100644 (file)
@@ -119,9 +119,15 @@ class Field
 
     public function getDefinition()
     {
+        $this->_preGetDefinition();
         return $this->_attributes;
     }
 
+    protected function _preGetDefinition()
+    {
+
+    }
+
     public function init()
     {
 
index eae4a0c6b8da24c83c9e2d773d4667d8018b4637..e5a77f46f5d3f08de2c59812766da01b0487e392 100644 (file)
@@ -9,8 +9,10 @@ use Cubist\Backpack\CubistBackpackServiceProvider;
 class SelectFromModel extends Model
 {
     protected $_adminType = 'select2_from_array';
+
     protected $_columnViewNamespace = CubistBackpackServiceProvider::NAMESPACE . '::columns';
     protected $_columnType = 'select_from_array';
+
     protected $_databaseType = 'string';
     protected $_multiple = false;
     protected $_order = false;
@@ -20,10 +22,14 @@ class SelectFromModel extends Model
         return array_merge(parent::getDefaultAttributes(), ['order' => $this->_order]);
     }
 
-    public function _postSetAttributes()
+    protected function _preGetDefinition()
     {
+        parent::_preGetDefinition();
         $this->setAttribute('options', $this->_getOptions());
+    }
 
+    public function _postSetAttributes()
+    {
         if ($this->getAttribute('allows_multiple') && $this->getAttribute('order')) {
             $this->setAttribute('type', 'select_and_order');
         }