Your IP : 216.73.216.240
<?php
/**
* @copyright Copyright (C) since 2018. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Cedric Keiflin - https://www.ceikay.com
*/
// No direct access
defined('_JEXEC') or die;
Class CKParams {
protected $_attrs = array();
public function __construct($properties = null)
{
if ($properties !== null)
{
$this->setProperties($properties);
}
}
public function get($property, $default = null)
{
if (isset($this->$property))
{
return $this->$property;
}
return $default;
}
public function set($property, $value = null)
{
$previous = isset($this->$property) ? $this->$property : null;
$this->$property = $value;
return $previous;
}
public function setProperties($properties)
{
if (is_array($properties) || is_object($properties))
{
foreach ((array) $properties as $k => $v)
{
// Use the set function which might be overridden.
$this->set($k, $v);
}
return true;
}
return false;
}
}