ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilForumNotificationDataProvider Class Reference

Class ilForumNotificationDataProvider. More...

+ Inheritance diagram for ilForumNotificationDataProvider:
+ Collaboration diagram for ilForumNotificationDataProvider:

Public Member Functions

 __construct (public ilForumPost $objPost, protected int $ref_id, private readonly ilForumNotificationCache $notificationCache)
 
 getRefId ()
 
 getObjId ()
 
 getThreadId ()
 
 getPostId ()
 
 getForumId ()
 
 closestContainer ()
 
 providesClosestContainer ()
 
 getForumTitle ()
 
 getThreadTitle ()
 
 getPostTitle ()
 
 getPostMessage ()
 
 getPosDisplayUserId ()
 
 getPostDate ()
 
 getPostUpdate ()
 
 isPostCensored ()
 
 getPostCensoredDate ()
 
 getCensorshipComment ()
 
 getAttachments ()
 
 getPosUserAlias ()
 
 isAnonymized ()
 
 getImportName ()
 
 getPostUpdateUserId ()
 
 getPostUserName (ilLanguage $user_lang)
 
 getPostUpdateUserName (ilLanguage $user_lang)
 
 getPublicUserInformation (ilForumAuthorInformation $authorinfo)
 
 determineClosestContainer (int $frm_ref_id)
 
 getForumNotificationRecipients (int $notification_type)
 
 getThreadNotificationRecipients (int $notification_type)
 
 getPostActivationRecipients ()
 
 getPosAuthorId ()
 
 getDeletedBy ()
 

Data Fields

int $pos_author_id = 0
 

Protected Member Functions

 read ()
 

Protected Attributes

int $obj_id = 0
 
string $post_user_name = null
 
string $update_user_name = null
 
int $forum_id = 0
 
ilObject $closest_container = null
 
string $forum_title = ''
 
string $thread_title = ''
 
array $attachments = []
 
bool $is_anonymized = false
 

Private Member Functions

 readThreadTitle ()
 
 readForumData ()
 
 readAttachments ()
 
 getRefIdsByObjId (int $objId)
 
 createRecipientArray (ilDBStatement $statement)
 
 getEventType (int $notification_type)
 

Private Attributes

readonly ilDBInterface $db
 
readonly ilAccessHandler $access
 
readonly ilObjUser $user
 
readonly ilTree $tree
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilForumNotificationDataProvider::__construct ( public ilForumPost  $objPost,
protected int  $ref_id,
private readonly ilForumNotificationCache  $notificationCache 
)

Definition at line 44 of file class.ilForumNotificationDataProvider.php.

References $DIC, ilObject\_lookupObjId(), ILIAS\Repository\access(), read(), and ILIAS\Repository\user().

48  {
49  global $DIC;
50  $this->db = $DIC->database();
51  $this->access = $DIC->access();
52  $this->user = $DIC->user();
53  $this->tree = $DIC->repositoryTree();
54  $this->obj_id = ilObject::_lookupObjId($ref_id);
55  $this->read();
56  }
static _lookupObjId(int $ref_id)
$ref_id
Definition: ltiauth.php:65
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ closestContainer()

ilForumNotificationDataProvider::closestContainer ( )
Returns
ilObjCourse|ilObjGroup|null

Implements ilForumNotificationMailData.

Definition at line 83 of file class.ilForumNotificationDataProvider.php.

References $closest_container.

◆ createRecipientArray()

ilForumNotificationDataProvider::createRecipientArray ( ilDBStatement  $statement)
private
Returns
int[]

Definition at line 482 of file class.ilForumNotificationDataProvider.php.

References $refId, ILIAS\Repository\access(), getObjId(), getRefIdsByObjId(), and ILIAS\Repository\int().

Referenced by getForumNotificationRecipients(), and getThreadNotificationRecipients().

