]> _ Git - cubist_cms-back.git/commitdiff
wip #3753
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 26 Nov 2020 13:18:29 +0000 (14:18 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 26 Nov 2020 13:18:29 +0000 (14:18 +0100)
src/app/Magic/Models/CubistMagicAbstractModel.php

index c336907f70f535b17d2fd9ab305db9121d8ea5f8..a5e4dc93e07f5eba52aa19cc6a21855e4e0841b9 100644 (file)
@@ -357,7 +357,10 @@ class CubistMagicAbstractModel extends Model implements HasMedia
         }
 
         foreach ($ops as $operation) {
-            $res .= 'use \\' . $operation . ';' . "\n\t";
+            if ($operation[0] !== '\\') {
+                $operation = '\\' . $operation;
+            }
+            $res .= 'use ' . $operation . ';' . "\n\t";
         }
         $res .= "\n";
         return $res;