1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rainloop_ynh.git synced 2024-09-03 20:16:18 +02:00
rainloop_ynh/sources/rainloop/v/1.8.2.291/app/libraries/RainLoop/Settings.php

78 lines
1,019 B
PHP
Raw Normal View History

<?php
namespace RainLoop;
class Settings
{
/**
* @var array
*/
protected $aData;
2015-03-07 16:14:19 +01:00
/**
* @var bool
*/
protected $bLocal;
/**
* @return void
*/
2015-03-07 16:14:19 +01:00
public function __construct($bLocal = false)
{
$this->aData = array();
2015-03-07 16:14:19 +01:00
$this->bLocal = !!$bLocal;
}
/**
* @param array $aData
*
* @return \RainLoop\Settings
*/
public function InitData($aData)
{
if (\is_array($aData))
{
$this->aData = $aData;
}
return $this;
}
/**
* @return array
*/
public function DataAsArray()
{
return $this->aData;
}
2015-03-07 16:14:19 +01:00
/**
* @return bool
*/
public function IsLocal()
{
return $this->bLocal;
}
/**
* @param string $sName
* @param mixed $mDefValue = null
*
* @return mixed
*/
public function GetConf($sName, $mDefValue = null)
{
return isset($this->aData[$sName]) ? $this->aData[$sName] : $mDefValue;
}
/**
* @param string $sName
* @param mixed $mValue
*
* @return void
*/
public function SetConf($sName, $mValue)
{
$this->aData[$sName] = $mValue;
}
}