50 $this->db = $DIC->database();
51 $this->access = $DIC->access();
52 $this->
user = $DIC->user();
83 return $this->objPost->getThreadId();
91 return $this->objPost->getId();
123 return $this->objPost->getSubject();
131 return $this->objPost->getMessage();
139 return $this->objPost->getDisplayUserId();
147 return $this->objPost->getCreateDate();
155 return $this->objPost->getChangeDate();
162 return $this->objPost->isCensored();
170 return $this->objPost->getCensoredDate();
175 return $this->objPost->getCensorshipComment();
191 return $this->objPost->getUserAlias();
206 return $this->objPost->getImportName();
214 return $this->objPost->getUpdateUserId();
222 if ($this->post_user_name === null) {
242 if ($this->update_user_name === null) {
255 if ($this->objPost->getUserAlias() && $this->objPost->getDisplayUserId() == 0
256 && $this->objPost->getPosAuthorId() == $this->objPost->getUpdateUserId()) {
257 return (
string) $this->objPost->getUserAlias();
297 $cacheKey = $this->notificationCache->createKeyByValues(array(
302 if (
false === $this->notificationCache->exists($cacheKey)) {
305 SELECT thr_subject FROM frm_threads 308 array($this->objPost->getThreadId())
312 $this->notificationCache->store($cacheKey,
$row);
315 $row = $this->notificationCache->fetch($cacheKey);
316 $this->thread_title =
$row[
'thr_subject'];
324 $cacheKey = $this->notificationCache->createKeyByValues(array(
329 if (
false === $this->notificationCache->exists($cacheKey)) {
332 SELECT top_pk, top_name, frm_settings.anonymized FROM frm_data 333 INNER JOIN frm_settings ON top_frm_fk = frm_settings.obj_id 334 WHERE top_frm_fk = %s',
342 $this->notificationCache->store($cacheKey,
$row);
345 $row = $this->notificationCache->fetch($cacheKey);
346 $this->forum_id =
$row[
'top_pk'];
347 $this->forum_title =
$row[
'top_name'];
348 $this->is_anonymized = (bool)
$row[
'anonymized'];
358 $filesOfPost = $fileDataForum->getFilesOfPost();
362 foreach ($filesOfPost as $attachment) {
363 $this->attachments[$attachment[
'path']] = $attachment[
'name'];
364 $fileDataMail->copyAttachmentFile($attachment[
'path'], $attachment[
'name']);
374 $cacheKey = $this->notificationCache->createKeyByValues(array(
380 if (
false === $this->notificationCache->exists($cacheKey)) {
381 $res = $this->db->queryf(
383 SELECT frm_notification.user_id FROM frm_notification, frm_data 384 WHERE frm_data.top_pk = %s 385 AND frm_notification.frm_id = frm_data.top_frm_fk 386 AND frm_notification.user_id != %s 387 GROUP BY frm_notification.user_id',
388 array(
'integer',
'integer'),
393 $this->notificationCache->store($cacheKey, $rcps);
396 $rcps = $this->notificationCache->fetch($cacheKey);
398 return array_unique($rcps);
410 $cacheKey = $this->notificationCache->createKeyByValues(array(
416 if (
false === $this->notificationCache->exists($cacheKey)) {
417 $res = $this->db->queryF(
419 SELECT frm_notification.user_id 420 FROM frm_notification 421 INNER JOIN frm_threads ON frm_threads.thr_pk = frm_notification.thread_id 422 WHERE frm_notification.thread_id = %s 423 AND frm_notification.user_id != %s',
424 array(
'integer',
'integer'),
429 $this->notificationCache->store($cacheKey, $usrIds);
432 $usrIds = $this->notificationCache->fetch($cacheKey);
442 $cacheKey = $this->notificationCache->createKeyByValues(array(
444 $this->objPost->getParentId()
447 if (
false === $this->notificationCache->exists($cacheKey)) {
448 $parent_objPost =
new ilForumPost($this->objPost->getParentId());
450 $this->notificationCache->store($cacheKey, $parent_objPost);
453 $parent_objPost = $this->notificationCache->fetch($cacheKey);
455 $rcps[] = $parent_objPost->getPosAuthorId();
465 $cacheKey = $this->notificationCache->createKeyByValues(array(
470 if (
false === $this->notificationCache->exists($cacheKey)) {
473 $this->notificationCache->store($cacheKey, $rcps);
476 $rcps = $this->notificationCache->fetch($cacheKey);
478 return (array) $rcps;
503 $cacheKey = $this->notificationCache->createKeyByValues([
508 if (!$this->notificationCache->exists($cacheKey)) {
512 return $this->notificationCache->fetch($cacheKey);
525 while (
$row = $this->db->fetchAssoc($statement)) {
526 foreach ($refIds as $refId) {
527 if ($this->access->checkAccessOfUser(
$row[
'user_id'],
'read',
'', $refId)) {
528 $usrIds[] = (int)
$row[
'user_id'];
544 return (
string) $this->objPost->getUserAlias();
546 return $DIC->user()->getLogin();
556 if ($this->objPost->getUserAlias() && $this->objPost->getDisplayUserId() == 0
557 && $this->objPost->getPosAuthorId() == $DIC->user()->getId()) {
__construct(ilForumPost $objPost, $ref_id, \ilForumNotificationCache $notificationCache)
getForumNotificationRecipients()
Class ilObjForumNotificationDataProvider.
Class ilPDOStatement is a Wrapper Class for PDOStatement.
getPostUpdateUserName(\ilLanguage $user_lang)
string
createRecipientArray(\ilPDOStatement $statement)
getRefIdsByObjId(int $objId)
static _getAllReferences($a_id)
get all reference ids of object
getPostUserName(\ilLanguage $user_lang)
string
getThreadNotificationRecipients()
foreach($_POST as $key=> $value) $res
static isSendAttachmentsByMailEnabled()
static _lookupObjId($a_id)
Class ilForumNotificationCache.
getPublicUserInformation(ilForumAuthorInformation $authorinfo)
getPostAnsweredRecipients()
Interface ilForumNotificationMailData.
getPostActivationRecipients()
This class handles all operations on files for the forum object.
setPosAuthorId($pos_author_id)
static _getModerators($a_ref_id)
get all users assigned to local role il_frm_moderator_<frm_ref_id> (static)