4 include_once(
'./Modules/Cloud/exceptions/class.ilCloudPluginConfigException.php');
60 $index = substr($method,3);
61 if (substr($method, 0, 3) ==
'get')
63 if (!isset($this->cache[$index]))
65 $this->cache[$index] = $this->
getValue(self::_fromCamelCase(substr($method, 3)));
67 if ($this->cache[$index] == null)
69 $this->cache[$index] =
false;
72 return $this->cache[$index];
73 }
else if (substr($method, 0, 3) ==
'set')
75 $this->cache[$index] =
$params[0];
94 if(!
$ilDB->tableExists($this->table_name))
99 if (!is_string($this->
getValue($key)))
101 $ilDB->insert($this->table_name,
array(
"config_key" =>
array(
"text", $key),
"config_value" =>
array(
"text", $value)));
106 $ilDB->update($this->table_name,
array(
"config_key" =>
array(
"text", $key),
"config_value" =>
array(
"text", $value)),
array(
"config_key" =>
array(
"text", $key)));
117 $ilDB = $DIC[
'ilDB'];
125 $result =
$ilDB->query(
"SELECT config_value FROM ". $this->table_name .
" WHERE config_key = " .
$ilDB->quote($key,
"text"));
132 return (
string)$record[
'config_value'];
143 $ilDB = $DIC[
'ilDB'];
145 if (!
$ilDB->tableExists($this->getTableName()))
148 'config_key' =>
array(
152 'config_value' =>
array(
154 'notnull' =>
false),);
174 $str[0] = strtolower($str[0]);
175 $func = create_function(
'$c',
'return "_" . strtolower($c[1]);');
176 return preg_replace_callback(
'/([A-Z])/', $func, $str);
184 public static function _toCamelCase($str, $capitalise_first_char =
false)
186 if ($capitalise_first_char)
188 $str[0] = strtoupper($str[0]);
190 $func = create_function(
'$c',
'return strtoupper($c[1]);');
191 return preg_replace_callback(
'/-([a-z])/', $func, $str);
197 $ilDB = $DIC[
'ilDB'];
const TABLE_DOES_NOT_EXIST
setTableName($table_name)
Class ilCloudPluginConfigException.
Class ilCloudPluginConfig.
Create styles array
The data for the language used.
static _fromCamelCase($str)
const NO_VALID_GET_OR_SET_FUNCTION
static _toCamelCase($str, $capitalise_first_char=false)