]> _ Git - cubist_cms-back.git/commitdiff
#2810
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 6 Jun 2019 13:53:11 +0000 (15:53 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 6 Jun 2019 13:53:11 +0000 (15:53 +0200)
src/app/Magic/Fields/Field.php
src/app/Magic/Fields/Number.php

index 08c6d48fe1cf2144a433444a16fb66c0cdc677e1..bf5e023c8a2fad1972e4bc406be9fd11244327ff 100644 (file)
@@ -14,6 +14,7 @@ class Field
     use CubistMagicAttribute;
     protected $_attributes;
     protected $_rules = [];
+    protected $_columnType = 'text';
     protected $_adminType = 'text';
     protected $_databaseType = 'text';
     protected $_cast = false;
@@ -65,7 +66,7 @@ class Field
     {
         return ['type' => $this->_adminType, 'column' => false, 'form' => 'both', 'rules' => '',
             'fillable' => true, 'guarded' => false, 'hidden' => false, 'translatable' => $this->_translatable,
-            'column_type' => 'text', 'default' => '', 'cast' => $this->_cast, 'fake' => false, 'store_in' => false];
+            'column_type' => $this->_columnType, 'default' => '', 'cast' => $this->_cast, 'fake' => false, 'store_in' => false];
     }
 
     public function __construct($attributes)
@@ -102,7 +103,7 @@ class Field
     {
         $res = [
             'name' => $this->getAttribute('name'),
-            'type' => $this->getAttribute('column_type', $this->getAttribute('type')),
+            'type' => $this->getAttribute('column_type'),
             'label' => $this->getAttribute('column_label', $this->getAttribute('label'))
         ];
 
index 88eb342778fb30335562fd4da592eeff2d4a709b..542bad548ad8e0a68f372c5a87dfc40c821bb6d4 100644 (file)
@@ -8,4 +8,5 @@ class Number extends Field
 {
     protected $_adminType = 'number';
     protected $_databaseType = 'float';
+    protected $_columnType = 'number';
 }