]> _ Git - pmi.git/commitdiff
wip #5858 @1:00
authorsoufiane <soufiane@cubedesigners.com>
Tue, 11 Apr 2023 16:23:43 +0000 (18:23 +0200)
committersoufiane <soufiane@cubedesigners.com>
Tue, 11 Apr 2023 16:23:43 +0000 (18:23 +0200)
app/Models/Command.php [new file with mode: 0644]
app/Models/CommandPanierSchema.php [new file with mode: 0644]
app/Models/Panier.php [new file with mode: 0644]

diff --git a/app/Models/Command.php b/app/Models/Command.php
new file mode 100644 (file)
index 0000000..1c43883
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+namespace App\Models;
+
+class Command extends CommandPanierSchema
+{
+    protected $table = 'command';
+
+    protected $_options = ['name' => 'command',
+        'singular' => 'Commande',
+        'plural' => 'Commandes'];
+
+    public function setFields()
+    {
+        parent::setFields();
+
+        $this->addField(['name' => 'status',
+            'type' => 'Text',
+            'label' => 'Statut',
+            'column' => true,
+            'tab' => 'Informations'
+        ]);
+
+        foreach ($this->fields as $fields) {
+            $this->addField($fields);
+        }
+    }
+}
diff --git a/app/Models/CommandPanierSchema.php b/app/Models/CommandPanierSchema.php
new file mode 100644 (file)
index 0000000..8299a22
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+
+namespace App\Models;
+
+use Cubist\Backpack\app\Magic\Models\CubistMagicAbstractModel;
+
+class CommandPanierSchema extends CubistMagicAbstractModel
+{
+    protected $fields = [
+        [
+            'name' => 'user_id',
+            'label' => 'user_id',
+            'type' => 'Text',
+            'column' => true
+        ],
+        [
+            'name' => 'addresses',
+            'label' => 'Adresses',
+            'type' => 'Text',
+            'column' => true
+        ],
+        [
+            'name' => 'products',
+            'label' => 'Produits',
+            'type' => 'Text',
+            'column' => true
+        ]
+    ];
+}
diff --git a/app/Models/Panier.php b/app/Models/Panier.php
new file mode 100644 (file)
index 0000000..80d1dc1
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+
+namespace App\Models;
+
+class Panier extends CommandPanierSchema
+{
+    protected $table = 'selection';
+
+    protected $_options = ['name' => 'selection',
+        'singular' => 'Panier',
+        'plural' => 'Paniers'];
+
+    public function setFields()
+    {
+        parent::setFields();
+
+        $this->addField(['name' => 'name',
+            'type' => 'Text',
+            'label' => 'Nom',
+            'column' => true
+        ]);
+
+        foreach ($this->fields as $fields) {
+            $this->addField($fields);
+        }
+    }
+}