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