ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjForumNotificationDataProvider Class Reference

Class ilObjForumNotificationDataProvider. More...

+ Inheritance diagram for ilObjForumNotificationDataProvider:
+ Collaboration diagram for ilObjForumNotificationDataProvider:

Public Member Functions

 __construct (ilForumPost $objPost, $ref_id, \ilForumNotificationCache $notificationCache)
 
 getRefId ()
 
 getObjId ()
 
 getThreadId ()
 
 getPostId ()
 
 getForumId ()
 
 closestContainer ()
 
 providesClosestContainer ()
 
 getForumTitle ()
 
 getThreadTitle ()
 
 getPostTitle ()
 
 getPostMessage ()
 
 getPosDisplayUserId ()
 
 getPostDate ()
 
 getPostUpdate ()
 
 getPostCensored ()
 
 getPostCensoredDate ()
 
 getCensorshipComment ()
 
 getAttachments ()
 
 getPosUserAlias ()
 
 isAnonymized ()
 
 getImportName ()
 
 getPostUpdateUserId ()
 
Returns
int
More...
 
 getPostUserName (\ilLanguage $user_lang)
 
Parameters
\ilLanguage$user_lang
Returns
string
More...
 
 getPostUpdateUserName (\ilLanguage $user_lang)
 
Parameters
\ilLanguage$user_lang
Returns
string
More...
 
 getPublicUserInformation (ilForumAuthorInformation $authorinfo)
 
 determineClosestContainer (int $frm_ref_id)
 
 getForumNotificationRecipients ()
 
 getThreadNotificationRecipients ()
 
 getPostAnsweredRecipients ()
 
 getPostActivationRecipients ()
 
 setPosAuthorId ($pos_author_id)
 
 getPosAuthorId ()
 
 getDeletedBy ()
 

Data Fields

 $pos_author_id = 0
 
 $objPost
 

Protected Member Functions

 read ()
 

Protected Attributes

 $ref_id = 0
 
 $obj_id = 0
 
 $post_user_name = null
 
 $update_user_name = null
 
 $forum_id = 0
 
 $closest_container = null
 
 $forum_title = ''
 
 $thread_title = ''
 
 $attachments = []
 
 $is_anonymized = false
 

Private Member Functions

 readThreadTitle ()
 
 readForumData ()
 
 readAttachments ()
 
 getRefIdsByObjId (int $objId)
 
 createRecipientArray (\ilPDOStatement $statement)
 

Private Attributes

 $db
 
 $access
 
 $user
 
 $tree
 
 $notificationCache
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjForumNotificationDataProvider::__construct ( ilForumPost  $objPost,
  $ref_id,
\ilForumNotificationCache  $notificationCache 
)
Parameters
ilForumPost$objPost
int$ref_id
ilForumNotificationCache$notificationCache

Definition at line 51 of file class.ilObjForumNotificationDataProvider.php.

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

52  {
53  global $DIC;
54  $this->db = $DIC->database();
55  $this->access = $DIC->access();
56  $this->user = $DIC->user();
57  $this->tree = $DIC->repositoryTree();
58 
59  $this->notificationCache = $notificationCache;
60 
61  $this->objPost = $objPost;
62  $this->ref_id = $ref_id;
63  $this->obj_id = ilObject::_lookupObjId($ref_id);
64  $this->read();
65  }
user()
Definition: user.php:4
static _lookupObjId($a_id)
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

Member Function Documentation

◆ closestContainer()

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

Implements ilForumNotificationMailData.

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

References $closest_container.

◆ createRecipientArray()

ilObjForumNotificationDataProvider::createRecipientArray ( \ilPDOStatement  $statement)
private
Parameters
\ilPDOStatement$statement- statement to be executed by the database needs to a 'user_id' as result
Returns
int[]

Definition at line 566 of file class.ilObjForumNotificationDataProvider.php.

References $refId, getObjId(), and getRefIdsByObjId().

Referenced by getForumNotificationRecipients(), and getThreadNotificationRecipients().

566  : array
567  {
568  $refIds = $this->getRefIdsByObjId((int) $this->getObjId());
569 
570  $usrIds = [];
571  while ($row = $this->db->fetchAssoc($statement)) {
572  foreach ($refIds as $refId) {
573  if ($this->access->checkAccessOfUser($row['user_id'], 'read', '', $refId)) {
574  $usrIds[] = (int) $row['user_id'];
575  }
576  }
577  }
578 
579  return $usrIds;
580  }
$refId
Definition: xapitoken.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determineClosestContainer()

