Benjamin Roth authored on11/11/2024 10:47:55
Showing1 changed files
... ...
@@ -12,6 +12,9 @@ declare(strict_types=1);
12 12
 
13 13
 namespace vonRotenberg\WmfgoCevisioBundle\Model\Import;
14 14
 
15
+use Contao\CoreBundle\InsertTag\InsertTagParser;
16
+use Contao\System;
17
+
15 18
 class ProductModel
16 19
 {
17 20
     /**
... ...
@@ -49,7 +52,8 @@ class ProductModel
49 52
     {
50 53
         if (isset($this->arrData[$name]))
51 54
         {
52
-            return $this->arrData[$name];
55
+            $insertTagParser = System::getContainer()->get(InsertTagParser::class);
56
+            return $insertTagParser->replace($this->arrData[$name]);
53 57
         }
54 58
 
55 59
         return null;
Benjamin Roth authored on06/11/2024 17:16:57
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,67 @@
1
+<?php
2
+
3
+declare(strict_types=1);
4
+
5
+/*
6
+ * This file is part of Affentaler customizations for Contao.
7
+ *
8
+ * (c) Benjamin Roth
9
+ *
10
+ * @license commercial
11
+ */
12
+
13
+namespace vonRotenberg\WmfgoCevisioBundle\Model\Import;
14
+
15
+class ProductModel
16
+{
17
+    /**
18
+     * @var array
19
+     */
20
+    private array $arrData;
21
+
22
+    public function __get($name)
23
+    {
24
+        return $this->get($name);
25
+    }
26
+
27
+    public function __set($name, $value)
28
+    {
29
+        $this->set($name,$value);
30
+    }
31
+
32
+
33
+    public function __call($name, $arguments)
34
+    {
35
+        if (strncmp($name, 'get', 3) === 0)
36
+        {
37
+            $name = lcfirst(substr($name, 3));
38
+
39
+            return $this->get($name);
40
+        } else if (strncmp($name, 'set', 3) === 0)
41
+        {
42
+            $name = lcfirst(substr($name, 3));
43
+
44
+            $this->set($name,$arguments[0]);
45
+        }
46
+    }
47
+
48
+    public function get(string $name)
49
+    {
50
+        if (isset($this->arrData[$name]))
51
+        {
52
+            return $this->arrData[$name];
53
+        }
54
+
55
+        return null;
56
+    }
57
+
58
+    public function set(string $name, $value): void
59
+    {
60
+        $this->arrData[$name] = $value;
61
+    }
62
+
63
+    public function getData(): ?array
64
+    {
65
+        return $this->arrData;
66
+    }
67
+}