19declare(strict_types=1);
21require_once
'Services/Object/classes/class.ilObject.php';
22require_once
'Services/Object/classes/class.ilObjectActivation.php';
37 public function __construct(
int $a_id = 0,
bool $a_call_by_reference =
true)
47 $this->access_visibility = $a_value;
87 if ($this->referenced && $this->ref_id) {
93 $activation->toggleChangeable(
true);
94 $activation->update($this->ref_id);
97 return parent::update();
102 if ($this->referenced && $this->ref_id) {
119 return (
int)
$settings->get(
'public_room_ref',
'0');
126 $rset =
$DIC->database()->query(
127 'SELECT object_id FROM chatroom_settings WHERE room_type = ' .
$DIC->database()->quote(
'default',
'text')
129 if ($row =
$DIC->database()->fetchAssoc($rset)) {
130 return (
int) $row[
'object_id'];
138 $userInfo =
new stdClass();
139 $userInfo->username =
$user->getUsername();
140 $userInfo->id =
$user->getUserId();
153 'il_chat_moderator_' . $this->
getRefId(),
154 'Moderator of chat obj_no.' . $this->
getId(),
164 $newObj = parent::cloneObject(
$target_id, $copy_id, $omit_tree);
166 $objId = $newObj->getId();
168 $original_settings = $original_room->getSettings();
171 $original_settings[
'object_id'] =
$objId;
173 $room->saveSettings($original_settings);
175 $rbac_log_roles = $this->rbac_review->getParentRoleIds($newObj->getRefId(),
false);
182 $connector->sendCreatePrivateRoom($room->getRoomId(), 0, $newObj->getOwner(), $newObj->getTitle());
187 public function delete():
bool
189 $this->db->manipulateF(
190 'DELETE FROM chatroom_users WHERE chatroom_users.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
195 $this->db->manipulateF(
196 'DELETE FROM chatroom_history WHERE chatroom_history.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
201 $this->db->manipulateF(
202 'DELETE FROM chatroom_bans WHERE chatroom_bans.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
207 $this->db->manipulateF(
208 'DELETE FROM chatroom_sessions WHERE chatroom_sessions.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
213 $this->db->manipulateF(
215 DELETE FROM chatroom_proomaccess
216 WHERE chatroom_proomaccess.proom_id IN (
217 SELECT chatroom_prooms.proom_id
218 FROM chatroom_prooms WHERE chatroom_prooms.parent_id IN (
219 SELECT chatroom_settings.room_id
220 FROM chatroom_settings
221 WHERE chatroom_settings.object_id = %s
228 $this->db->manipulateF(
230 DELETE FROM chatroom_psessions
231 WHERE chatroom_psessions.proom_id IN (
232 SELECT chatroom_prooms.proom_id
233 FROM chatroom_prooms WHERE chatroom_prooms.parent_id IN (
234 SELECT chatroom_settings.room_id
235 FROM chatroom_settings
236 WHERE chatroom_settings.object_id = %s
243 $this->db->manipulateF(
244 'DELETE FROM chatroom_prooms WHERE chatroom_prooms.parent_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
250 $this->db->manipulateF(
251 'DELETE FROM chatroom_settings WHERE object_id = %s',
256 if ($this->ref_id && $this->
getId()) {
260 return parent::delete();
static getDefaultConfiguration()
Instantiates and returns ilChatroomAdmin object using instance_id and settings from settingsTable.
Class ilChatroomServerConnector.
static byObjectId(int $object_id)
setAccessBegin(?int $access_begin)
getPersonalInformation(ilChatroomUser $user)
__construct(int $a_id=0, bool $a_call_by_reference=true)
setAccessEnd(?int $access_end)
setAccessType(int $access_type)
cloneObject(int $target_id, int $copy_id=0, bool $omit_tree=false)
initDefaultRoles()
init default roles settings Purpose of this function is to create a local role folder and local roles...
setAccessVisibility(int $a_value)
static createDefaultRole(string $a_title, string $a_description, string $a_tpl_name, int $a_ref_id)
Class ilObjectActivation.
const TIMINGS_DEACTIVATED
static getItem(int $ref_id)
static deleteAllEntries(int $ref_id)
Delete all db entries for ref id.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static add(int $a_action, int $a_ref_id, array $a_diff, bool $a_source_ref_id=false)
static gatherFaPa(int $a_ref_id, array $a_role_ids, bool $a_add_action=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc