# acymailing/11.1.0/back/Core/AcymParameter.php

AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress, version 11.1.0. 48 lines.

- Page: https://pluginprobe.com/plugins/acymailing/11.1.0/code/back/Core/AcymParameter.php
- Raw: https://pluginprobe.com/plugins/acymailing/11.1.0/raw/back/Core/AcymParameter.php
- Modified: 2026-08-03T10:18:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/acymailing/11.1.0/code/back/Core/AcymParameter.php#L10-L20`.

```php
<?php

namespace AcyMailing\Core;

class AcymParameter
{
    private array $params = [];
    private object $paramObject;

    /**
     * @param null $params We expect a json encoded object, but it could directly be an object with protected data in Joomla 3
     */
    public function __construct($params = null)
    {
        if (is_string($params)) {
            $this->params = json_decode($params, true);
        } elseif (is_array($params)) {
            $this->params = $params;
        } elseif (is_object($params)) {
            $this->paramObject = $params;
        }
    }

    /**
     * @param mixed $default
     *
     * @return mixed
     */
    public function get(string $path, $default = null)
    {
        if (empty($this->paramObject)) {
            if (empty($this->params[$path]) && !(isset($this->params[$path]) && $this->params[$path] === '0')) {
                return $default;
            }

            return $this->params[$path];
        } else {
            // Handle the object based parameters
            $value = $this->paramObject->get($path, 'noval');
            if ($value === 'noval') {
                $value = $this->paramObject->get('data.'.$path, $default);
            }

            return $value;
        }
    }
}

```
