ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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.

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

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
+ 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.

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

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'];
353  $is_parent = self::_isParentNodeGrpCrs($ref_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  }
global $DIC
Definition: feed.php:28
+ 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.

References $DIC, and ilObjectFactory\getInstanceByRefId().

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

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  }
global $DIC
Definition: feed.php:28
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
+ 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.

References $data, $DIC, and $ilUser.

Referenced by ilPDSelectedItemsBlockGUI\confirmedUnsubscribe().

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  }
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
Class ilForumModerators.
+ 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.

References $data, $DIC, $ilUser, ilForumProperties\_isAdminForceNoti(), and ilForumProperties\_isUserToggleNoti().

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

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 
260  $admin_force = ilForumProperties::_isAdminForceNoti((int) $data['obj_id']);
261  $frm_noti->setAdminForce($admin_force);
262 
263  $user_toggle = ilForumProperties::_isUserToggleNoti((int) $data['obj_id']);
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  }
global $DIC
Definition: feed.php:28
static _isAdminForceNoti(int $a_obj_id)
$ilUser
Definition: imgupload.php:34
static _isUserToggleNoti(int $a_obj_id)
+ 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.

References insertAdminForce(), setAdminForce(), setInterestedEvents(), setUserId(), setUserIdNoti(), and setUserToggle().

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  }
setInterestedEvents($interested_events)
setUserToggle(bool $a_user_toggle)
setAdminForce(bool $a_admin_force)
setUserIdNoti(int $a_user_id_noti)
+ Here is the call graph for this function:

◆ createMissingNotification()

ilForumNotification::createMissingNotification ( int  $user_id)
private

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

References $ref_id.

Referenced by getForcedEventsObjectByUserId().

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  }
+ Here is the caller graph for this function:

◆ deleteAdminForce()

ilForumNotification::deleteAdminForce ( )

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

References getForumId(), and getUserId().

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  }
+ Here is the call graph for this function:

◆ deleteNotificationAllUsers()

ilForumNotification::deleteNotificationAllUsers ( )

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

References getForumId().

Referenced by ilForumSettingsGUI\updateNotificationSettings().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteUserToggle()

ilForumNotification::deleteUserToggle ( )

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

References getForumId(), and getUserId().

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  }
+ Here is the call graph for this function:

◆ existsNotification()

ilForumNotification::existsNotification ( )

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

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

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
+ Here is the call graph for this function:

◆ getAdminForce()

ilForumNotification::getAdminForce ( )

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

References $admin_force.

Referenced by existsNotification(), insertAdminForce(), and update().

105  : bool
106  {
107  return $this->admin_force;
108  }
+ 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.

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

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  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ getForcedEventsObjectByUserId()

ilForumNotification::getForcedEventsObjectByUserId ( int  $user_id)

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

References $user_id, createMissingNotification(), and readAllForcedEvents().

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  }
+ Here is the call graph for this function:

◆ getForumId()

◆ getForumRefId()

ilForumNotification::getForumRefId ( )

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

References $ref_id.

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

◆ getInterestedEvents()

ilForumNotification::getInterestedEvents ( )

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

References $interested_events.

Referenced by update(), and updateInterestedEvents().

95  : int
96  {
98  }
+ Here is the caller graph for this function:

◆ getNotificationId()

ilForumNotification::getNotificationId ( )

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

References $notification_id.

55  : int
56  {
58  }

◆ getThreadId()

ilForumNotification::getThreadId ( )

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

References $thread_id.

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

◆ getUserId()

ilForumNotification::getUserId ( )

◆ getUserIdNoti()

ilForumNotification::getUserIdNoti ( )

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

References $user_id_noti.

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

◆ getUserToggle()

ilForumNotification::getUserToggle ( )

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

References $user_toggle.

Referenced by insertAdminForce(), update(), and updateUserToggle().

115  : bool
116  {
117  return $this->user_toggle;
118  }
+ Here is the caller graph for this function:

◆ insertAdminForce()

ilForumNotification::insertAdminForce ( )

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

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

Referenced by cloneFromSource().

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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAdminForceNotification()

ilForumNotification::isAdminForceNotification ( )

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

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

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  }
$res
Definition: ltiservices.php:69
+ Here is the call graph for this function:

◆ isUserToggleNotification()

ilForumNotification::isUserToggleNotification ( )

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

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

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  }
$res
Definition: ltiservices.php:69
+ 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.

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

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

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  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ 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.

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

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  }
$res
Definition: ltiservices.php:69
+ Here is the call graph for this function:

◆ readAllForcedEvents()

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

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

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

Referenced by getForcedEventsObjectByUserId(), and ilForumSettingsGUI\initForcedForumNotification().

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 
530  return self::$forced_events_cache;
531  }
$res
Definition: ltiservices.php:69
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readInterestedEvents()

ilForumNotification::readInterestedEvents ( )

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

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

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  }
$res
Definition: ltiservices.php:69
+ Here is the call graph for this function:

◆ setAdminForce()

ilForumNotification::setAdminForce ( bool  $a_admin_force)

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

Referenced by cloneFromSource(), and ilForumSettingsGUI\showMembers().

100  : void
101  {
102  $this->admin_force = $a_admin_force;
103  }
+ Here is the caller graph for this function:

◆ 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.

References $interested_events.

Referenced by cloneFromSource().

90  : void
91  {
92  $this->interested_events = $interested_events;
93  }
+ Here is the caller graph for this function:

◆ setNotificationId()

ilForumNotification::setNotificationId ( int  $a_notification_id)

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

Referenced by insertAdminForce().

50  : void
51  {
52  $this->notification_id = $a_notification_id;
53  }
+ 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)

◆ setUserIdNoti()

ilForumNotification::setUserIdNoti ( int  $a_user_id_noti)

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

Referenced by cloneFromSource().

131  : void
132  {
133  $this->user_id_noti = $a_user_id_noti;
134  }
+ Here is the caller graph for this function:

◆ setUserToggle()

ilForumNotification::setUserToggle ( bool  $a_user_toggle)

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

Referenced by cloneFromSource().

110  : void
111  {
112  $this->user_toggle = $a_user_toggle;
113  }
+ Here is the caller graph for this function:

◆ update()

ilForumNotification::update ( )

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

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

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  }
+ Here is the call graph for this function:

◆ updateInterestedEvents()

ilForumNotification::updateInterestedEvents ( )

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

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

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  }
+ Here is the call graph for this function:

◆ updateUserToggle()

ilForumNotification::updateUserToggle ( )

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

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

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  }
+ 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 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

◆ $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

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

Referenced by getForcedEventsObjectByUserId(), and getUserId().

◆ $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 getUserToggle().


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