ILIAS  release_8 Revision v8.24
ilForumNotification Class Reference
+ Collaboration diagram for ilForumNotification:

Public Member Functions

 __construct (int $ref_id)
 
 setNotificationId (int $a_notification_id)
 
 getNotificationId ()
 
 setUserId (?int $a_user_id)
 
 getUserId ()
 
 setForumId (int $a_forum_id)
 
 getForumId ()
 
 setThreadId (int $a_thread_id)
 
 getThreadId ()
 
 setInterestedEvents ($interested_events)
 
 getInterestedEvents ()
 
 setAdminForce (bool $a_admin_force)
 
 getAdminForce ()
 
 setUserToggle (bool $a_user_toggle)
 
 getUserToggle ()
 
 setForumRefId (int $a_ref_id)
 
 getForumRefId ()
 
 setUserIdNoti (int $a_user_id_noti)
 
 getUserIdNoti ()
 
 isAdminForceNotification ()
 
 isUserToggleNotification ()
 
 insertAdminForce ()
 
 deleteAdminForce ()
 
 deleteUserToggle ()
 
 updateUserToggle ()
 
 update ()
 
 deleteNotificationAllUsers ()
 
 read ()
 
 existsNotification ()
 
 cloneFromSource (int $sourceRefId)
 
 updateInterestedEvents ()
 
 readInterestedEvents ()
 
 readAllForcedEvents ()
 
 getForcedEventsObjectByUserId (int $user_id)
 

Static Public Member Functions

static checkForumsExistsInsert (int $ref_id, int $user_id)
 
static checkForumsExistsDelete (int $ref_id, int $user_id)
 
static getCachedNodeData (int $ref_id)
 
static _isParentNodeGrpCrs (int $a_ref_id)
 
static _clearForcedForumNotifications (array $move_tree_event)
 
static mergeThreadNotifications ($merge_source_thread_id, $merge_target_thread_id)
 

Private Member Functions

 createMissingNotification (int $user_id)
 

Private Attributes

ilDBInterface $db
 
ilObjUser $user
 
int $notification_id
 
int $user_id = null
 
int $forum_id
 
int $thread_id
 
bool $admin_force = false
 
bool $user_toggle = false
 
int $interested_events = 0
 
int $ref_id
 
int $user_id_noti
 

Static Private Attributes

static array $node_data_cache = []
 
static array $forced_events_cache = []
 

Detailed Description

Definition at line 21 of file class.ilForumNotification.php.

Constructor & Destructor Documentation

◆ __construct()

ilForumNotification::__construct ( int  $ref_id)

Definition at line 40 of file class.ilForumNotification.php.

41 {
42 global $DIC;
43
44 $this->db = $DIC->database();
45 $this->user = $DIC->user();
46 $this->ref_id = $ref_id;
47 $this->forum_id = $DIC['ilObjDataCache']->lookupObjId($ref_id);
48 }
global $DIC
Definition: feed.php:28

References $DIC, $ref_id, and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _clearForcedForumNotifications()

static ilForumNotification::_clearForcedForumNotifications ( array  $move_tree_event)
static

Definition at line 342 of file class.ilForumNotification.php.

342 : void
343 {
344 global $DIC;
345 $ilDB = $DIC->database();
346 $ilObjDataCache = $DIC['ilObjDataCache'];
347
348 if ($move_tree_event['tree'] !== 'tree') {
349 return;
350 }
351
352 $ref_id = (int) $move_tree_event['source_id'];
354
355 if ($is_parent) {
356 $forum_id = $ilObjDataCache->lookupObjId($ref_id);
357
358 $ilDB->manipulateF(
359 'DELETE FROM frm_notification WHERE frm_id = %s AND admin_force_noti = %s',
360 ['integer', 'integer'],
361 [$forum_id, 1]
362 );
363 }
364 }
static _isParentNodeGrpCrs(int $a_ref_id)

References $DIC, $ilDB, $ref_id, and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ _isParentNodeGrpCrs()

static ilForumNotification::_isParentNodeGrpCrs ( int  $a_ref_id)
static

Definition at line 332 of file class.ilForumNotification.php.

