4 include_once(
'./Modules/Cloud/exceptions/class.ilCloudPluginConfigException.php');
60 $index = substr($method, 3);
61 if (substr($method, 0, 3) ==
'get') {
62 if (!isset($this->cache[
$index])) {
63 $this->cache[
$index] = $this->
getValue(self::_fromCamelCase(substr($method, 3)));
65 if ($this->cache[$index] == null) {
66 $this->cache[
$index] =
false;
69 return $this->cache[
$index];
70 } elseif (substr($method, 0, 3) ==
'set') {
88 if (!
$ilDB->tableExists($this->table_name)) {
93 $ilDB->insert($this->table_name, array(
"config_key" => array(
"text",
$key),
"config_value" => array(
"text", $value)));
95 $ilDB->update($this->table_name, array(
"config_key" => array(
"text",
$key),
"config_value" => array(
"text", $value)), array(
"config_key" => array(
"text",
$key)));
106 $ilDB = $DIC[
'ilDB'];
113 $result =
$ilDB->query(
"SELECT config_value FROM " . $this->table_name .
" WHERE config_key = " .
$ilDB->quote(
$key,
"text"));
119 return (
string) $record[
'config_value'];
130 $ilDB = $DIC[
'ilDB'];
132 if (!
$ilDB->tableExists($this->getTableName())) {
134 'config_key' => array(
138 'config_value' => array(
140 'notnull' =>
false),);
160 $str[0] = strtolower($str[0]);
161 return preg_replace_callback(
'/([A-Z])/',
function (
$c) {
162 return "_" . strtolower(
$c[1]);
171 public static function _toCamelCase($str, $capitalise_first_char =
false)
173 if ($capitalise_first_char) {
174 $str[0] = strtoupper($str[0]);
176 return preg_replace_callback(
'/-([a-z])/',
function (
$c) {
177 return strtoupper(
$c[1]);
184 $ilDB = $DIC[
'ilDB'];
const TABLE_DOES_NOT_EXIST
setTableName($table_name)
Class ilCloudPluginConfigException.
Class ilCloudPluginConfig.
static _fromCamelCase($str)
const NO_VALID_GET_OR_SET_FUNCTION
static _toCamelCase($str, $capitalise_first_char=false)