PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.1.4
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.1.4
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / back / Core / AcymParameter.php

AcymParameter.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 10.1.4, at back/Core/AcymParameter.php

39 lines 998 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace AcyMailing\Core;
4
5 class AcymParameter
6 {
7 private array $params = [];
8 private object $paramObject;
9
10 public function __construct($params = null)
11 {
12 if (is_string($params)) {
13 $this->params = json_decode($params, true);
14 } elseif (is_array($params)) {
15 $this->params = $params;
16 } elseif (is_object($params)) {
17 $this->paramObject = $params;
18 }
19 }
20
21 public function get(string $path, $default = null)
22 {
23 if (empty($this->paramObject)) {
24 if (empty($this->params[$path]) && !(isset($this->params[$path]) && $this->params[$path] === '0')) {
25 return $default;
26 }
27
28 return $this->params[$path];
29 } else {
30 $value = $this->paramObject->get($path, 'noval');
31 if ($value === 'noval') {
32 $value = $this->paramObject->get('data.'.$path, $default);
33 }
34
35 return $value;
36 }
37 }
38 }
39