]> _ Git - cubist_cms-back.git/commitdiff
wip #3712
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Jun 2020 18:18:35 +0000 (20:18 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Jun 2020 18:18:35 +0000 (20:18 +0200)
src/app/Magic/Fields/Field.php
src/app/Magic/Models/CubistMagicAbstractModel.php

index 1fd15dbbb2a425d3b3d2672405d78991afb59cfb..30776a1c51a05f490c1ad7684e1a0b560953bf1d 100644 (file)
@@ -168,9 +168,11 @@ class Field implements \ArrayAccess
             'type' => $this->getAttribute('column_type'),
             'label' => $this->getAttribute('column_label', $this->getAttribute('label')),
             'searchLogic' => $this->getAttribute('searchLogic'),
-            'format' => $this->getAttribute('column_format', null)
+            'format' => $this->getAttribute('column_format', null),
+            'orderable' => true,
         ];
 
+
         return $res;
     }
 
index 5ead94d35027038332b33713bb4025151b4a0f1a..f48f3179d60faa7a4b0323710f6dc48faa7d8575 100644 (file)
@@ -35,6 +35,7 @@ class CubistMagicAbstractModel extends Model implements HasMedia
 
     protected static $_doctrineTypesMapping = ['int' => 'integer'];
 
+    protected $connection = null;
     protected $primaryKey = 'id';
     public $timestamps = true;
     public $clonable = true;
@@ -75,13 +76,15 @@ class CubistMagicAbstractModel extends Model implements HasMedia
 
     public function __construct(array $attributes = [])
     {
-
         $this->setup();
         $this->fill($attributes);
     }
 
     public function setup()
     {
+        if (null !== $this->connection) {
+            $this->setConnection($this->connection);
+        }
         $this->setFields();
         $this->postSetFields();
         $this->bootIfNotBooted();