]> _ Git - cubist_cms-back.git/commitdiff
#2868
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 8 Jul 2019 13:07:31 +0000 (15:07 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 8 Jul 2019 13:07:31 +0000 (15:07 +0200)
src/app/Magic/Models/CubistMagicAbstractModel.php
src/app/Magic/Models/Translate.php

index 2dc95fbacfb35d3f531b624b40c9b5ca586dbb9b..9da9c9d7877eeaa4fb0be1dd61bae13ed7051e46 100644 (file)
@@ -516,12 +516,13 @@ class CubistMagicAbstractModel extends Model implements HasMedia
 
     }
 
-    public function getDecodedAttributes(){
-        $res=new \stdClass();
-        foreach ($this->attributes as $key=>$value) {
-            $res->$key=Json::decodeRecursive($this->getAttribute($key),Json::TYPE_OBJECT);
+    public function getDecodedAttributes()
+    {
+        $res = new \stdClass();
+        foreach ($this->attributes as $key => $value) {
+            $res->$key = Json::decodeRecursive($this->getAttribute($key), Json::TYPE_OBJECT);
         }
-        $res->entity=$this;
+        $res->entity = $this;
         return $res;
     }
 
index 7c90aa3aa096006db50a5b8ff61b1a04e06da6a0..b34d81289dd45cf44243bf38314a937f3b0ceace 100644 (file)
@@ -22,6 +22,15 @@ class Translate extends CubistMagicModel
             $translate->addPath(app_path() . '/' . $path);
         }
 
+        $this->addField(['name' => 'k',
+            'label' => '-',
+            'type' => 'Hidden',
+            'translatable' => true,
+            'store_in' => 'content',
+            'default' => '-',
+            'value' => '-',
+            'fake' => true]);
+
         foreach ($translate->getStringToTranslate() as $string) {
             $key = 't_' . base64_encode($string);