]> _ Git - cubist_cms-back.git/commitdiff
wip #5161 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 15 Mar 2022 11:42:28 +0000 (12:42 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 15 Mar 2022 11:42:28 +0000 (12:42 +0100)
src/app/Magic/Models/CubistMagicAbstractModel.php
src/app/Magic/Models/CubistMagicTranslatableModel.php
src/resources/views/form/form.blade.php

index e73c23cb0b75a8283436c2f46979df2678dc8e5b..97ea3756f68ef579150ec260f0d2732b47463249 100644 (file)
@@ -159,8 +159,10 @@ class CubistMagicAbstractModel extends Model implements HasMedia
         if (null !== $this->connection) {
             $this->setConnection($this->connection);
         }
+        start_measure('Set form fields');
         $this->setFields();
         $this->postSetFields();
+        stop_measure('Set form fields');
     }
 
     /**
index 1a7b34304441c1ad8b9d4c3d9c3c968a2ac9861d..e971209e63d699f4bf88cfd735227d943bdc1221 100644 (file)
@@ -81,11 +81,15 @@ class CubistMagicTranslatableModel extends CubistMagicAbstractModel
             }
         }
 
-        return array_reduce($this->getTranslatableAttributes(), function ($result, $item) {
+        start_measure('Get all translations');
+        $res= array_reduce($this->getTranslatableAttributes(), function ($result, $item) {
             $result[$item] = $this->getTranslations($item);
 
             return $result;
         });
+        stop_measure('Get all translations');
+
+        return $res;
     }
 
     public function copyAllTranslations($from, $to, $overwrite = false)
index dc3e1a4f011e1a3a72004dea6c59799963b23372..11a0d0cb08acbf52ae23420bc3511e91edf4ab85 100644 (file)
@@ -1,4 +1,5 @@
 @php
+start_measure('Render form '.$form->getTitle());
     $action='create';
     $fields=$crud->fields();
 @endphp
@@ -16,3 +17,6 @@
         <span data-value="save_and_back">{{$form->getSubmitLabel()}}</span>
     </button>
 </form>
+@php
+    stop_measure('Render form '.$form->getTitle());
+@endphp