332 : bool
333 {
334 global $DIC;
335
336 $parent_ref_id = $DIC->repositoryTree()->getParentId($a_ref_id);
337 $parent_obj = ilObjectFactory::getInstanceByRefId($parent_ref_id);
338
339 return $parent_obj->getType() === 'crs' || $parent_obj->getType() === 'grp';
340 }
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id

References $DIC, and ilObjectFactory\getInstanceByRefId().

Referenced by ilForumModeratorsGUI\addModerator(), and ilForumModeratorsGUI\detachModeratorRole().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkForumsExistsDelete()

static ilForumNotification::checkForumsExistsDelete ( int  $ref_id,
int  $user_id 
)
static

Definition at line 278 of file class.ilForumNotification.php.

278 : void
279 {
280 global $DIC;
281
282 $ilUser = $DIC->user();
283
284 $node_data = self::getCachedNodeData($ref_id);
285
286 foreach ($node_data as $data) {
287 $frm_noti = new ilForumNotification((int) $data['ref_id']);
288 $objFrmMods = new ilForumModerators((int) $data['ref_id']);
289 $moderator_ids = $objFrmMods->getCurrentModerators();
290
291 if ($user_id !== 0) {
292 $frm_noti->setUserId($user_id);
293 } else {
294 $frm_noti->setUserId($ilUser->getId());
295 }
296
297 $frm_noti->setForumId((int) $data['obj_id']);
298 if (!in_array($frm_noti->getUserId(), $moderator_ids, true)) {
299 $frm_noti->deleteAdminForce();
300 }
301 }
302 }
Class ilForumModerators.
static getCachedNodeData(int $ref_id)
$ilUser
Definition: imgupload.php:34

References $data, $DIC, $ilUser, $ref_id, $user_id, and getCachedNodeData().

Referenced by ilPDSelectedItemsBlockGUI\confirmedUnsubscribe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkForumsExistsInsert()

static ilForumNotification::checkForumsExistsInsert ( int  $ref_id,
int  $user_id 
)
static

Definition at line 243 of file class.ilForumNotification.php.

243 : void
244 {
245 global $DIC;
246
247 $ilUser = $DIC->user();
248
249 $node_data = self::getCachedNodeData($ref_id);
250
251 foreach ($node_data as $data) {
252 //check frm_properties if frm_noti is enabled
253 $frm_noti = new ilForumNotification((int) $data['ref_id']);
254 if ($user_id !== 0) {
255 $frm_noti->setUserId($user_id);
256 } else {
257 $frm_noti->setUserId($ilUser->getId());
258 }
259
261 $frm_noti->setAdminForce($admin_force);
262
264 if ($user_toggle) {
265 $frm_noti->setAdminForce(true);
266 }
267
268 if ($admin_force || $user_toggle) {
269 $frm_noti->setUserToggle($user_toggle);
270 $frm_noti->setForumId((int) $data['obj_id']);
271 if ($frm_noti->existsNotification() === false) {
272 $frm_noti->insertAdminForce();
273 }
274 }
275 }
276 }
static _isAdminForceNoti(int $a_obj_id)
static _isUserToggleNoti(int $a_obj_id)

References $admin_force, $data, $DIC, $ilUser, $ref_id, $user_id, $user_toggle, ilForumProperties\_isAdminForceNoti(), ilForumProperties\_isUserToggleNoti(), and getCachedNodeData().

Referenced by ilCourseRegistrationGUI\add(), ilGroupRegistrationGUI\add(), ilObjCourse\register(), and ilForumNotificationTest\testCheckForumsExistsInsert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneFromSource()

ilForumNotification::cloneFromSource ( int  $sourceRefId)

Definition at line 464 of file class.ilForumNotification.php.

464 : void
465 {
466 $sourceNotificationSettings = new self($sourceRefId);
467 $records = $sourceNotificationSettings->read();
468
469 foreach ($records as $usrId => $row) {
470 $this->setUserId($usrId);
471 $this->setAdminForce((bool) $row['admin_force_noti']);
472 $this->setUserToggle((bool) $row['user_toggle_noti']);
473 $this->setUserIdNoti((int) $row['user_id_noti']);
474 $this->setInterestedEvents((int) $row['interested_events']);
475
476 $this->insertAdminForce();
477 }
478 }
setUserToggle(bool $a_user_toggle)
setUserIdNoti(int $a_user_id_noti)
setAdminForce(bool $a_admin_force)
setInterestedEvents($interested_events)

