ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilForumNotification Class Reference

Class ilForumNotification. More...

+ Collaboration diagram for ilForumNotification:

Public Member Functions

 __construct (private 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 (int $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

readonly ilDBInterface $db
 
readonly 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 $user_id_noti
 

Static Private Attributes

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

Detailed Description

Class ilForumNotification.

Author
Nadia Matuschek nmatu.nosp@m.sche.nosp@m.k@dat.nosp@m.abay.nosp@m..de
Version
$Id:$ \

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

Constructor & Destructor Documentation

◆ __construct()

ilForumNotification::__construct ( private int  $ref_id)

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

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

46  {
47  global $DIC;
48 
49  $this->db = $DIC->database();
50  $this->user = $DIC->user();
51  $this->forum_id = $DIC['ilObjDataCache']->lookupObjId($ref_id);
52  }
$ref_id
Definition: ltiauth.php:65
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ _clearForcedForumNotifications()

static ilForumNotification::_clearForcedForumNotifications ( array  $move_tree_event)
static

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

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

351  : void
352  {
353  global $DIC;
354  $ilDB = $DIC->database();
355  $ilObjDataCache = $DIC['ilObjDataCache'];
356 
357  if ($move_tree_event['tree'] !== 'tree') {
358  return;
359  }
360 
361  $ref_id = (int) $move_tree_event['source_id'];
362  $is_parent = self::_isParentNodeGrpCrs($ref_id);
363 
364  if ($is_parent) {
365  $forum_id = $ilObjDataCache->lookupObjId($ref_id);
366 
367  $ilDB->manipulateF(
368  'DELETE FROM frm_notification WHERE frm_id = %s AND admin_force_noti = %s',
369  ['integer', 'integer'],
370  [$forum_id, 1]
371  );
372  }
373  }
$ref_id
Definition: ltiauth.php:65
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ _isParentNodeGrpCrs()

static ilForumNotification::_isParentNodeGrpCrs ( int  $a_ref_id)
static

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

References $DIC, and ilObjectFactory\getInstanceByRefId().

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

341  : bool
342  {
343  global $DIC;
344 
345  $parent_ref_id = $DIC->repositoryTree()->getParentId($a_ref_id);
346  $parent_obj = ilObjectFactory::getInstanceByRefId($parent_ref_id);
347 
348  return $parent_obj->getType() === 'crs' || $parent_obj->getType() === 'grp';
349  }
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
global $DIC
Definition: shib_login.php:22
+ 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 282 of file class.ilForumNotification.php.

References $data, and $DIC.

Referenced by ilMembershipBlockGUI\confirmedRemove(), and ilDashboardLearningSequenceGUI\confirmedRemove().

282  : void
283  {
284  global $DIC;
285 
286  $ilUser = $DIC->user();
287 
288  $node_data = self::getCachedNodeData($ref_id);
289 
290  foreach ($node_data as $data) {
291  $frm_noti = new ilForumNotification((int) $data['ref_id']);
292  $objFrmMods = new ilForumModerators((int) $data['ref_id']);
293  $moderator_ids = $objFrmMods->getCurrentModerators();
294 
295  if ($user_id !== 0) {
296  $frm_noti->setUserId($user_id);
297  } else {
298  $frm_noti->setUserId($ilUser->getId());
299  }
300 
301  $frm_noti->setForumId((int) $data['obj_id']);
302  if (!in_array($frm_noti->getUserId(), $moderator_ids, true)) {
303  $frm_noti->deleteAdminForce();
304  }
305  }
306  }
Class ilForumNotification.
$ref_id
Definition: ltiauth.php:65
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ checkForumsExistsInsert()

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

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

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

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

247  : void
248  {
249  global $DIC;
250 
251  $ilUser = $DIC->user();
252 
253  $node_data = self::getCachedNodeData($ref_id);
254 
255  foreach ($node_data as $data) {
256  //check frm_properties if frm_noti is enabled
257  $frm_noti = new ilForumNotification((int) $data['ref_id']);
258  if ($user_id !== 0) {
259  $frm_noti->setUserId($user_id);
260  } else {
261  $frm_noti->setUserId($ilUser->getId());
262  }
263 
264  $admin_force = ilForumProperties::_isAdminForceNoti((int) $data['obj_id']);
265  $frm_noti->setAdminForce($admin_force);
266 
267  $user_toggle = ilForumProperties::_isUserToggleNoti((int) $data['obj_id']);
268  if ($user_toggle) {
269  $frm_noti->setAdminForce(true);
270  }
271 
272  if ($admin_force || $user_toggle) {
273  $frm_noti->setUserToggle($user_toggle);
274  $frm_noti->setForumId((int) $data['obj_id']);
275  if (!$frm_noti->existsNotification()) {
276  $frm_noti->insertAdminForce();
277  }
278  }
279  }
280  }
Class ilForumNotification.
static _isAdminForceNoti(int $a_obj_id)
$ref_id
Definition: ltiauth.php:65
global $DIC
Definition: shib_login.php:22
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 473 of file class.ilForumNotification.php.

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

473  : void
474  {
475  $sourceNotificationSettings = new self($sourceRefId);
476  $records = $sourceNotificationSettings->read();
477 
478  foreach ($records as $usrId => $row) {
479  $this->setUserId($usrId);
480  $this->setAdminForce((bool) $row['admin_force_noti']);
481  $this->setUserToggle((bool) $row['user_toggle_noti']);
482  $this->setUserIdNoti((int) $row['user_id_noti']);
483  $this->setInterestedEvents((int) $row['interested_events']);
484 
485  $this->insertAdminForce();
486  }
487  }
setUserToggle(bool $a_user_toggle)
setAdminForce(bool $a_admin_force)
setInterestedEvents(int $interested_events)
setUserIdNoti(int $a_user_id_noti)
+ Here is the call graph for this function:

◆ createMissingNotification()

ilForumNotification::createMissingNotification ( int  $user_id)
private

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

References $ref_id.

Referenced by getForcedEventsObjectByUserId().

555  : self
556  {
557  $new_object = new self($this->ref_id);
558  $new_object->setUserId($user_id);
559  $new_object->setForumId($this->forum_id);
560  $new_object->insertAdminForce();
561 
562  return $new_object;
563  }
$ref_id
Definition: ltiauth.php:65
+ Here is the caller graph for this function:

◆ deleteAdminForce()

ilForumNotification::deleteAdminForce ( )

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

References getForumId(), and getUserId().

205  : void
206  {
207  $this->db->manipulateF(
208  '
209  DELETE FROM frm_notification
210  WHERE user_id = %s
211  AND frm_id = %s
212  AND admin_force_noti = %s
213  AND user_id_noti > %s',
214  ['integer', 'integer', 'integer', 'integer'],
215  [(int) $this->getUserId(), $this->getForumId(), 1, 0]
216  );
217  }
+ Here is the call graph for this function:

◆ deleteNotificationAllUsers()

ilForumNotification::deleteNotificationAllUsers ( )

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

References getForumId().

Referenced by ilForumSettingsGUI\updateNotificationSettings().

391  : void
392  {
393  $this->db->manipulateF(
394  'DELETE FROM frm_notification WHERE frm_id = %s AND user_id_noti > %s',
395  ['integer', 'integer'],
396  [$this->getForumId(), 0]
397  );
398  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteUserToggle()

ilForumNotification::deleteUserToggle ( )

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

References getForumId(), and getUserId().

219  : void
220  {
221  $this->db->manipulateF(
222  '
223  DELETE FROM frm_notification
224  WHERE user_id = %s
225  AND frm_id = %s
226  AND admin_force_noti = %s
227  AND user_toggle_noti = %s
228  AND user_id_noti > %s',
229  ['integer', 'integer', 'integer', 'integer', 'integer'],
230  [(int) $this->getUserId(), $this->getForumId(), 1, 1, 0]
231  );
232  }
+ Here is the call graph for this function:

◆ existsNotification()

ilForumNotification::existsNotification ( )

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

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

462  : bool
463  {
464  $res = $this->db->queryF(
465  'SELECT user_id FROM frm_notification WHERE user_id = %s AND frm_id = %s AND admin_force_noti = %s',
466  ['integer', 'integer', 'integer'],
467  [(int) $this->getUserId(), $this->getForumId(), (int) $this->getAdminForce()]
468  );
469 
470  return $this->db->numRows($res) > 0;
471  }
$res
Definition: ltiservices.php:66
+ Here is the call graph for this function:

◆ getAdminForce()

ilForumNotification::getAdminForce ( )

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

References $admin_force.

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

109  : bool
110  {
111  return $this->admin_force;
112  }
+ Here is the caller graph for this function:

◆ getCachedNodeData()

static ilForumNotification::getCachedNodeData ( int  $ref_id)
static

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

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

308  : array
309  {
310  global $DIC;
311 
312  if (!array_key_exists($ref_id, self::$node_data_cache)) {
313  $container_node = $DIC->repositoryTree()->getNodeData($ref_id);
314  if (!isset($container_node['child'])) {
315  return [];
316  }
317 
318  $node_data = $DIC->repositoryTree()->getSubTree(
319  $container_node,
320  true,
321  ['frm']
322  );
323  $node_data = array_filter($node_data, static function (array $forum_node) use ($DIC, $ref_id): bool {
324  // filter out forum if a grp lies in the path (#0027702)
325  foreach ($DIC->repositoryTree()->getNodePath((int) $forum_node['child'], $ref_id) as $path_node) {
326  $notRootNode = (int) $path_node['child'] !== $ref_id;
327  $isGroup = $path_node['type'] === 'grp';
328  if ($notRootNode && $isGroup) {
329  return false;
330  }
331  }
332 
333  return true;
334  });
335  self::$node_data_cache[$ref_id] = $node_data;
336  }
337 
338  return self::$node_data_cache[$ref_id];
339  }
$ref_id
Definition: ltiauth.php:65
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ getForcedEventsObjectByUserId()

ilForumNotification::getForcedEventsObjectByUserId ( int  $user_id)

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

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

542  : self
543  {
544  if (!isset(self::$forced_events_cache[$user_id])) {
545  $this->readAllForcedEvents();
546  }
547 
548  if (!isset(self::$forced_events_cache[$user_id])) {
549  self::$forced_events_cache[$user_id] = $this->createMissingNotification($user_id);
550  }
551 
552  return self::$forced_events_cache[$user_id];
553  }
+ Here is the call graph for this function:

◆ getForumId()

◆ getForumRefId()

ilForumNotification::getForumRefId ( )

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

References $ref_id.

129  : int
130  {
131  return $this->ref_id;
132  }
$ref_id
Definition: ltiauth.php:65

◆ getInterestedEvents()

ilForumNotification::getInterestedEvents ( )

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

References $interested_events.

Referenced by update(), and updateInterestedEvents().

99  : int
100  {
102  }
+ Here is the caller graph for this function:

◆ getNotificationId()

ilForumNotification::getNotificationId ( )

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

References $notification_id.

59  : int
60  {
62  }

◆ getThreadId()

ilForumNotification::getThreadId ( )

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

References $thread_id.

89  : int
90  {
91  return $this->thread_id;
92  }

◆ getUserId()

ilForumNotification::getUserId ( )

◆ getUserIdNoti()

ilForumNotification::getUserIdNoti ( )

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

References $user_id_noti.

141  : int
142  {
143  return $this->user_id_noti;
144  }

◆ getUserToggle()

ilForumNotification::getUserToggle ( )

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

References $user_toggle.

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

119  : bool
120  {
121  return $this->user_toggle;
122  }
+ Here is the caller graph for this function:

◆ insertAdminForce()

ilForumNotification::insertAdminForce ( )

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

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

Referenced by cloneFromSource().

183  : void
184  {
185  $next_id = $this->db->nextId('frm_notification');
186  $this->setNotificationId($next_id);
187 
188  $this->db->manipulateF(
189  '
190  INSERT INTO frm_notification
191  (notification_id, user_id, frm_id, admin_force_noti, user_toggle_noti, user_id_noti)
192  VALUES(%s, %s, %s, %s, %s, %s)',
193  ['integer', 'integer', 'integer', 'integer', 'integer', 'integer'],
194  [
195  $next_id,
196  (int) $this->getUserId(),
197  $this->getForumId(),
198  $this->getAdminForce(),
199  $this->getUserToggle(),
200  $this->user->getId()
201  ]
202  );
203  }
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 146 of file class.ilForumNotification.php.

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

146  : bool
147  {
148  $res = $this->db->queryF(
149  '
150  SELECT admin_force_noti FROM frm_notification
151  WHERE user_id = %s
152  AND frm_id = %s
153  AND user_id_noti > %s ',
154  ['integer', 'integer', 'integer'],
155  [(int) $this->getUserId(), $this->getForumId(), 0]
156  );
157 
158  if ($row = $this->db->fetchAssoc($res)) {
159  return (bool) $row['admin_force_noti'];
160  }
161 
162  return false;
163  }
$res
Definition: ltiservices.php:66
+ Here is the call graph for this function:

◆ isUserToggleNotification()

ilForumNotification::isUserToggleNotification ( )

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

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

165  : bool
166  {
167  $res = $this->db->queryF(
168  '
169  SELECT user_toggle_noti FROM frm_notification
170  WHERE user_id = %s
171  AND frm_id = %s
172  AND user_id_noti > %s',
173  ['integer', 'integer', 'integer'],
174  [(int) $this->getUserId(), $this->getForumId(), 0]
175  );
176 
177  if ($row = $this->db->fetchAssoc($res)) {
178  return (bool) $row['user_toggle_noti'];
179  }
180  return false;
181  }
$res
Definition: ltiservices.php:66
+ Here is the call graph for this function:

◆ mergeThreadNotifications()

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

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

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

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

422  : void
423  {
424  global $DIC;
425 
426  $ilDB = $DIC->database();
427 
428  $res = $ilDB->queryF(
429  'SELECT notification_id, user_id FROM frm_notification WHERE frm_id = %s AND thread_id = %s ORDER BY user_id ASC',
430  ['integer', 'integer'],
431  [0, $merge_source_thread_id]
432  );
433 
434  $res_2 = $ilDB->queryF(
435  'SELECT DISTINCT user_id FROM frm_notification WHERE frm_id = %s AND thread_id = %s ORDER BY user_id ASC',
436  ['integer', 'integer'],
437  [0, $merge_target_thread_id]
438  );
439 
440  $users_already_notified = [];
441  while ($users_row = $ilDB->fetchAssoc($res_2)) {
442  $users_already_notified[(int) $users_row['user_id']] = (int) $users_row['user_id'];
443  }
444 
445  while ($row = $ilDB->fetchAssoc($res)) {
446  if (isset($users_already_notified[(int) $row['user_id']])) {
447  $ilDB->manipulateF(
448  'DELETE FROM frm_notification WHERE notification_id = %s',
449  ['integer'],
450  [$row['notification_id']]
451  );
452  } else {
453  $ilDB->update(
454  'frm_notification',
455  ['thread_id' => ['integer', $merge_target_thread_id]],
456  ['thread_id' => ['integer', $merge_source_thread_id]]
457  );
458  }
459  }
460  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ 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 403 of file class.ilForumNotification.php.

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

403  : array
404  {
405  $result = [];
406 
407  $res = $this->db->queryF('SELECT * FROM frm_notification WHERE frm_id = %s', ['integer'], [$this->getForumId()]);
408  while ($row = $this->db->fetchAssoc($res)) {
409  $result[(int) $row['user_id']]['notification_id'] = (int) $row['notification_id'];
410  $result[(int) $row['user_id']]['user_id'] = (int) $row['user_id'];
411  $result[(int) $row['user_id']]['frm_id'] = (int) $row['frm_id'];
412  $result[(int) $row['user_id']]['thread_id'] = (int) $row['thread_id'];
413  $result[(int) $row['user_id']]['admin_force_noti'] = (int) $row['admin_force_noti'];
414  $result[(int) $row['user_id']]['user_toggle_noti'] = (int) $row['user_toggle_noti'];
415  $result[(int) $row['user_id']]['interested_events'] = (int) $row['interested_events'];
416  $result[(int) $row['user_id']]['user_id_noti'] = (int) $row['user_id_noti'];
417  }
418 
419  return $result;
420  }
$res
Definition: ltiservices.php:66
+ Here is the call graph for this function:

◆ readAllForcedEvents()

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

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

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

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

519  : array
520  {
521  $res = $this->db->queryF(
522  'SELECT * FROM frm_notification WHERE admin_force_noti = %s AND frm_id = %s',
523  ['integer', 'integer'],
524  [1, $this->forum_id]
525  );
526 
527  while ($row = $this->db->fetchAssoc($res)) {
528  $notificationConfig = new self($this->ref_id);
529  $notificationConfig->setNotificationId((int) $row['notification_id']);
530  $notificationConfig->setUserId((int) $row['user_id']);
531  $notificationConfig->setForumId((int) $row['frm_id']);
532  $notificationConfig->setAdminForce((bool) $row['admin_force_noti']);
533  $notificationConfig->setUserToggle((bool) $row['user_toggle_noti']);
534  $notificationConfig->setInterestedEvents((int) $row['interested_events']);
535 
536  self::$forced_events_cache[(int) $row['user_id']] = $notificationConfig;
537  }
538 
539  return self::$forced_events_cache;
540  }
$res
Definition: ltiservices.php:66
$ref_id
Definition: ltiauth.php:65
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readInterestedEvents()

ilForumNotification::readInterestedEvents ( )

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

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

498  : int
499  {
501 
502  $this->db->setLimit(1);
503  $res = $this->db->queryF(
504  'SELECT interested_events FROM frm_notification WHERE user_id = %s AND frm_id = %s',
505  ['integer', 'integer'],
506  [(int) $this->getUserId(), $this->getForumId()]
507  );
508 
509  while ($row = $this->db->fetchAssoc($res)) {
510  $interested_events = (int) $row['interested_events'];
511  }
512 
513  return $interested_events;
514  }
$res
Definition: ltiservices.php:66
+ Here is the call graph for this function:

◆ setAdminForce()

ilForumNotification::setAdminForce ( bool  $a_admin_force)

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

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

104  : void
105  {
106  $this->admin_force = $a_admin_force;
107  }
+ Here is the caller graph for this function:

◆ setForumId()

ilForumNotification::setForumId ( int  $a_forum_id)

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

74  : void
75  {
76  $this->forum_id = $a_forum_id;
77  }

◆ setForumRefId()

ilForumNotification::setForumRefId ( int  $a_ref_id)

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

124  : void
125  {
126  $this->ref_id = $a_ref_id;
127  }

◆ setInterestedEvents()

ilForumNotification::setInterestedEvents ( int  $interested_events)

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

References $interested_events.

Referenced by cloneFromSource().

94  : void
95  {
96  $this->interested_events = $interested_events;
97  }
+ Here is the caller graph for this function:

◆ setNotificationId()

ilForumNotification::setNotificationId ( int  $a_notification_id)

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

Referenced by insertAdminForce().

54  : void
55  {
56  $this->notification_id = $a_notification_id;
57  }
+ Here is the caller graph for this function:

◆ setThreadId()

ilForumNotification::setThreadId ( int  $a_thread_id)

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

84  : void
85  {
86  $this->thread_id = $a_thread_id;
87  }

◆ setUserId()

◆ setUserIdNoti()

ilForumNotification::setUserIdNoti ( int  $a_user_id_noti)

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

Referenced by cloneFromSource().

135  : void
136  {
137  $this->user_id_noti = $a_user_id_noti;
138  }
+ Here is the caller graph for this function:

◆ setUserToggle()

ilForumNotification::setUserToggle ( bool  $a_user_toggle)

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

Referenced by cloneFromSource().

114  : void
115  {
116  $this->user_toggle = $a_user_toggle;
117  }
+ Here is the caller graph for this function:

◆ update()

ilForumNotification::update ( )

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

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

375  : void
376  {
377  $this->db->manipulateF(
378  'UPDATE frm_notification SET admin_force_noti = %s, user_toggle_noti = %s, ' .
379  'interested_events = %s WHERE user_id = %s AND frm_id = %s',
380  ['integer', 'integer', 'integer', 'integer', 'integer'],
381  [
382  (int) $this->getAdminForce(),
383  (int) $this->getUserToggle(),
384  $this->getInterestedEvents(),
385  (int) $this->getUserId(),
386  $this->getForumId()
387  ]
388  );
389  }
+ Here is the call graph for this function:

◆ updateInterestedEvents()

ilForumNotification::updateInterestedEvents ( )

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

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

489  : void
490  {
491  $this->db->manipulateF(
492  'UPDATE frm_notification SET interested_events = %s WHERE user_id = %s AND frm_id = %s',
493  ['integer', 'integer', 'integer'],
494  [$this->getInterestedEvents(), (int) $this->getUserId(), $this->getForumId()]
495  );
496  }
+ Here is the call graph for this function:

◆ updateUserToggle()

ilForumNotification::updateUserToggle ( )

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

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

234  : void
235  {
236  $this->db->manipulateF(
237  'UPDATE frm_notification SET user_toggle_noti = %s WHERE user_id = %s AND frm_id = %s AND admin_force_noti = %s',
238  ['integer', 'integer', 'integer', 'integer'],
239  [$this->getUserToggle(), (int) $this->getUserId(), $this->getForumId(), 1]
240  );
241  }
+ Here is the call graph for this function:

Field Documentation

◆ $admin_force

bool ilForumNotification::$admin_force = false
private

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

Referenced by getAdminForce().

◆ $db

readonly ilDBInterface ilForumNotification::$db
private

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

◆ $forced_events_cache

array ilForumNotification::$forced_events_cache = []
staticprivate

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

◆ $forum_id

int ilForumNotification::$forum_id
private

Definition at line 38 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 30 of file class.ilForumNotification.php.

◆ $notification_id

int ilForumNotification::$notification_id
private

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

Referenced by getNotificationId().

◆ $thread_id

int ilForumNotification::$thread_id
private

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

Referenced by getThreadId().

◆ $user

readonly ilObjUser ilForumNotification::$user
private

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

◆ $user_id

int ilForumNotification::$user_id = null
private

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

Referenced by getForcedEventsObjectByUserId(), and getUserId().

◆ $user_id_noti

int ilForumNotification::$user_id_noti
private

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

Referenced by getUserIdNoti().

◆ $user_toggle

bool ilForumNotification::$user_toggle = false
private

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

Referenced by getUserToggle().


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