ILIAS  release_8 Revision v8.24
ilForumNotificationDataProvider Class Reference

Class ilForumNotificationDataProvider. More...

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

Public Member Functions

 __construct (ilForumPost $objPost, int $ref_id, 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 ()
 
 setPosAuthorId (int $pos_author_id)
 
 getPosAuthorId ()
 
 getDeletedBy ()
 
 getRefId ()
 
 getObjId ()
 
 getForumId ()
 
 closestContainer ()
 
 providesClosestContainer ()
 
 getForumTitle ()
 
 getThreadId ()
 
 getThreadTitle ()
 
 getPostId ()
 
 getPostTitle ()
 
 getPostMessage ()
 
 getPosAuthorId ()
 
 getPostUpdateUserId ()
 
 getPosDisplayUserId ()
 
 getPosUserAlias ()
 
 getPostUserName (ilLanguage $user_lang)
 
 getPostDate ()
 
 getPostUpdate ()
 
 getPostUpdateUserName (ilLanguage $user_lang)
 
 isPostCensored ()
 
 getPostCensoredDate ()
 
 getCensorshipComment ()
 
 getAttachments ()
 
 getDeletedBy ()
 

Data Fields

int $pos_author_id = 0
 
ilForumPost $objPost
 

Protected Member Functions

 read ()
 

Protected Attributes

int $ref_id = 0
 
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

ilDBInterface $db
 
ilAccessHandler $access
 
ilObjUser $user
 
ilTree $tree
 
ilForumNotificationCache $notificationCache
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilForumNotificationDataProvider::__construct ( ilForumPost  $objPost,
int  $ref_id,
ilForumNotificationCache  $notificationCache 
)

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

47 {
48 global $DIC;
49 $this->db = $DIC->database();
50 $this->access = $DIC->access();
51 $this->user = $DIC->user();
52 $this->tree = $DIC->repositoryTree();
53
54 $this->notificationCache = $notificationCache;
55
56 $this->objPost = $objPost;
57 $this->ref_id = $ref_id;
58 $this->obj_id = ilObject::_lookupObjId($ref_id);
59 $this->read();
60 }
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28

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

+ Here is the call graph for this function:

Member Function Documentation

◆ closestContainer()

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

Implements ilForumNotificationMailData.

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

87 : ?ilObject
88 {
90 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $closest_container.

◆ createRecipientArray()

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

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

492 : array
493 {
494 $refIds = $this->getRefIdsByObjId($this->getObjId());
495
496 $usrIds = [];
497 while ($row = $this->db->fetchAssoc($statement)) {
498 foreach ($refIds as $refId) {
499 if ($this->access->checkAccessOfUser((int) $row['user_id'], 'read', '', $refId)) {
500 $usrIds[] = (int) $row['user_id'];
501 }
502 }
503 }
504
505 return $usrIds;
506 }
$refId
Definition: xapitoken.php:58

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

Referenced by getForumNotificationRecipients(), and getThreadNotificationRecipients().

+ 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 293 of file class.ilForumNotificationDataProvider.php.

293 : ?ilObject
294 {
295 $cacheKey = $this->notificationCache->createKeyByValues([
296 'forum_container',
297 $frm_ref_id
298 ]);
299
300 if (false === $this->notificationCache->exists($cacheKey)) {
301 $ref_id = $this->tree->checkForParentType($frm_ref_id, 'crs');
302 if (!($ref_id > 0)) {
303 $ref_id = $this->tree->checkForParentType($frm_ref_id, 'grp');
304 }
305
306 if ($ref_id > 0) {
308 $this->notificationCache->store($cacheKey, $container);
309 return $container;
310 }
311 }
312
313 return null;
314 }
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
$container
@noRector
Definition: wac.php:14

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

Referenced by readForumData().

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

◆ getAttachments()

ilForumNotificationDataProvider::getAttachments ( )

◆ getCensorshipComment()

ilForumNotificationDataProvider::getCensorshipComment ( )

Implements ilForumNotificationMailData.

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

142 : string
143 {
144 return $this->objPost->getCensorshipComment();
145 }

◆ getDeletedBy()

ilForumNotificationDataProvider::getDeletedBy ( )

Implements ilForumNotificationMailData.

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

508 : string
509 {
510 if ($this->objPost->getUserAlias() && $this->objPost->getDisplayUserId() === 0
511 && $this->objPost->getPosAuthorId() === $this->user->getId()) {
512 return $this->objPost->getUserAlias();
513 }
514
515 return $this->user->getLogin();
516 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getEventType()

ilForumNotificationDataProvider::getEventType ( int  $notification_type)
private

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

518 : int
519 {
520 $event_type = 0;
521 switch ($notification_type) {
524 break;
527 break;
530 break;
533 break;
536 break;
537 default:
538 $event_type = 0;
539 break;
540 }
541
542 return $event_type;
543 }

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().

+ Here is the caller graph for this function:

◆ getForumId()

ilForumNotificationDataProvider::getForumId ( )

Implements ilForumNotificationMailData.

Definition at line 82 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)
Parameters
int$notification_type
Returns
int[]

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

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

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

+ Here is the call graph for this function:

◆ getForumTitle()

ilForumNotificationDataProvider::getForumTitle ( )

◆ getImportName()

ilForumNotificationDataProvider::getImportName ( )

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

162 : string
163 {
164 return $this->objPost->getImportName();
165 }

Referenced by getPostUpdateUserName(), and getPostUserName().

+ Here is the caller graph for this function:

◆ getObjId()

ilForumNotificationDataProvider::getObjId ( )

Implements ilForumNotificationMailData.

Definition at line 67 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 465 of file class.ilForumNotificationDataProvider.php.

References $pos_author_id.

Referenced by getPostUpdateUserName(), and getPostUserName().

+ Here is the caller graph for this function:

◆ getPosDisplayUserId()

ilForumNotificationDataProvider::getPosDisplayUserId ( )

Implements ilForumNotificationMailData.

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

117 : int
118 {
119 return $this->objPost->getDisplayUserId();
120 }

Referenced by getPostUserName().

+ Here is the caller graph for this function:

◆ getPostActivationRecipients()

ilForumNotificationDataProvider::getPostActivationRecipients ( )
Returns
int[]

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

442 : array
443 {
444 $cacheKey = $this->notificationCache->createKeyByValues([
445 'post_activation',
446 $this->getRefId()
447 ]);
448
449 if (false === $this->notificationCache->exists($cacheKey)) {
450 // get moderators to notify about needed activation
451 $rcps = ilForum::_getModerators($this->getRefId());
452 $this->notificationCache->store($cacheKey, $rcps);
453 }
454
455 $rcps = $this->notificationCache->fetch($cacheKey);
456
457 return (array) $rcps;
458 }
static _getModerators(int $a_ref_id)

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

+ Here is the call graph for this function:

◆ getPostCensoredDate()

ilForumNotificationDataProvider::getPostCensoredDate ( )

Implements ilForumNotificationMailData.

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

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

◆ getPostDate()

ilForumNotificationDataProvider::getPostDate ( )

Implements ilForumNotificationMailData.

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

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

◆ getPostId()

ilForumNotificationDataProvider::getPostId ( )

Implements ilForumNotificationMailData.

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

77 : int
78 {
79 return $this->objPost->getId();
80 }

◆ getPostMessage()

ilForumNotificationDataProvider::getPostMessage ( )

Implements ilForumNotificationMailData.

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

112 : string
113 {
114 return $this->objPost->getMessage();
115 }

◆ getPostTitle()

ilForumNotificationDataProvider::getPostTitle ( )

Implements ilForumNotificationMailData.

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

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

◆ getPostUpdate()

ilForumNotificationDataProvider::getPostUpdate ( )

Implements ilForumNotificationMailData.

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

127 : string
128 {
129 return $this->objPost->getChangeDate();
130 }

◆ getPostUpdateUserId()

ilForumNotificationDataProvider::getPostUpdateUserId ( )

Implements ilForumNotificationMailData.

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

167 : int
168 {
169 return $this->objPost->getUpdateUserId();
170 }

Referenced by getPostUpdateUserName().

+ Here is the caller graph for this function:

◆ getPostUpdateUserName()

ilForumNotificationDataProvider::getPostUpdateUserName ( ilLanguage  $user_lang)

Implements ilForumNotificationMailData.

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

189 : string
190 {
191 if ($this->update_user_name === null) {
192 $authorinfo = new ilForumAuthorInformation(
193 $this->getPosAuthorId(),
194 $this->getPostUpdateUserId(),
195 $this->getPosUserAlias(),
196 $this->getImportName(),
197 [],
198 $user_lang
199 );
200 $this->update_user_name = $this->getPublicUserInformation($authorinfo);
201 }
202
203 // Possible Fix for #25432
204 if ($this->objPost->getUserAlias() && $this->objPost->getDisplayUserId() === 0
205 && $this->objPost->getPosAuthorId() === $this->objPost->getUpdateUserId()) {
206 return $this->objPost->getUserAlias();
207 }
208
209 return (string) $this->update_user_name;
210 }
getPublicUserInformation(ilForumAuthorInformation $authorinfo)

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

+ Here is the call graph for this function:

◆ getPostUserName()

ilForumNotificationDataProvider::getPostUserName ( ilLanguage  $user_lang)

Implements ilForumNotificationMailData.

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

172 : string
173 {
174 if ($this->post_user_name === null) {
175 $authorinfo = new ilForumAuthorInformation(
176 $this->getPosAuthorId(),
177 $this->getPosDisplayUserId(),
178 $this->getPosUserAlias(),
179 $this->getImportName(),
180 [],
181 $user_lang
182 );
183 $this->post_user_name = $this->getPublicUserInformation($authorinfo);
184 }
185
186 return (string) $this->post_user_name;
187 }

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

+ Here is the call graph for this function:

◆ getPosUserAlias()

ilForumNotificationDataProvider::getPosUserAlias ( )

Implements ilForumNotificationMailData.

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

152 : string
153 {
154 return $this->objPost->getUserAlias();
155 }

Referenced by getPostUpdateUserName(), and getPostUserName().

+ Here is the caller graph for this function:

◆ getPublicUserInformation()

ilForumNotificationDataProvider::getPublicUserInformation ( ilForumAuthorInformation  $authorinfo)

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

212 : string
213 {
214 if ($authorinfo->hasSuffix()) {
215 $public_name = $authorinfo->getAuthorName();
216 } else {
217 $public_name = $authorinfo->getAuthorShortName();
218
219 if ($authorinfo->getAuthorName() && !$this->isAnonymized()) {
220 $public_name = $authorinfo->getAuthorName();
221 }
222 }
223
224 return $public_name;
225 }
getAuthorName(bool $without_short_name=false)

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

Referenced by getPostUpdateUserName(), and getPostUserName().

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

◆ getRefId()

ilForumNotificationDataProvider::getRefId ( )

Implements ilForumNotificationMailData.

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

62 : int
63 {
64 return $this->ref_id;
65 }

References $ref_id.

Referenced by getPostActivationRecipients(), and readForumData().

+ Here is the caller graph for this function:

◆ getRefIdsByObjId()

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

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

474 : array
475 {
476 $cacheKey = $this->notificationCache->createKeyByValues([
477 'refs_by_obj_id',
478 $objId
479 ]);
480
481 if (!$this->notificationCache->exists($cacheKey)) {
482 $this->notificationCache->store($cacheKey, ilObject::_getAllReferences($objId));
483 }
484
485 return $this->notificationCache->fetch($cacheKey);
486 }
static _getAllReferences(int $id)
get all reference ids for object ID
$objId
Definition: xapitoken.php:57

References $objId, and ilObject\_getAllReferences().

Referenced by createRecipientArray().

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

◆ getThreadId()

ilForumNotificationDataProvider::getThreadId ( )

Implements ilForumNotificationMailData.

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

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

Referenced by getThreadNotificationRecipients().

+ Here is the caller graph for this function:

◆ getThreadNotificationRecipients()

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

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

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

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

+ Here is the call graph for this function:

◆ getThreadTitle()

ilForumNotificationDataProvider::getThreadTitle ( )

Implements ilForumNotificationMailData.

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

102 : string
103 {
104 return $this->thread_title;
105 }

References $thread_title.

◆ isAnonymized()

ilForumNotificationDataProvider::isAnonymized ( )

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

References $is_anonymized.

◆ isPostCensored()

ilForumNotificationDataProvider::isPostCensored ( )

Implements ilForumNotificationMailData.

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

132 : bool
133 {
134 return $this->objPost->isCensored();
135 }

◆ providesClosestContainer()

ilForumNotificationDataProvider::providesClosestContainer ( )

Implements ilForumNotificationMailData.

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

92 : bool
93 {
94 return $this->closest_container !== null;
95 }

◆ read()

ilForumNotificationDataProvider::read ( )
protected

Definition at line 227 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 316 of file class.ilForumNotificationDataProvider.php.

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

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

Referenced by read().

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

◆ readForumData()

ilForumNotificationDataProvider::readForumData ( )
private

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

258 : void
259 {
260 $cacheKey = $this->notificationCache->createKeyByValues([
261 'forum_data',
262 $this->getObjId()
263 ]);
264
265 if (false === $this->notificationCache->exists($cacheKey)) {
266 $result = $this->db->queryF(
267 '
268 SELECT top_pk, top_name, frm_settings.anonymized FROM frm_data
269 INNER JOIN frm_settings ON top_frm_fk = frm_settings.obj_id
270 WHERE top_frm_fk = %s',
271 ['integer'],
272 [$this->getObjId()]
273 );
274
275 $row = $this->db->fetchAssoc($result);
276
278 if ($container instanceof ilObjCourse || $container instanceof ilObjGroup) {
279 $row['closest_container'] = $container;
280 }
281
282 $this->notificationCache->store($cacheKey, $row);
283 }
284
285 $row = $row ?? $this->notificationCache->fetch($cacheKey);
286 $this->forum_id = (int) $row['top_pk'];
287 $this->forum_title = (string) $row['top_name'];
288 $this->closest_container = $row['closest_container'] ?? null;
289
290 $this->is_anonymized = (bool) $row['anonymized'];
291 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjGroup.

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

Referenced by read().

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

◆ readThreadTitle()

ilForumNotificationDataProvider::readThreadTitle ( )
private

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

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

References getObjId().

Referenced by read().

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

◆ setPosAuthorId()

ilForumNotificationDataProvider::setPosAuthorId ( int  $pos_author_id)

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

460 : void
461 {
462 $this->pos_author_id = $pos_author_id;
463 }

References $pos_author_id.

Field Documentation

◆ $access

ilAccessHandler ilForumNotificationDataProvider::$access
private

Definition at line 40 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 34 of file class.ilForumNotificationDataProvider.php.

Referenced by closestContainer().

◆ $db

ilDBInterface ilForumNotificationDataProvider::$db
private

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

◆ $forum_id

int ilForumNotificationDataProvider::$forum_id = 0
protected

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

Referenced by getForumId().

◆ $forum_title

string ilForumNotificationDataProvider::$forum_title = ''
protected

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

Referenced by getForumTitle().

◆ $is_anonymized

bool ilForumNotificationDataProvider::$is_anonymized = false
protected

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

Referenced by isAnonymized().

◆ $notificationCache

ilForumNotificationCache ilForumNotificationDataProvider::$notificationCache
private

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

Referenced by __construct().

◆ $obj_id

int ilForumNotificationDataProvider::$obj_id = 0
protected

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

Referenced by getObjId().

◆ $objPost

ilForumPost ilForumNotificationDataProvider::$objPost

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

Referenced by __construct().

◆ $pos_author_id

int ilForumNotificationDataProvider::$pos_author_id = 0

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

Referenced by getPosAuthorId(), and setPosAuthorId().

◆ $post_user_name

string ilForumNotificationDataProvider::$post_user_name = null
protected

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

Referenced by getPostUserName().

◆ $ref_id

int ilForumNotificationDataProvider::$ref_id = 0
protected

◆ $thread_title

string ilForumNotificationDataProvider::$thread_title = ''
protected

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

Referenced by getThreadTitle().

◆ $tree

ilTree ilForumNotificationDataProvider::$tree
private

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

◆ $update_user_name

string ilForumNotificationDataProvider::$update_user_name = null
protected

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

Referenced by getPostUpdateUserName().

◆ $user

ilObjUser ilForumNotificationDataProvider::$user
private

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


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