482  : array
483  {
484  $refIds = $this->getRefIdsByObjId($this->getObjId());
485 
486  $usrIds = [];
487  while ($row = $this->db->fetchAssoc($statement)) {
488  foreach ($refIds as $refId) {
489  if ($this->access->checkAccessOfUser((int) $row['user_id'], 'read', '', $refId)) {
490  $usrIds[] = (int) $row['user_id'];
491  }
492  }
493  }
494 
495  return $usrIds;
496  }
$refId
Definition: xapitoken.php:58
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determineClosestContainer()

ilForumNotificationDataProvider::determineClosestContainer ( int  $frm_ref_id)

Definition at line 292 of file class.ilForumNotificationDataProvider.php.

References $container, $ref_id, ilObjectFactory\getInstanceByRefId(), and null.

Referenced by readForumData().

292  : ?ilObject
293  {
294  $cacheKey = $this->notificationCache->createKeyByValues([
295  'forum_container',
296  $frm_ref_id
297  ]);
298 
299  if (!$this->notificationCache->exists($cacheKey)) {
300  $ref_id = $this->tree->checkForParentType($frm_ref_id, 'crs');
301  if ($ref_id <= 0) {
302  $ref_id = $this->tree->checkForParentType($frm_ref_id, 'grp');
303  }
304 
305  if ($ref_id > 0) {
307  $this->notificationCache->store($cacheKey, $container);
308  return $container;
309  }
310  }
311 
312  return null;
313  }
$container
Definition: wac.php:36
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$ref_id
Definition: ltiauth.php:65
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:

◆ getAttachments()

ilForumNotificationDataProvider::getAttachments ( )
Returns
array<string, string>

Implements ilForumNotificationMailData.

Definition at line 146 of file class.ilForumNotificationDataProvider.php.

References $attachments.

146  : array
147  {
148  return $this->attachments;
149  }

◆ getCensorshipComment()

ilForumNotificationDataProvider::getCensorshipComment ( )

Implements ilForumNotificationMailData.

Definition at line 138 of file class.ilForumNotificationDataProvider.php.

138  : string
139  {
140  return $this->objPost->getCensorshipComment();
141  }

◆ getDeletedBy()

ilForumNotificationDataProvider::getDeletedBy ( )

Implements ilForumNotificationMailData.

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

References ILIAS\Repository\user().

498  : string
499  {
500  if ($this->objPost->getUserAlias() && $this->objPost->getDisplayUserId() === 0
501  && $this->objPost->getPosAuthorId() === $this->user->getId()) {
502  return $this->objPost->getUserAlias();
503  }
504 
505  return $this->user->getLogin();
506  }
+ Here is the call graph for this function:

◆ getEventType()

ilForumNotificationDataProvider::getEventType ( int  $notification_type)
private

Definition at line 508 of file class.ilForumNotificationDataProvider.php.

References ilForumNotificationEvents\CENSORED, ilForumNotificationEvents\POST_DELETED, ilForumNotificationEvents\THREAD_DELETED, ilForumMailNotification\TYPE_POST_CENSORED, ilForumMailNotification\TYPE_POST_DELETED, ilForumMailNotification\TYPE_POST_UNCENSORED, ilForumMailNotification\TYPE_POST_UPDATED, ilForumMailNotification\TYPE_THREAD_DELETED, ilForumNotificationEvents\UNCENSORED, and ilForumNotificationEvents\UPDATED.

Referenced by getForumNotificationRecipients(), and getThreadNotificationRecipients().

508  : int
509  {
510  return match ($notification_type) {
516  default => 0,
517  };
518  }
+ Here is the caller graph for this function:

◆ getForumId()

ilForumNotificationDataProvider::getForumId ( )

Implements ilForumNotificationMailData.

Definition at line 78 of file class.ilForumNotificationDataProvider.php.

References $forum_id.

Referenced by getForumNotificationRecipients().

+ Here is the caller graph for this function:

◆ getForumNotificationRecipients()

