From: Vincent Vanwaelscappel Date: Thu, 6 Jun 2019 13:53:11 +0000 (+0200) Subject: #2810 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=743a4f760596cc1d55a413812b54332e9d808cc9;p=cubist_cms-back.git #2810 --- diff --git a/src/app/Magic/Fields/Field.php b/src/app/Magic/Fields/Field.php index 08c6d48..bf5e023 100644 --- a/src/app/Magic/Fields/Field.php +++ b/src/app/Magic/Fields/Field.php @@ -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')) ]; diff --git a/src/app/Magic/Fields/Number.php b/src/app/Magic/Fields/Number.php index 88eb342..542bad5 100644 --- a/src/app/Magic/Fields/Number.php +++ b/src/app/Magic/Fields/Number.php @@ -8,4 +8,5 @@ class Number extends Field { protected $_adminType = 'number'; protected $_databaseType = 'float'; + protected $_columnType = 'number'; }