]> _ Git - cubist_cms-back.git/commitdiff
wip #3158 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 22 Oct 2019 09:37:36 +0000 (11:37 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 22 Oct 2019 09:37:36 +0000 (11:37 +0200)
src/app/Console/Commands/LocaleCopy.php

index 6962ab8e9aefd4f98a535301a664f8aadd4bb6b9..b7e90e235ba15ee43a824400a5294cac36d53e7f 100644 (file)
@@ -2,9 +2,41 @@
 
 
 namespace Cubist\Backpack\app\Console\Commands;
-use Illuminate\Console\Command;
 
-class LocaleCopy  extends Command
+
+use Cubist\Backpack\app\Magic\Models\CubistMagicAbstractModel;
+
+class LocaleCopy extends CubistCommand
 {
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'cubist:locale:copy {from} {to}';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = 'Copy locale to another one. Useful to start the translation of a website.';
+
+    public function handle()
+    {
+        $from = $this->argument('from');
+        $to = $this->argument('to');
+
+        $this->call('backup:run');
+
+        $this->_handleMagicFolder([$this, '_copyModel']);
+    }
 
+    /**
+     * @param $model CubistMagicAbstractModel
+     */
+    protected function _copyModel($model)
+    {
+        echo 'Copy locale of model ' . $model;
+    }
 }