ilForumNotificationDataProvider::getForumNotificationRecipients ( int  $notification_type)
Returns
int[]

Definition at line 333 of file class.ilForumNotificationDataProvider.php.

References $res, createRecipientArray(), getEventType(), getForumId(), and ILIAS\Repository\user().

Referenced by ilForumAppEventListener\delegateNotification().

333  : array
334  {
335  $event_type = $this->getEventType($notification_type);
336  $cacheKey = $this->notificationCache->createKeyByValues([
337  'forum',
338  $notification_type,
339  $this->getForumId(),
340  $this->user->getId()
341  ]);
342 
343  if (!$this->notificationCache->exists($cacheKey)) {
344  $condition = ' ';
345  if ($event_type === 0) {
346  $condition = ' OR frm_notification.interested_events >= ' . $this->db->quote(0, 'integer');
347  }
348 
349  $res = $this->db->queryF(
350  '
351  SELECT frm_notification.user_id FROM frm_notification, frm_data
352  WHERE frm_data.top_pk = %s
353  AND frm_notification.frm_id = frm_data.top_frm_fk
354  AND frm_notification.user_id != %s
355  AND (frm_notification.interested_events & %s ' . $condition . ')
356  GROUP BY frm_notification.user_id ',
357  ['integer', 'integer', 'integer'],
358  [$this->getForumId(), $this->user->getId(), $event_type]
359  );
360 
361  $rcps = $this->createRecipientArray($res);
362  $this->notificationCache->store($cacheKey, $rcps);
363  }
364 
365  $rcps = $this->notificationCache->fetch($cacheKey);
366 
367  return array_unique($rcps);
368  }
$res
Definition: ltiservices.php:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getForumTitle()

ilForumNotificationDataProvider::getForumTitle ( )

Implements ilForumNotificationMailData.

Definition at line 93 of file class.ilForumNotificationDataProvider.php.

References $forum_title.

93  : string
94  {
95  return $this->forum_title;
96  }

◆ getImportName()

ilForumNotificationDataProvider::getImportName ( )

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

Referenced by getPostUpdateUserName(), and getPostUserName().

161  : string
162  {
163  return $this->objPost->getImportName();
164  }
+ Here is the caller graph for this function:

◆ getObjId()

ilForumNotificationDataProvider::getObjId ( )

Implements ilForumNotificationMailData.

Definition at line 63 of file class.ilForumNotificationDataProvider.php.

References $obj_id.

Referenced by createRecipientArray(), readAttachments(), readForumData(), and readThreadTitle().

+ Here is the caller graph for this function:

◆ getPosAuthorId()

ilForumNotificationDataProvider::getPosAuthorId ( )

Implements ilForumNotificationMailData.

Definition at line 457 of file class.ilForumNotificationDataProvider.php.

References $pos_author_id.

Referenced by getPostUpdateUserName(), and getPostUserName().

457  : int
458  {
459  return $this->pos_author_id;
460  }
+ Here is the caller graph for this function:

◆ getPosDisplayUserId()

ilForumNotificationDataProvider::getPosDisplayUserId ( )

Implements ilForumNotificationMailData.

Definition at line 113 of file class.ilForumNotificationDataProvider.php.

Referenced by getPostUserName().

113  : int
114  {
115  return $this->objPost->getDisplayUserId();
116  }
+ Here is the caller graph for this function:

◆ getPostActivationRecipients()

ilForumNotificationDataProvider::getPostActivationRecipients ( )
Returns
int[]

Definition at line 439 of file class.ilForumNotificationDataProvider.php.

References ilForum\_getModerators(), and getRefId().

Referenced by ilForumAppEventListener\delegateNotification().