◆ createMissingNotification()

ilForumNotification::createMissingNotification ( int  $user_id)
private

Definition at line 546 of file class.ilForumNotification.php.

546 : self
547 {
548 $new_object = new self($this->ref_id);
549 $new_object->setUserId($user_id);
550 $new_object->setForumId($this->forum_id);
551 $new_object->insertAdminForce();
552
553 return $new_object;
554 }

References $ref_id.

◆ deleteAdminForce()

ilForumNotification::deleteAdminForce ( )

Definition at line 201 of file class.ilForumNotification.php.

201 : void
202 {
203 $this->db->manipulateF(
204 '
205 DELETE FROM frm_notification
206 WHERE user_id = %s
207 AND frm_id = %s
208 AND admin_force_noti = %s
209 AND user_id_noti > %s',
210 ['integer', 'integer', 'integer', 'integer'],
211 [(int) $this->getUserId(), $this->getForumId(), 1, 0]
212 );
213 }

References getForumId(), and getUserId().

+ Here is the call graph for this function:

◆ deleteNotificationAllUsers()

ilForumNotification::deleteNotificationAllUsers ( )

Definition at line 382 of file class.ilForumNotification.php.

382 : void
383 {
384 $this->db->manipulateF(
385 'DELETE FROM frm_notification WHERE frm_id = %s AND user_id_noti > %s',
386 ['integer', 'integer'],
387 [$this->getForumId(), 0]
388 );
389 }

◆ deleteUserToggle()

ilForumNotification::deleteUserToggle ( )

Definition at line 215 of file class.ilForumNotification.php.

215 : void
216 {
217 $this->db->manipulateF(
218 '
219 DELETE FROM frm_notification
220 WHERE user_id = %s
221 AND frm_id = %s
222 AND admin_force_noti = %s
223 AND user_toggle_noti = %s
224 AND user_id_noti > %s',
225 ['integer', 'integer', 'integer', 'integer', 'integer'],
226 [(int) $this->getUserId(), $this->getForumId(), 1, 1, 0]
227 );
228 }

References getForumId(), and getUserId().

+ Here is the call graph for this function:

◆ existsNotification()

ilForumNotification::existsNotification ( )

Definition at line 453 of file class.ilForumNotification.php.

453 : bool
454 {
455 $res = $this->db->queryF(
456 'SELECT user_id FROM frm_notification WHERE user_id = %s AND frm_id = %s AND admin_force_noti = %s',
457 ['integer', 'integer', 'integer'],
458 [(int) $this->getUserId(), $this->getForumId(), (int) $this->getAdminForce()]
459 );
460
461 return $this->db->numRows($res) > 0;
462 }
$res
Definition: ltiservices.php:69

References $res.

◆ getAdminForce()

ilForumNotification::getAdminForce ( )

Definition at line 105 of file class.ilForumNotification.php.

105 : bool
106 {
107 return $this->admin_force;
108 }

References $admin_force.

Referenced by insertAdminForce().

+ Here is the caller graph for this function:

◆ getCachedNodeData()

static ilForumNotification::getCachedNodeData ( int  $ref_id)
static

Definition at line 304 of file class.ilForumNotification.php.

304 : array
305 {
306 global $DIC;
307
308 if (!array_key_exists($ref_id, self::$node_data_cache)) {
309 $node_data = $DIC->repositoryTree()->getSubTree(
310 $DIC->repositoryTree()->getNodeData($ref_id),
311 true,
312 ['frm']
313 );
314 $node_data = array_filter($node_data, static function (array $forum_node) use ($DIC, $ref_id): bool {
315 // filter out forum if a grp lies in the path (#0027702)
316 foreach ($DIC->repositoryTree()->getNodePath((int) $forum_node['child'], $ref_id) as $path_node) {
317 $notRootNode = (int) $path_node['child'] !== (int) $ref_id;
318 $isGroup = $path_node['type'] === 'grp';
319 if ($notRootNode && $isGroup) {
320 return false;
321 }
322 }
323
324 return true;
325 });
326 self::$node_data_cache[$ref_id] = $node_data;
327 }
328
329 return self::$node_data_cache[$ref_id];
330 }

