49 $DIC->database()->setLimit(1);
53 if (
$row =
$DIC->database()->fetchObject($rset)) {
54 return new self((int)
$row->instance_id,
$row);
65 require_once
'Modules/Chatroom/classes/class.ilChatroomServerSettings.php';
80 FROM chatroom_admconfig
81 WHERE instance_id = %s",
83 array($this->config_id)
88 $DIC->database()->manipulateF(
91 FROM chatroom_admconfig
92 WHERE instance_id = %s",
94 array($this->config_id)
97 $row[
'default_config'] !==
null ? $def_conf =
$row[
'default_config'] : $def_conf =
"{}";
98 $row[
'client_settings'] !==
null ? $clnt_set =
$row[
'client_settings'] : $clnt_set =
"{}";
100 $DIC->database()->manipulateF(
102 INSERT INTO chatroom_admconfig
103 (instance_id, server_settings, default_config, client_settings)
104 VALUES (%s, %s, %s, %s)",
105 array(
'integer',
'text',
'integer',
'text'),
106 array($this->config_id, json_encode(
$settings), $def_conf, $clnt_set)
121 FROM chatroom_admconfig
122 WHERE instance_id = %s",
124 array($this->config_id)
129 $DIC->database()->manipulateF(
132 FROM chatroom_admconfig
133 WHERE instance_id = %s",
135 array($this->config_id)
138 $row[
'default_config'] !==
null ? $def_conf =
$row[
'default_config'] : $def_conf =
"{}";
139 $row[
'server_settings'] !==
null ? $srv_set =
$row[
'server_settings'] : $srv_set =
"{}";
141 $DIC->database()->manipulateF(
143 INSERT INTO chatroom_admconfig
144 (instance_id, server_settings, default_config, client_settings)
145 VALUES (%s, %s, %s, %s)",
169 $query =
'SELECT * FROM ' . self::$settingsTable .
' WHERE instance_id = ' .
$DIC->database()->quote($this->config_id,
'integer');
196 $query =
'SELECT * FROM ' . self::$settingsTable .
' WHERE instance_id = ' .
$DIC->database()->quote($this->config_id,
'integer');
An exception for terminatinating execution or to throw for unit testing.
static getDefaultConfiguration()
Instantiates and returns ilChatroomAdmin object using instance_id and settings from settingsTable.
saveClientSettings(stdClass $settings)
Saves given client $settings into settingsTable.
getServerSettings()
Instantiates ilChatroomServerSettings object, sets data using $this->settings->server_settings and re...
saveGeneralSettings(stdClass $settings)
Saves given $settings into settingsTable.
__construct($config_id, stdClass $settings=null)
Constructor Sets $this->config_id and $this->settings using given $config_id and $settings.
loadGeneralSettings()
Returns an array containing server settings from settingsTable.
loadClientSettings()
Returns an array containing client settings from settingsTable.
foreach($_POST as $key=> $value) $res