439  : array
440  {
441  $cacheKey = $this->notificationCache->createKeyByValues([
442  'post_activation',
443  $this->getRefId()
444  ]);
445 
446  if (!$this->notificationCache->exists($cacheKey)) {
447  // get moderators to notify about needed activation
448  $rcps = ilForum::_getModerators($this->getRefId());
449  $this->notificationCache->store($cacheKey, $rcps);
450  }
451 
452  $rcps = $this->notificationCache->fetch($cacheKey);
453 
454  return (array) $rcps;
455  }
static _getModerators(int $a_ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPostCensoredDate()

ilForumNotificationDataProvider::getPostCensoredDate ( )

Implements ilForumNotificationMailData.

Definition at line 133 of file class.ilForumNotificationDataProvider.php.

133  : string
134  {
135  return $this->objPost->getCensoredDate();
136  }

◆ getPostDate()

ilForumNotificationDataProvider::getPostDate ( )

Implements ilForumNotificationMailData.

Definition at line 118 of file class.ilForumNotificationDataProvider.php.

118  : string
119  {
120  return $this->objPost->getCreateDate();
121  }

◆ getPostId()

ilForumNotificationDataProvider::getPostId ( )

Implements ilForumNotificationMailData.

Definition at line 73 of file class.ilForumNotificationDataProvider.php.

73  : int
74  {
75  return $this->objPost->getId();
76  }

◆ getPostMessage()

ilForumNotificationDataProvider::getPostMessage ( )

Implements ilForumNotificationMailData.

Definition at line 108 of file class.ilForumNotificationDataProvider.php.

108  : string
109  {
110  return $this->objPost->getMessage();
111  }

◆ getPostTitle()

ilForumNotificationDataProvider::getPostTitle ( )

Implements ilForumNotificationMailData.

Definition at line 103 of file class.ilForumNotificationDataProvider.php.

103  : string
104  {
105  return $this->objPost->getSubject();
106  }

◆ getPostUpdate()

ilForumNotificationDataProvider::getPostUpdate ( )

Implements ilForumNotificationMailData.

Definition at line 123 of file class.ilForumNotificationDataProvider.php.

123  : string
124  {
125  return $this->objPost->getChangeDate();
126  }

◆ getPostUpdateUserId()

ilForumNotificationDataProvider::getPostUpdateUserId ( )

Implements ilForumNotificationMailData.

Definition at line 166 of file class.ilForumNotificationDataProvider.php.

Referenced by getPostUpdateUserName().

166  : int
167  {
168  return $this->objPost->getUpdateUserId();
169  }
+ Here is the caller graph for this function:

◆ getPostUpdateUserName()

ilForumNotificationDataProvider::getPostUpdateUserName ( ilLanguage  $user_lang)

Implements ilForumNotificationMailData.

Definition at line 188 of file class.ilForumNotificationDataProvider.php.

References $update_user_name, getImportName(), getPosAuthorId(), getPostUpdateUserId(), getPosUserAlias(), getPublicUserInformation(), and null.

188  : string
189  {
190  if ($this->update_user_name === null) {
191  $authorinfo = new ilForumAuthorInformation(
192  $this->getPosAuthorId(),
193  $this->getPostUpdateUserId(),
194  $this->getPosUserAlias(),
195  $this->getImportName(),
196  [],
197  $user_lang
198  );
199  $this->update_user_name = $this->getPublicUserInformation($authorinfo);
200  }
201 
202  // Possible Fix for #25432
203  if ($this->objPost->getUserAlias() && $this->objPost->getDisplayUserId() === 0
204  && $this->objPost->getPosAuthorId() === $this->objPost->getUpdateUserId()) {
205  return $this->objPost->getUserAlias();
206  }
207 
209  }
getPublicUserInformation(ilForumAuthorInformation $authorinfo)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getPostUserName()

ilForumNotificationDataProvider::getPostUserName ( ilLanguage  $user_lang)

Implements ilForumNotificationMailData.

Definition at line 171 of file class.ilForumNotificationDataProvider.php.

References $post_user_name, getImportName(), getPosAuthorId(), getPosDisplayUserId(), getPosUserAlias(), getPublicUserInformation(), and null.

171  : string
172  {
173  if ($this->post_user_name === null) {
174  $authorinfo = new ilForumAuthorInformation(
175  $this->getPosAuthorId(),
176  $this->getPosDisplayUserId(),
177  $this->getPosUserAlias(),
178  $this->getImportName(),
179  [],
180  $user_lang
181  );
182  $this->post_user_name = $this->getPublicUserInformation($authorinfo);
183  }
184 
185  return $this->post_user_name;
186  }
getPublicUserInformation(ilForumAuthorInformation $authorinfo)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getPosUserAlias()

ilForumNotificationDataProvider::getPosUserAlias ( )

Implements ilForumNotificationMailData.

Definition at line 151 of file class.ilForumNotificationDataProvider.php.

Referenced by getPostUpdateUserName(), and getPostUserName().

151  : string
152  {
153  return $this->objPost->getUserAlias();
154  }
+ Here is the caller graph for this function:

◆ getPublicUserInformation()

ilForumNotificationDataProvider::getPublicUserInformation ( ilForumAuthorInformation  $authorinfo)

Definition at line 211 of file class.ilForumNotificationDataProvider.php.

References ilForumAuthorInformation\getAuthorName(), ilForumAuthorInformation\getAuthorShortName(), ilForumAuthorInformation\hasSuffix(), and isAnonymized().

Referenced by getPostUpdateUserName(), and getPostUserName().

211  : string
212  {
213  if ($authorinfo->hasSuffix()) {
214  $public_name = $authorinfo->getAuthorName();
215  } else {
216  $public_name = $authorinfo->getAuthorShortName();
217 
218  if ($authorinfo->getAuthorName() && !$this->isAnonymized()) {
219  $public_name = $authorinfo->getAuthorName();
220  }
221  }
222 
223  return $public_name;
224  }
getAuthorName(bool $without_short_name=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRefId()

ilForumNotificationDataProvider::getRefId ( )

Implements ilForumNotificationMailData.

Definition at line 58 of file class.ilForumNotificationDataProvider.php.

References $ref_id.

Referenced by getPostActivationRecipients(), and readForumData().

58  : int
59  {
60  return $this->ref_id;
61  }
$ref_id
Definition: ltiauth.php:65
+ Here is the caller graph for this function:

◆ getRefIdsByObjId()

ilForumNotificationDataProvider::getRefIdsByObjId ( int  $objId)
private
Returns
int[]

Definition at line 465 of file class.ilForumNotificationDataProvider.php.

References ilObject\_getAllReferences().

Referenced by createRecipientArray().

465  : array
466  {
467  $cacheKey = $this->notificationCache->createKeyByValues([
468  'refs_by_obj_id',
469  $objId
470  ]);
471 
472  if (!$this->notificationCache->exists($cacheKey)) {
473  $this->notificationCache->store($cacheKey, ilObject::_getAllReferences($objId));
474  }
475 
476  return $this->notificationCache->fetch($cacheKey);
477  }
static _getAllReferences(int $id)
get all reference ids for object ID
$objId
Definition: xapitoken.php:57
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getThreadId()

ilForumNotificationDataProvider::getThreadId ( )

Implements ilForumNotificationMailData.

Definition at line 68 of file class.ilForumNotificationDataProvider.php.

Referenced by getThreadNotificationRecipients().

68  : int
69  {
70  return $this->objPost->getThreadId();
71  }
+ Here is the caller graph for this function:

◆ getThreadNotificationRecipients()

ilForumNotificationDataProvider::getThreadNotificationRecipients ( int  $notification_type)
Returns
int[]

Definition at line 373 of file class.ilForumNotificationDataProvider.php.

References $res, createRecipientArray(), getEventType(), ilForumPost\getPosAuthorId(), getThreadId(), and ILIAS\Repository\user().

Referenced by ilForumAppEventListener\delegateNotification().

373  : array
374  {
375  if ($this->getThreadId() === 0) {
376  return [];
377  }
378 
379  $event_type = $this->getEventType($notification_type);
380  $cacheKey = $this->notificationCache->createKeyByValues([
381  'thread',
382  $notification_type,
383  $this->getThreadId(),
384  $this->user->getId()
385  ]);
386 
387  if (!$this->notificationCache->exists($cacheKey)) {
388  $condition = ' ';
389  if ($event_type === 0) {
390  $condition = ' OR interested_events >= ' . $this->db->quote(0, 'integer');
391  }
392 
393  $res = $this->db->queryF(
394  '
395  SELECT frm_notification.user_id
396  FROM frm_notification
397  INNER JOIN frm_threads ON frm_threads.thr_pk = frm_notification.thread_id
398  WHERE frm_notification.thread_id = %s
399  AND frm_notification.user_id != %s
400  AND (frm_notification.interested_events & %s ' . $condition . ')',
401  ['integer', 'integer', 'integer'],
402  [$this->getThreadId(), $this->user->getId(), $event_type]
403  );
404 
405  $usrIds = $this->createRecipientArray($res);
406  $this->notificationCache->store($cacheKey, $usrIds);
407  }
408 
409  return (array) $this->notificationCache->fetch($cacheKey);
410  }
$res
Definition: ltiservices.php:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getThreadTitle()

ilForumNotificationDataProvider::getThreadTitle ( )

Implements ilForumNotificationMailData.

Definition at line 98 of file class.ilForumNotificationDataProvider.php.

References $thread_title.

98  : string
99  {
100  return $this->thread_title;
101  }

◆ isAnonymized()

ilForumNotificationDataProvider::isAnonymized ( )

Definition at line 156 of file class.ilForumNotificationDataProvider.php.

References $is_anonymized.

Referenced by getPublicUserInformation().

156  : bool
157  {
158  return $this->is_anonymized;
159  }
+ Here is the caller graph for this function:

◆ isPostCensored()

ilForumNotificationDataProvider::isPostCensored ( )

Implements ilForumNotificationMailData.

Definition at line 128 of file class.ilForumNotificationDataProvider.php.

128  : bool
129  {
130  return $this->objPost->isCensored();
131  }

◆ providesClosestContainer()

ilForumNotificationDataProvider::providesClosestContainer ( )

Implements ilForumNotificationMailData.

Definition at line 88 of file class.ilForumNotificationDataProvider.php.

References null.

88  : bool
89  {
90  return $this->closest_container !== null;
91  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ read()

ilForumNotificationDataProvider::read ( )
protected

Definition at line 226 of file class.ilForumNotificationDataProvider.php.

References readAttachments(), readForumData(), and readThreadTitle().

Referenced by __construct().

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

◆ readAttachments()

ilForumNotificationDataProvider::readAttachments ( )
private

Definition at line 315 of file class.ilForumNotificationDataProvider.php.

References ANONYMOUS_USER_ID, ilFileDataForum\getFilesOfPost(), getObjId(), and ilForumProperties\isSendAttachmentsByMailEnabled().

Referenced by read().

315  : void
316  {
318  $fileDataForum = new ilFileDataForum($this->getObjId(), $this->objPost->getId());
319  $filesOfPost = $fileDataForum->getFilesOfPost();
320 
321  $fileDataMail = new ilFileDataMail(ANONYMOUS_USER_ID);
322 
323  foreach ($filesOfPost as $attachment) {
324  $this->attachments[$attachment['path']] = $attachment['name'];
325  $fileDataMail->copyAttachmentFile($attachment['path'], $attachment['name']);
326  }
327  }
328  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
This class handles all operations on files (attachments) in directory ilias_data/mail.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readForumData()

ilForumNotificationDataProvider::readForumData ( )
private

Definition at line 257 of file class.ilForumNotificationDataProvider.php.

References $container, determineClosestContainer(), getObjId(), getRefId(), ILIAS\Repository\int(), and null.

Referenced by read().

257  : void
258  {
259  $cacheKey = $this->notificationCache->createKeyByValues([
260  'forum_data',
261  $this->getObjId()
262  ]);
263 
264  if (!$this->notificationCache->exists($cacheKey)) {
265  $result = $this->db->queryF(
266  '
267  SELECT top_pk, top_name, frm_settings.anonymized FROM frm_data
268  INNER JOIN frm_settings ON top_frm_fk = frm_settings.obj_id
269  WHERE top_frm_fk = %s',
270  ['integer'],
271  [$this->getObjId()]
272  );
273 
274  $row = $this->db->fetchAssoc($result);
275 
276  $container = $this->determineClosestContainer($this->getRefId());
277  if ($container instanceof ilObjCourse || $container instanceof ilObjGroup) {
278  $row['closest_container'] = $container;
279  }
280 
281  $this->notificationCache->store($cacheKey, $row);
282  }
283 
284  $row ??= $this->notificationCache->fetch($cacheKey);
285  $this->forum_id = (int) $row['top_pk'];
286  $this->forum_title = (string) $row['top_name'];
287  $this->closest_container = $row['closest_container'] ?? null;
288 
289  $this->is_anonymized = (bool) $row['anonymized'];
290  }
$container
Definition: wac.php:36
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilObjGroup.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readThreadTitle()

ilForumNotificationDataProvider::readThreadTitle ( )
private

Definition at line 233 of file class.ilForumNotificationDataProvider.php.

References getObjId().

Referenced by read().

233  : void
234  {
235  $cacheKey = $this->notificationCache->createKeyByValues([
236  'thread_title',
237  $this->getObjId()
238  ]);
239 
240  if (!$this->notificationCache->exists($cacheKey)) {
241  $result = $this->db->queryF(
242  '
243  SELECT thr_subject FROM frm_threads
244  WHERE thr_pk = %s',
245  ['integer'],
246  [$this->objPost->getThreadId()]
247  );
248 
249  $row = $this->db->fetchAssoc($result);
250  $this->notificationCache->store($cacheKey, $row);
251  }
252 
253  $row = $this->notificationCache->fetch($cacheKey);
254  $this->thread_title = $row['thr_subject'];
255  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

readonly ilAccessHandler ilForumNotificationDataProvider::$access
private

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

◆ $attachments

array ilForumNotificationDataProvider::$attachments = []
protected

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

Referenced by getAttachments().

◆ $closest_container

ilObject ilForumNotificationDataProvider::$closest_container = null
protected

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

Referenced by closestContainer().

◆ $db

readonly ilDBInterface ilForumNotificationDataProvider::$db
private

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

◆ $forum_id

int ilForumNotificationDataProvider::$forum_id = 0
protected

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

Referenced by getForumId().

◆ $forum_title

string ilForumNotificationDataProvider::$forum_title = ''
protected

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

Referenced by getForumTitle().

◆ $is_anonymized

bool ilForumNotificationDataProvider::$is_anonymized = false
protected

Definition at line 42 of file class.ilForumNotificationDataProvider.php.

Referenced by isAnonymized().

◆ $obj_id

int ilForumNotificationDataProvider::$obj_id = 0
protected

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

Referenced by getObjId().

◆ $pos_author_id

int ilForumNotificationDataProvider::$pos_author_id = 0

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

Referenced by getPosAuthorId().

◆ $post_user_name

string ilForumNotificationDataProvider::$post_user_name = null
protected

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

Referenced by getPostUserName().

◆ $thread_title

string ilForumNotificationDataProvider::$thread_title = ''
protected

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

Referenced by getThreadTitle().

◆ $tree

readonly ilTree ilForumNotificationDataProvider::$tree
private

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

◆ $update_user_name

string ilForumNotificationDataProvider::$update_user_name = null
protected

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

Referenced by getPostUpdateUserName().

◆ $user

readonly ilObjUser ilForumNotificationDataProvider::$user
private

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


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