References $DIC, and $ref_id.

Referenced by checkForumsExistsDelete(), and checkForumsExistsInsert().

+ Here is the caller graph for this function:

◆ getForcedEventsObjectByUserId()

ilForumNotification::getForcedEventsObjectByUserId ( int  $user_id)

Definition at line 533 of file class.ilForumNotification.php.

533 : self
534 {
535 if (!isset(self::$forced_events_cache[$user_id])) {
536 $this->readAllForcedEvents();
537 }
538
539 if (!isset(self::$forced_events_cache[$user_id])) {
540 self::$forced_events_cache[$user_id] = $this->createMissingNotification($user_id);
541 }
542
543 return self::$forced_events_cache[$user_id];
544 }

◆ getForumId()

ilForumNotification::getForumId ( )

Definition at line 75 of file class.ilForumNotification.php.

75 : int
76 {
77 return $this->forum_id;
78 }

References $forum_id.

Referenced by deleteAdminForce(), deleteUserToggle(), insertAdminForce(), isAdminForceNotification(), isUserToggleNotification(), and updateUserToggle().

+ Here is the caller graph for this function:

◆ getForumRefId()

ilForumNotification::getForumRefId ( )

Definition at line 125 of file class.ilForumNotification.php.

125 : int
126 {
127 return $this->ref_id;
128 }

References $ref_id.

◆ getInterestedEvents()

ilForumNotification::getInterestedEvents ( )

Definition at line 95 of file class.ilForumNotification.php.

95 : int
96 {
98 }

References $interested_events.

◆ getNotificationId()

ilForumNotification::getNotificationId ( )

Definition at line 55 of file class.ilForumNotification.php.

55 : int
56 {
58 }

References $notification_id.

◆ getThreadId()

ilForumNotification::getThreadId ( )

Definition at line 85 of file class.ilForumNotification.php.

85 : int
86 {
87 return $this->thread_id;
88 }

References $thread_id.

◆ getUserId()

ilForumNotification::getUserId ( )

Definition at line 65 of file class.ilForumNotification.php.

65 : ?int
66 {
67 return $this->user_id;
68 }

References $user_id.

Referenced by deleteAdminForce(), deleteUserToggle(), insertAdminForce(), isAdminForceNotification(), isUserToggleNotification(), and updateUserToggle().

+ Here is the caller graph for this function:

◆ getUserIdNoti()

ilForumNotification::getUserIdNoti ( )

Definition at line 137 of file class.ilForumNotification.php.

137 : int
138 {
139 return $this->user_id_noti;
140 }

References $user_id_noti.

◆ getUserToggle()

ilForumNotification::getUserToggle ( )

Definition at line 115 of file class.ilForumNotification.php.

115 : bool
116 {
117 return $this->user_toggle;
118 }

References $user_toggle.

Referenced by insertAdminForce(), and updateUserToggle().

+ Here is the caller graph for this function:

◆ insertAdminForce()

ilForumNotification::insertAdminForce ( )

Definition at line 179 of file class.ilForumNotification.php.

179 : void
180 {
181 $next_id = $this->db->nextId('frm_notification');
182 $this->setNotificationId($next_id);
183
184 $this->db->manipulateF(
185 '
186 INSERT INTO frm_notification
187 (notification_id, user_id, frm_id, admin_force_noti, user_toggle_noti, user_id_noti)
188 VALUES(%s, %s, %s, %s, %s, %s)',
189 ['integer', 'integer', 'integer', 'integer', 'integer', 'integer'],
190 [
191 $next_id,
192 (int) $this->getUserId(),
193 $this->getForumId(),
194 $this->getAdminForce(),
195 $this->getUserToggle(),
196 $this->user->getId()
197 ]
198 );
199 }
setNotificationId(int $a_notification_id)

