54        $this->db = 
$DIC->database();
 
   55        $this->access = 
$DIC->access();
 
   56        $this->
user = $DIC->user();
 
   57        $this->tree = 
$DIC->repositoryTree();
 
   88        return $this->objPost->getThreadId();
 
   96        return $this->objPost->getId();
 
  114        return $this->closest_container !== 
null;
 
  138        return $this->objPost->getSubject();
 
  146        return $this->objPost->getMessage();
 
  154        return $this->objPost->getDisplayUserId();
 
  162        return $this->objPost->getCreateDate();
 
  170        return $this->objPost->getChangeDate();
 
  177        return $this->objPost->isCensored();
 
  185        return $this->objPost->getCensoredDate();
 
  190        return $this->objPost->getCensorshipComment();
 
  206        return $this->objPost->getUserAlias();
 
  221        return $this->objPost->getImportName();
 
  229        return $this->objPost->getUpdateUserId();
 
  237        if ($this->post_user_name === 
null) {
 
  257        if ($this->update_user_name === 
null) {
 
  270        if ($this->objPost->getUserAlias() && $this->objPost->getDisplayUserId() == 0
 
  271            && $this->objPost->getPosAuthorId() == $this->objPost->getUpdateUserId()) {
 
  272            return (
string) $this->objPost->getUserAlias();
 
  289            if ($authorinfo->
getAuthorName() && !$this->isAnonymized()) {
 
  312        $cacheKey = $this->notificationCache->createKeyByValues(array(
 
  317        if (
false === $this->notificationCache->exists($cacheKey)) {
 
  320                                SELECT thr_subject FROM frm_threads  
  323                array($this->objPost->getThreadId())
 
  326            $row = $this->db->fetchAssoc(
$result);
 
  327            $this->notificationCache->store($cacheKey, $row);
 
  330        $row = $this->notificationCache->fetch($cacheKey);
 
  331        $this->thread_title = $row[
'thr_subject'];
 
  339        $cacheKey = $this->notificationCache->createKeyByValues(array(
 
  344        if (
false === $this->notificationCache->exists($cacheKey)) {
 
  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',
 
  355            $row = $this->db->fetchAssoc(
$result);
 
  362            $this->notificationCache->store($cacheKey, $row);
 
  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;
 
  371        $this->is_anonymized = (bool) $row[
'anonymized'];
 
  376        $cacheKey = $this->notificationCache->createKeyByValues([
 
  381        if (
false === $this->notificationCache->exists($cacheKey)) {
 
  382            $ref_id = $this->tree->checkForParentType($frm_ref_id, 
'crs');
 
  384                $ref_id = $this->tree->checkForParentType($frm_ref_id, 
'grp');
 
  389                $this->notificationCache->store($cacheKey, 
$container);
 
  404            $filesOfPost = $fileDataForum->getFilesOfPost();
 
  408            foreach ($filesOfPost as $attachment) {
 
  409                $this->attachments[$attachment[
'path']] = $attachment[
'name'];
 
  410                $fileDataMail->copyAttachmentFile($attachment[
'path'], $attachment[
'name']);
 
  420        $cacheKey = $this->notificationCache->createKeyByValues(array(
 
  426        if (
false === $this->notificationCache->exists($cacheKey)) {
 
  427            $res = $this->db->queryf(
 
  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'),
 
  439            $this->notificationCache->store($cacheKey, $rcps);
 
  442        $rcps = $this->notificationCache->fetch($cacheKey);
 
  444        return array_unique($rcps);
 
  456        $cacheKey = $this->notificationCache->createKeyByValues(array(
 
  462        if (
false === $this->notificationCache->exists($cacheKey)) {
 
  463            $res = $this->db->queryF(
 
  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'),
 
  475            $this->notificationCache->store($cacheKey, $usrIds);
 
  478        $usrIds = $this->notificationCache->fetch($cacheKey);
 
  488        $cacheKey = $this->notificationCache->createKeyByValues(array(
 
  490            $this->objPost->getParentId()
 
  493        if (
false === $this->notificationCache->exists($cacheKey)) {
 
  494            $parent_objPost = 
new ilForumPost($this->objPost->getParentId());
 
  496            $this->notificationCache->store($cacheKey, $parent_objPost);
 
  499        $parent_objPost = $this->notificationCache->fetch($cacheKey);
 
  501        $rcps[] = $parent_objPost->getPosAuthorId();
 
  511        $cacheKey = $this->notificationCache->createKeyByValues(array(
 
  516        if (
false === $this->notificationCache->exists($cacheKey)) {
 
  519            $this->notificationCache->store($cacheKey, $rcps);
 
  522        $rcps = $this->notificationCache->fetch($cacheKey);
 
  524        return (array) $rcps;
 
  549        $cacheKey = $this->notificationCache->createKeyByValues([
 
  554        if (!$this->notificationCache->exists($cacheKey)) {
 
  558        return $this->notificationCache->fetch($cacheKey);
 
  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'];
 
  589        if ($this->objPost->getUserAlias() && $this->objPost->getDisplayUserId() == 0
 
  590            && $this->objPost->getPosAuthorId() == 
$DIC->user()->getId()) {
 
  591            return (
string) $this->objPost->getUserAlias();
 
  593            return $DIC->user()->getLogin();
 
An exception for terminatinating execution or to throw for unit testing.
This class handles all operations on files for the forum object.
Class ilForumNotificationCache.
static isSendAttachmentsByMailEnabled()
static _getModerators($a_ref_id)
get all users assigned to local role il_frm_moderator_<frm_ref_id> (static)
Class ilObjForumNotificationDataProvider.
getPostAnsweredRecipients()
getPublicUserInformation(ilForumAuthorInformation $authorinfo)
createRecipientArray(\ilPDOStatement $statement)
determineClosestContainer(int $frm_ref_id)
__construct(ilForumPost $objPost, $ref_id, \ilForumNotificationCache $notificationCache)
setPosAuthorId($pos_author_id)
getPostUserName(\ilLanguage $user_lang)
string
getThreadNotificationRecipients()
getForumNotificationRecipients()
getRefIdsByObjId(int $objId)
getPostUpdateUserName(\ilLanguage $user_lang)
string
getPostActivationRecipients()
providesClosestContainer()
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
static _getAllReferences($a_id)
get all reference ids of object
Class ilPDOStatement is a Wrapper Class for PDOStatement.
Interface ilForumNotificationMailData.
foreach($_POST as $key=> $value) $res