ilObjForumNotificationDataProvider::determineClosestContainer ( int  $frm_ref_id)

Definition at line 374 of file class.ilObjForumNotificationDataProvider.php.

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

Referenced by readForumData().

374  : ?ilObject
375  {
376  $cacheKey = $this->notificationCache->createKeyByValues([
377  'forum_container',
378  $frm_ref_id
379  ]);
380 
381  if (false === $this->notificationCache->exists($cacheKey)) {
382  $ref_id = $this->tree->checkForParentType($frm_ref_id, 'crs');
383  if (!($ref_id > 0)) {
384  $ref_id = $this->tree->checkForParentType($frm_ref_id, 'grp');
385  }
386 
387  if ($ref_id > 0) {
389  $this->notificationCache->store($cacheKey, $container);
390  return $container;
391  }
392  }
393 
394  return null;
395  }
$container
Definition: wac.php:13
static getInstanceByRefId($a_ref_id, $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()

ilObjForumNotificationDataProvider::getAttachments ( )
Returns
array file names

Implements ilForumNotificationMailData.

Definition at line 196 of file class.ilObjForumNotificationDataProvider.php.

References $attachments.

◆ getCensorshipComment()

ilObjForumNotificationDataProvider::getCensorshipComment ( )
Returns
string

Implements ilForumNotificationMailData.

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

189  {
190  return $this->objPost->getCensorshipComment();
191  }

◆ getDeletedBy()

ilObjForumNotificationDataProvider::getDeletedBy ( )
Returns
string

Implements ilForumNotificationMailData.

Definition at line 585 of file class.ilObjForumNotificationDataProvider.php.

References $DIC.

586  {
587  global $DIC;
588 
589  if ($this->objPost->getUserAlias() && $this->objPost->getDisplayUserId() == 0
590  && $this->objPost->getPosAuthorId() == $DIC->user()->getId()) {
591  return (string) $this->objPost->getUserAlias();
592  } else {
593  return $DIC->user()->getLogin();
594  }
595  }
global $DIC
Definition: goto.php:24

◆ getForumId()

ilObjForumNotificationDataProvider::getForumId ( )
Returns
int

Implements ilForumNotificationMailData.

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

References $forum_id.

Referenced by getForumNotificationRecipients().

+ Here is the caller graph for this function:

◆ getForumNotificationRecipients()

ilObjForumNotificationDataProvider::getForumNotificationRecipients ( )
Returns
int[]

Definition at line 418 of file class.ilObjForumNotificationDataProvider.php.

References $res, createRecipientArray(), getForumId(), and user().

Referenced by ilForumAppEventListener\delegateNotification().

419  {
420  $cacheKey = $this->notificationCache->createKeyByValues(array(
421  'forum',
422  $this->getForumId(),
423  $this->user->getId()
424  ));
425 
426  if (false === $this->notificationCache->exists($cacheKey)) {
427  $res = $this->db->queryf(
428  '
429  SELECT frm_notification.user_id FROM frm_notification, frm_data
430  WHERE frm_data.top_pk = %s
431  AND frm_notification.frm_id = frm_data.top_frm_fk
432  AND frm_notification.user_id != %s
433  GROUP BY frm_notification.user_id',
434  array('integer', 'integer'),
435  array($this->getForumId(), $this->user->getId())
436  );
437 
438  $rcps = $this->createRecipientArray($res);
439  $this->notificationCache->store($cacheKey, $rcps);
440  }
441 
442  $rcps = $this->notificationCache->fetch($cacheKey);
443 
444  return array_unique($rcps);
445  }
user()
Definition: user.php:4
foreach($_POST as $key=> $value) $res
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getForumTitle()

ilObjForumNotificationDataProvider::getForumTitle ( )
Returns
string frm_data.top_name

Implements ilForumNotificationMailData.

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

References $forum_title.

◆ getImportName()

ilObjForumNotificationDataProvider::getImportName ( )
Returns
string

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

Referenced by getPostUpdateUserName(), and getPostUserName().

220  {
221  return $this->objPost->getImportName();
222  }
+ Here is the caller graph for this function:

◆ getObjId()

ilObjForumNotificationDataProvider::getObjId ( )
Returns
int

Implements ilForumNotificationMailData.

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

References $obj_id.

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

+ Here is the caller graph for this function:

◆ getPosAuthorId()

ilObjForumNotificationDataProvider::getPosAuthorId ( )
Returns
int

Implements ilForumNotificationMailData.

Definition at line 538 of file class.ilObjForumNotificationDataProvider.php.

References $pos_author_id.

Referenced by getPostUpdateUserName(), and getPostUserName().

+ Here is the caller graph for this function:

◆ getPosDisplayUserId()

ilObjForumNotificationDataProvider::getPosDisplayUserId ( )
Returns
string frm_posts.pos_display_user_id

Implements ilForumNotificationMailData.

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

Referenced by getPostUserName().

153  {
154  return $this->objPost->getDisplayUserId();
155  }
+ Here is the caller graph for this function:

◆ getPostActivationRecipients()

ilObjForumNotificationDataProvider::getPostActivationRecipients ( )
Returns
int[]

Definition at line 509 of file class.ilObjForumNotificationDataProvider.php.

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

Referenced by ilForumAppEventListener\delegateNotification().

510  {
511  $cacheKey = $this->notificationCache->createKeyByValues(array(
512  'post_activation',
513  $this->getRefId()
514  ));
515 
516  if (false === $this->notificationCache->exists($cacheKey)) {
517  // get moderators to notify about needed activation
518  $rcps = ilForum::_getModerators($this->getRefId());
519  $this->notificationCache->store($cacheKey, $rcps);
520  }
521 
522  $rcps = $this->notificationCache->fetch($cacheKey);
523 
524  return (array) $rcps;
525  }
static _getModerators($a_ref_id)
get all users assigned to local role il_frm_moderator_<frm_ref_id> (static)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPostAnsweredRecipients()

ilObjForumNotificationDataProvider::getPostAnsweredRecipients ( )
Returns
int[]

Definition at line 486 of file class.ilObjForumNotificationDataProvider.php.

Referenced by ilForumAppEventListener\delegateNotification().

487  {
488  $cacheKey = $this->notificationCache->createKeyByValues(array(
489  'post_answered',
490  $this->objPost->getParentId()
491  ));
492 
493  if (false === $this->notificationCache->exists($cacheKey)) {
494  $parent_objPost = new ilForumPost($this->objPost->getParentId());
495 
496  $this->notificationCache->store($cacheKey, $parent_objPost);
497  }
498 
499  $parent_objPost = $this->notificationCache->fetch($cacheKey);
500  $rcps = array();
501  $rcps[] = $parent_objPost->getPosAuthorId();
502 
503  return $rcps;
504  }
+ Here is the caller graph for this function:

◆ getPostCensored()

ilObjForumNotificationDataProvider::getPostCensored ( )
Returns
bool frm_posts.pos_cens

Implements ilForumNotificationMailData.

Definition at line 175 of file class.ilObjForumNotificationDataProvider.php.

176  {
177  return $this->objPost->isCensored();
178  }

◆ getPostCensoredDate()

ilObjForumNotificationDataProvider::getPostCensoredDate ( )
Returns
string frm_posts.pos_cens_date

Implements ilForumNotificationMailData.

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

184  {
185  return $this->objPost->getCensoredDate();
186  }

◆ getPostDate()

ilObjForumNotificationDataProvider::getPostDate ( )
Returns
string frm_posts.pos_date

Implements ilForumNotificationMailData.

Definition at line 160 of file class.ilObjForumNotificationDataProvider.php.

161  {
162  return $this->objPost->getCreateDate();
163  }

◆ getPostId()

ilObjForumNotificationDataProvider::getPostId ( )
Returns
int

Implements ilForumNotificationMailData.

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

95  {
96  return $this->objPost->getId();
97  }

◆ getPostMessage()

ilObjForumNotificationDataProvider::getPostMessage ( )
Returns
string frm_posts.pos_message

Implements ilForumNotificationMailData.

Definition at line 144 of file class.ilObjForumNotificationDataProvider.php.

145  {
146  return $this->objPost->getMessage();
147  }

◆ getPostTitle()

ilObjForumNotificationDataProvider::getPostTitle ( )
Returns
string frm_posts.pos_subject

Implements ilForumNotificationMailData.

Definition at line 136 of file class.ilObjForumNotificationDataProvider.php.

137  {
138  return $this->objPost->getSubject();
139  }

◆ getPostUpdate()

ilObjForumNotificationDataProvider::getPostUpdate ( )
Returns
string frm_posts.pos_update

Implements ilForumNotificationMailData.

Definition at line 168 of file class.ilObjForumNotificationDataProvider.php.

169  {
170  return $this->objPost->getChangeDate();
171  }

◆ getPostUpdateUserId()

ilObjForumNotificationDataProvider::getPostUpdateUserId ( )

Returns
int

Implements ilForumNotificationMailData.

Definition at line 227 of file class.ilObjForumNotificationDataProvider.php.

Referenced by getPostUpdateUserName().

228  {
229  return $this->objPost->getUpdateUserId();
230  }
+ Here is the caller graph for this function:

◆ getPostUpdateUserName()

ilObjForumNotificationDataProvider::getPostUpdateUserName ( \ilLanguage  $user_lang)

Parameters
\ilLanguage$user_lang
Returns
string

Implements ilForumNotificationMailData.

Definition at line 255 of file class.ilObjForumNotificationDataProvider.php.

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

256  {
257  if ($this->update_user_name === null) {
258  $authorinfo = new ilForumAuthorInformation(
259  $this->getPosAuthorId(),
260  $this->getPostUpdateUserId(),
261  $this->getPosUserAlias(),
262  $this->getImportName(),
263  array(),
264  $user_lang
265  );
266  $this->update_user_name = $this->getPublicUserInformation($authorinfo);
267  }
268 
269  // Possible Fix for #25432
270  if ($this->objPost->getUserAlias() && $this->objPost->getDisplayUserId() == 0
271  && $this->objPost->getPosAuthorId() == $this->objPost->getUpdateUserId()) {
272  return (string) $this->objPost->getUserAlias();
273  }
274 
275  return (string) $this->update_user_name;
276  }
getPublicUserInformation(ilForumAuthorInformation $authorinfo)
+ Here is the call graph for this function:

◆ getPostUserName()

ilObjForumNotificationDataProvider::getPostUserName ( \ilLanguage  $user_lang)

Parameters
\ilLanguage$user_lang
Returns
string

Implements ilForumNotificationMailData.

Definition at line 235 of file class.ilObjForumNotificationDataProvider.php.

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

236  {
237  if ($this->post_user_name === null) {
238  $authorinfo = new ilForumAuthorInformation(
239  $this->getPosAuthorId(),
240  $this->getPosDisplayUserId(),
241  $this->getPosUserAlias(),
242  $this->getImportName(),
243  array(),
244  $user_lang
245  );
246  $this->post_user_name = $this->getPublicUserInformation($authorinfo);
247  }
248 
249  return (string) $this->post_user_name;
250  }
getPublicUserInformation(ilForumAuthorInformation $authorinfo)
+ Here is the call graph for this function:

◆ getPosUserAlias()

ilObjForumNotificationDataProvider::getPosUserAlias ( )
Returns
string frm_posts.pos_usr_alias

Implements ilForumNotificationMailData.

Definition at line 204 of file class.ilObjForumNotificationDataProvider.php.

Referenced by getPostUpdateUserName(), and getPostUserName().

205  {
206  return $this->objPost->getUserAlias();
207  }
+ Here is the caller graph for this function:

◆ getPublicUserInformation()

ilObjForumNotificationDataProvider::getPublicUserInformation ( ilForumAuthorInformation  $authorinfo)
Parameters
ilForumAuthorInformation$authorinfo
Returns
string

Definition at line 282 of file class.ilObjForumNotificationDataProvider.php.

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

Referenced by getPostUpdateUserName(), and getPostUserName().

283  {
284  if ($authorinfo->hasSuffix()) {
285  $public_name = $authorinfo->getAuthorName();
286  } else {
287  $public_name = $authorinfo->getAuthorShortName();
288 
289  if ($authorinfo->getAuthorName() && !$this->isAnonymized()) {
290  $public_name = $authorinfo->getAuthorName();
291  }
292  }
293 
294  return $public_name;
295  }
getAuthorName($without_short_name=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRefId()

ilObjForumNotificationDataProvider::getRefId ( )
Returns
int

Implements ilForumNotificationMailData.

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

References $ref_id.

Referenced by getPostActivationRecipients(), and readForumData().

+ Here is the caller graph for this function:

◆ getRefIdsByObjId()

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

Definition at line 547 of file class.ilObjForumNotificationDataProvider.php.

References ilObject\_getAllReferences().

Referenced by createRecipientArray().

547  : array
548  {
549  $cacheKey = $this->notificationCache->createKeyByValues([
550  'refs_by_obj_id',
551  $objId
552  ]);
553 
554  if (!$this->notificationCache->exists($cacheKey)) {
555  $this->notificationCache->store($cacheKey, (array) ilObject::_getAllReferences($objId));
556  }
557 
558  return $this->notificationCache->fetch($cacheKey);
559  }
$objId
Definition: xapitoken.php:39
static _getAllReferences($a_id)
get all reference ids of object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getThreadId()

ilObjForumNotificationDataProvider::getThreadId ( )
Returns
int

Implements ilForumNotificationMailData.

Definition at line 86 of file class.ilObjForumNotificationDataProvider.php.

Referenced by getThreadNotificationRecipients().

87  {
88  return $this->objPost->getThreadId();
89  }
+ Here is the caller graph for this function:

◆ getThreadNotificationRecipients()

ilObjForumNotificationDataProvider::getThreadNotificationRecipients ( )
Returns
int[]

Definition at line 450 of file class.ilObjForumNotificationDataProvider.php.

References $res, createRecipientArray(), getThreadId(), and user().

Referenced by ilForumAppEventListener\delegateNotification().

451  {
452  if (!$this->getThreadId()) {
453  return [];
454  }
455 
456  $cacheKey = $this->notificationCache->createKeyByValues(array(
457  'thread',
458  $this->getThreadId(),
459  $this->user->getId()
460  ));
461 
462  if (false === $this->notificationCache->exists($cacheKey)) {
463  $res = $this->db->queryF(
464  '
465  SELECT frm_notification.user_id
466  FROM frm_notification
467  INNER JOIN frm_threads ON frm_threads.thr_pk = frm_notification.thread_id
468  WHERE frm_notification.thread_id = %s
469  AND frm_notification.user_id != %s',
470  array('integer', 'integer'),
471  array($this->getThreadId(), $this->user->getId())
472  );
473 
474  $usrIds = $this->createRecipientArray($res);
475  $this->notificationCache->store($cacheKey, $usrIds);
476  }
477 
478  $usrIds = $this->notificationCache->fetch($cacheKey);
479 
480  return $usrIds;
481  }
user()
Definition: user.php:4
foreach($_POST as $key=> $value) $res
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getThreadTitle()

ilObjForumNotificationDataProvider::getThreadTitle ( )
Returns
string frm_threads.thr_subject

Implements ilForumNotificationMailData.

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

References $thread_title.

◆ isAnonymized()

ilObjForumNotificationDataProvider::isAnonymized ( )
Returns
bool

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

References $is_anonymized.

Referenced by getPublicUserInformation().

+ Here is the caller graph for this function:

◆ providesClosestContainer()

ilObjForumNotificationDataProvider::providesClosestContainer ( )

Implements ilForumNotificationMailData.

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

112  : bool
113  {
114  return $this->closest_container !== null;
115  }

◆ read()

ilObjForumNotificationDataProvider::read ( )
protected

Definition at line 300 of file class.ilObjForumNotificationDataProvider.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()

ilObjForumNotificationDataProvider::readAttachments ( )
private

Definition at line 400 of file class.ilObjForumNotificationDataProvider.php.

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

Referenced by read().

401  {
403  $fileDataForum = new ilFileDataForum($this->getObjId(), $this->objPost->getId());
404  $filesOfPost = $fileDataForum->getFilesOfPost();
405 
406  $fileDataMail = new ilFileDataMail(ANONYMOUS_USER_ID);
407 
408  foreach ($filesOfPost as $attachment) {
409  $this->attachments[$attachment['path']] = $attachment['name'];
410  $fileDataMail->copyAttachmentFile($attachment['path'], $attachment['name']);
411  }
412  }
413  }
const ANONYMOUS_USER_ID
Definition: constants.php:25
Class ilFileDataMail.
This class handles all operations on files for the forum object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readForumData()

ilObjForumNotificationDataProvider::readForumData ( )
private

Definition at line 337 of file class.ilObjForumNotificationDataProvider.php.

References $container, $result, determineClosestContainer(), getObjId(), and getRefId().

Referenced by read().

338  {
339  $cacheKey = $this->notificationCache->createKeyByValues(array(
340  'forum_data',
341  $this->getObjId()
342  ));
343 
344  if (false === $this->notificationCache->exists($cacheKey)) {
345  $result = $this->db->queryf(
346  '
347  SELECT top_pk, top_name, frm_settings.anonymized FROM frm_data
348  INNER JOIN frm_settings ON top_frm_fk = frm_settings.obj_id
349  WHERE top_frm_fk = %s',
350  array('integer'),
351  array($this->getObjId()
352  )
353  );
354 
355  $row = $this->db->fetchAssoc($result);
356 
357  $container = $this->determineClosestContainer($this->getRefId());
358  if ($container instanceof ilObjCourse || $container instanceof ilObjGroup) {
359  $row['closest_container'] = $container;
360  }
361 
362  $this->notificationCache->store($cacheKey, $row);
363  }
364 
365  $row = $row ?? $this->notificationCache->fetch($cacheKey);
366  $this->forum_id = $row['top_pk'];
367  $this->forum_title = $row['top_name'];
368  $this->closest_container = $row['closest_container'] ?? null;
369 
370 
371  $this->is_anonymized = (bool) $row['anonymized'];
372  }
$result
$container
Definition: wac.php:13
Class ilObjGroup.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readThreadTitle()

ilObjForumNotificationDataProvider::readThreadTitle ( )
private

Definition at line 310 of file class.ilObjForumNotificationDataProvider.php.

References $result, and getObjId().

Referenced by read().

311  {
312  $cacheKey = $this->notificationCache->createKeyByValues(array(
313  'thread_title',
314  $this->getObjId()
315  ));
316 
317  if (false === $this->notificationCache->exists($cacheKey)) {
318  $result = $this->db->queryf(
319  '
320  SELECT thr_subject FROM frm_threads
321  WHERE thr_pk = %s',
322  array('integer'),
323  array($this->objPost->getThreadId())
324  );
325 
326  $row = $this->db->fetchAssoc($result);
327  $this->notificationCache->store($cacheKey, $row);
328  }
329 
330  $row = $this->notificationCache->fetch($cacheKey);
331  $this->thread_title = $row['thr_subject'];
332  }
$result
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPosAuthorId()

ilObjForumNotificationDataProvider::setPosAuthorId (   $pos_author_id)
Parameters
$pos_author_id

Definition at line 530 of file class.ilObjForumNotificationDataProvider.php.

References $pos_author_id.

531  {
532  $this->pos_author_id = $pos_author_id;
533  }

Field Documentation

◆ $access

ilObjForumNotificationDataProvider::$access
private

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

◆ $attachments

ilObjForumNotificationDataProvider::$attachments = []
protected

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

Referenced by getAttachments().

◆ $closest_container

ilObjForumNotificationDataProvider::$closest_container = null
protected

Definition at line 23 of file class.ilObjForumNotificationDataProvider.php.

Referenced by closestContainer().

◆ $db

ilObjForumNotificationDataProvider::$db
private

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

◆ $forum_id

ilObjForumNotificationDataProvider::$forum_id = 0
protected

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

Referenced by getForumId().

◆ $forum_title

ilObjForumNotificationDataProvider::$forum_title = ''
protected

Definition at line 25 of file class.ilObjForumNotificationDataProvider.php.

Referenced by getForumTitle().

◆ $is_anonymized

ilObjForumNotificationDataProvider::$is_anonymized = false
protected

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

Referenced by isAnonymized().

◆ $notificationCache

ilObjForumNotificationDataProvider::$notificationCache
private

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

Referenced by __construct().

◆ $obj_id

ilObjForumNotificationDataProvider::$obj_id = 0
protected

Definition at line 13 of file class.ilObjForumNotificationDataProvider.php.

Referenced by getObjId().

◆ $objPost

ilObjForumNotificationDataProvider::$objPost

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

Referenced by __construct().

◆ $pos_author_id

ilObjForumNotificationDataProvider::$pos_author_id = 0

Definition at line 19 of file class.ilObjForumNotificationDataProvider.php.

Referenced by getPosAuthorId(), and setPosAuthorId().

◆ $post_user_name

ilObjForumNotificationDataProvider::$post_user_name = null
protected

Definition at line 15 of file class.ilObjForumNotificationDataProvider.php.

Referenced by getPostUserName().

◆ $ref_id

ilObjForumNotificationDataProvider::$ref_id = 0
protected

◆ $thread_title

ilObjForumNotificationDataProvider::$thread_title = ''
protected

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

Referenced by getThreadTitle().

◆ $tree

ilObjForumNotificationDataProvider::$tree
private

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

◆ $update_user_name

ilObjForumNotificationDataProvider::$update_user_name = null
protected

Definition at line 17 of file class.ilObjForumNotificationDataProvider.php.

Referenced by getPostUpdateUserName().

◆ $user

ilObjForumNotificationDataProvider::$user
private

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


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