References getAdminForce(), getForumId(), getUserId(), getUserToggle(), setNotificationId(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ isAdminForceNotification()

ilForumNotification::isAdminForceNotification ( )

Definition at line 142 of file class.ilForumNotification.php.

142 : bool
143 {
144 $res = $this->db->queryF(
145 '
146 SELECT admin_force_noti FROM frm_notification
147 WHERE user_id = %s
148 AND frm_id = %s
149 AND user_id_noti > %s ',
150 ['integer', 'integer', 'integer'],
151 [(int) $this->getUserId(), $this->getForumId(), 0]
152 );
153
154 if ($row = $this->db->fetchAssoc($res)) {
155 return (bool) $row['admin_force_noti'];
156 }
157
158 return false;
159 }

References $res, getForumId(), and getUserId().

+ Here is the call graph for this function:

◆ isUserToggleNotification()

ilForumNotification::isUserToggleNotification ( )

Definition at line 161 of file class.ilForumNotification.php.

161 : bool
162 {
163 $res = $this->db->queryF(
164 '
165 SELECT user_toggle_noti FROM frm_notification
166 WHERE user_id = %s
167 AND frm_id = %s
168 AND user_id_noti > %s',
169 ['integer', 'integer', 'integer'],
170 [(int) $this->getUserId(), $this->getForumId(), 0]
171 );
172
173 if ($row = $this->db->fetchAssoc($res)) {
174 return (bool) $row['user_toggle_noti'];
175 }
176 return false;
177 }

References $res, getForumId(), and getUserId().

+ Here is the call graph for this function:

◆ mergeThreadNotifications()

static ilForumNotification::mergeThreadNotifications (   $merge_source_thread_id,
  $merge_target_thread_id 
)
static

Definition at line 413 of file class.ilForumNotification.php.

413 : void
414 {
415 global $DIC;
416
417 $ilDB = $DIC->database();
418
419 $res = $ilDB->queryF(
420 'SELECT notification_id, user_id FROM frm_notification WHERE frm_id = %s AND thread_id = %s ORDER BY user_id ASC',
421 ['integer', 'integer'],
422 [0, $merge_source_thread_id]
423 );
424
425 $res_2 = $ilDB->queryF(
426 'SELECT DISTINCT user_id FROM frm_notification WHERE frm_id = %s AND thread_id = %s ORDER BY user_id ASC',
427 ['integer', 'integer'],
428 [0, $merge_target_thread_id]
429 );
430
431 $users_already_notified = [];
432 while ($users_row = $ilDB->fetchAssoc($res_2)) {
433 $users_already_notified[(int) $users_row['user_id']] = (int) $users_row['user_id'];
434 }
435
436 while ($row = $ilDB->fetchAssoc($res)) {
437 if (isset($users_already_notified[(int) $row['user_id']])) {
438 $ilDB->manipulateF(
439 'DELETE FROM frm_notification WHERE notification_id = %s',
440 ['integer'],
441 [$row['notification_id']]
442 );
443 } else {
444 $ilDB->update(
445 'frm_notification',
446 ['thread_id' => ['integer', $merge_target_thread_id]],
447 ['thread_id' => ['integer', $merge_source_thread_id]]
448 );
449 }
450 }
451 }

References $DIC, $ilDB, $res, and ILIAS\Repository\int().

Referenced by ilForum\mergeThreads(), and ilForumNotificationTest\testMergeThreadNotifications().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilForumNotification::read ( )
Returns
array<int, array<string, mixed>>

Definition at line 394 of file class.ilForumNotification.php.

394 : array
395 {
396 $result = [];
397
398 $res = $this->db->queryF('SELECT * FROM frm_notification WHERE frm_id = %s', ['integer'], [$this->getForumId()]);
399 while ($row = $this->db->fetchAssoc($res)) {
400 $result[(int) $row['user_id']]['notification_id'] = (int) $row['notification_id'];
401 $result[(int) $row['user_id']]['user_id'] = (int) $row['user_id'];
402 $result[(int) $row['user_id']]['frm_id'] = (int) $row['frm_id'];
403 $result[(int) $row['user_id']]['thread_id'] = (int) $row['thread_id'];
404 $result[(int) $row['user_id']]['admin_force_noti'] = (int) $row['admin_force_noti'];
405 $result[(int) $row['user_id']]['user_toggle_noti'] = (int) $row['user_toggle_noti'];
406 $result[(int) $row['user_id']]['interested_events'] = (int) $row['interested_events'];
407 $result[(int) $row['user_id']]['user_id_noti'] = (int) $row['user_id_noti'];
408 }
409
410 return $result;
411 }

References $res, and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ readAllForcedEvents()

ilForumNotification::readAllForcedEvents ( )
Returns
array<int, ilForumNotification>

Definition at line 510 of file class.ilForumNotification.php.

510 : array
511 {
512 $res = $this->db->queryF(
513 'SELECT * FROM frm_notification WHERE admin_force_noti = %s AND frm_id = %s',
514 ['integer', 'integer'],
515 [1, $this->forum_id]
516 );
517
518 while ($row = $this->db->fetchAssoc($res)) {
519 $notificationConfig = new self($this->ref_id);
520 $notificationConfig->setNotificationId((int) $row['notification_id']);
521 $notificationConfig->setUserId((int) $row['user_id']);
522 $notificationConfig->setForumId((int) $row['frm_id']);
523 $notificationConfig->setAdminForce((bool) $row['admin_force_noti']);
524 $notificationConfig->setUserToggle((bool) $row['user_toggle_noti']);
525 $notificationConfig->setInterestedEvents((int) $row['interested_events']);
526
527 self::$forced_events_cache[(int) $row['user_id']] = $notificationConfig;
528 }
529
531 }

References $ref_id, $res, and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ readInterestedEvents()

ilForumNotification::readInterestedEvents ( )

Definition at line 489 of file class.ilForumNotification.php.

489 : int
490 {
492
493 $this->db->setLimit(1);
494 $res = $this->db->queryF(
495 'SELECT interested_events FROM frm_notification WHERE user_id = %s AND frm_id = %s',
496 ['integer', 'integer'],
497 [(int) $this->getUserId(), $this->getForumId()]
498 );
499
500 while ($row = $this->db->fetchAssoc($res)) {
501 $interested_events = (int) $row['interested_events'];
502 }
503
504 return $interested_events;
505 }

References $res, ilForumNotificationEvents\DEACTIVATED, and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ setAdminForce()

ilForumNotification::setAdminForce ( bool  $a_admin_force)

Definition at line 100 of file class.ilForumNotification.php.

100 : void
101 {
102 $this->admin_force = $a_admin_force;
103 }

◆ setForumId()

ilForumNotification::setForumId ( int  $a_forum_id)

Definition at line 70 of file class.ilForumNotification.php.

70 : void
71 {
72 $this->forum_id = $a_forum_id;
73 }

◆ setForumRefId()

ilForumNotification::setForumRefId ( int  $a_ref_id)

Definition at line 120 of file class.ilForumNotification.php.

120 : void
121 {
122 $this->ref_id = $a_ref_id;
123 }

◆ setInterestedEvents()

ilForumNotification::setInterestedEvents (   $interested_events)

Definition at line 90 of file class.ilForumNotification.php.

90 : void
91 {
92 $this->interested_events = $interested_events;
93 }

References $interested_events.

◆ setNotificationId()

ilForumNotification::setNotificationId ( int  $a_notification_id)

Definition at line 50 of file class.ilForumNotification.php.

50 : void
51 {
52 $this->notification_id = $a_notification_id;
53 }

Referenced by insertAdminForce().

+ Here is the caller graph for this function:

◆ setThreadId()

ilForumNotification::setThreadId ( int  $a_thread_id)

Definition at line 80 of file class.ilForumNotification.php.

80 : void
81 {
82 $this->thread_id = $a_thread_id;
83 }

◆ setUserId()

ilForumNotification::setUserId ( ?int  $a_user_id)

Definition at line 60 of file class.ilForumNotification.php.

60 : void
61 {
62 $this->user_id = $a_user_id;
63 }

◆ setUserIdNoti()

ilForumNotification::setUserIdNoti ( int  $a_user_id_noti)

Definition at line 131 of file class.ilForumNotification.php.

131 : void
132 {
133 $this->user_id_noti = $a_user_id_noti;
134 }

◆ setUserToggle()

ilForumNotification::setUserToggle ( bool  $a_user_toggle)

Definition at line 110 of file class.ilForumNotification.php.

110 : void
111 {
112 $this->user_toggle = $a_user_toggle;
113 }

◆ update()

ilForumNotification::update ( )

Definition at line 366 of file class.ilForumNotification.php.

366 : void
367 {
368 $this->db->manipulateF(
369 'UPDATE frm_notification SET admin_force_noti = %s, user_toggle_noti = %s, ' .
370 'interested_events = %s WHERE user_id = %s AND frm_id = %s',
371 ['integer', 'integer', 'integer', 'integer', 'integer'],
372 [
373 (int) $this->getAdminForce(),
374 (int) $this->getUserToggle(),
375 $this->getInterestedEvents(),
376 (int) $this->getUserId(),
377 $this->getForumId()
378 ]
379 );
380 }

◆ updateInterestedEvents()

ilForumNotification::updateInterestedEvents ( )

Definition at line 480 of file class.ilForumNotification.php.

480 : void
481 {
482 $this->db->manipulateF(
483 'UPDATE frm_notification SET interested_events = %s WHERE user_id = %s AND frm_id = %s',
484 ['integer', 'integer', 'integer'],
485 [$this->getInterestedEvents(), (int) $this->getUserId(), $this->getForumId()]
486 );
487 }

◆ updateUserToggle()

ilForumNotification::updateUserToggle ( )

Definition at line 230 of file class.ilForumNotification.php.

230 : void
231 {
232 $this->db->manipulateF(
233 'UPDATE frm_notification SET user_toggle_noti = %s WHERE user_id = %s AND frm_id = %s AND admin_force_noti = %s',
234 ['integer', 'integer', 'integer', 'integer'],
235 [$this->getUserToggle(), (int) $this->getUserId(), $this->getForumId(), 1]
236 );
237 }

References getForumId(), getUserId(), and getUserToggle().

+ Here is the call graph for this function:

Field Documentation

◆ $admin_force

bool ilForumNotification::$admin_force = false
private

Definition at line 34 of file class.ilForumNotification.php.

Referenced by checkForumsExistsInsert(), and getAdminForce().

◆ $db

ilDBInterface ilForumNotification::$db
private

Definition at line 28 of file class.ilForumNotification.php.

◆ $forced_events_cache

array ilForumNotification::$forced_events_cache = []
staticprivate

Definition at line 26 of file class.ilForumNotification.php.

◆ $forum_id

int ilForumNotification::$forum_id
private

Definition at line 32 of file class.ilForumNotification.php.

Referenced by getForumId().

◆ $interested_events

int ilForumNotification::$interested_events = 0
private

Definition at line 36 of file class.ilForumNotification.php.

Referenced by getInterestedEvents(), and setInterestedEvents().

◆ $node_data_cache

array ilForumNotification::$node_data_cache = []
staticprivate

Definition at line 24 of file class.ilForumNotification.php.

◆ $notification_id

int ilForumNotification::$notification_id
private

Definition at line 30 of file class.ilForumNotification.php.

Referenced by getNotificationId().

◆ $ref_id

int ilForumNotification::$ref_id
private

◆ $thread_id

int ilForumNotification::$thread_id
private

Definition at line 33 of file class.ilForumNotification.php.

Referenced by getThreadId().

◆ $user

ilObjUser ilForumNotification::$user
private

Definition at line 29 of file class.ilForumNotification.php.

◆ $user_id

int ilForumNotification::$user_id = null
private

◆ $user_id_noti

int ilForumNotification::$user_id_noti
private

Definition at line 38 of file class.ilForumNotification.php.

Referenced by getUserIdNoti().

◆ $user_toggle

bool ilForumNotification::$user_toggle = false
private

Definition at line 35 of file class.ilForumNotification.php.

Referenced by checkForumsExistsInsert(), and getUserToggle().


The documentation for this class was generated from the following file: