ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilForumPost Class Reference
+ Collaboration diagram for ilForumPost:

Public Member Functions

 __construct (private int $id=0, bool $a_is_moderator=false, bool $preventImplicitRead=false)
 
 insert ()
 
 update ()
 
 isAnyParentDeactivated ()
 
 reload ()
 
 activatePost ()
 
 activatePostAndChildPosts ()
 
 activateParentPosts ()
 
 isPostRead ()
 
 isRead (int $a_user_id=0)
 
 hasReplies ()
 
 isOwner (int $a_user_id=0)
 
 setId (int $a_id)
 
 getId ()
 
 setForumId (int $a_forum_id)
 
 getForumId ()
 
 setThreadId (int $a_thread_id)
 
 getThreadId ()
 
 getRCID ()
 
 setRCID (string $rcid)
 
 setDisplayUserId (int $a_user_id)
 
 getDisplayUserId ()
 
 setUserAlias (?string $a_user_alias)
 
 getUserAlias ()
 
 setSubject (string $a_subject)
 
 getSubject ()
 
 setMessage (string $a_message)
 
 getMessage ()
 
 setCreateDate (?string $a_createdate)
 
 getCreateDate ()
 
 setChangeDate (?string $a_changedate)
 
 getChangeDate ()
 
 setUpdateUserId (int $a_user_id_update)
 
 getUpdateUserId ()
 
 setCensorship (bool $a_censorship)
 
 isCensored ()
 
 setCensorshipComment (?string $a_comment)
 
 getCensorshipComment ()
 
 setNotification (bool $a_notification)
 
 isNotificationEnabled ()
 
 setImportName (?string $a_import_name)
 
 getImportName ()
 
 setStatus (bool $a_status)
 
 isActivated ()
 
 setTreeId (int $a_tree_id)
 
 getTreeId ()
 
 setParentId (int $a_parent_id)
 
 setIsRead (bool $a_is_read)
 
 getIsRead ()
 
 getParentId ()
 
 setLft (int $a_lft)
 
 getLft ()
 
 setRgt (int $a_rgt)
 
 getRgt ()
 
 setDepth (int $a_depth)
 
 getDepth ()
 
 setThread (ilForumTopic $thread)
 
 getThread ()
 
 setPosAuthorId (int $pos_author_id)
 
 getPosAuthorId ()
 
 isAuthorModerator ()
 
 setIsAuthorModerator (?bool $is_author_moderator)
 
 getCensoredDate ()
 
 getPostActivationDate ()
 
 setPostActivationDate (?string $post_activation_date)
 
 setCensoredDate (?string $censored_date)
 
 assignData (array $row)
 

Static Public Member Functions

static mergePosts (int $sourceThreadId, int $targetThreadId, array $excludedPostIds=[])
 
static lookupNotificationStatusByPostId (int $post_id)
 
static lookupPostMessage (int $post_id)
 

Data Fields

const NO_RCID = '-'
 

Private Member Functions

 read ()
 

Private Attributes

int $forum_id = 0
 
int $thread_id = 0
 
int $display_user_id = 0
 
string $user_alias = null
 
string $subject = ''
 
string $message = ''
 
string $createdate = null
 
string $changedate = null
 
int $user_id_update = 0
 
bool $censored = false
 
string $censorship_comment = null
 
string $censored_date = null
 
bool $notification = false
 
string $import_name = null
 
bool $status = true
 
int $tree_id = 0
 
int $parent_id = 0
 
int $lft = 0
 
int $rgt = 0
 
int $depth = 0
 
ilForumTopic $objThread = null
 
readonly ilDBInterface $db
 
bool $is_moderator = false
 
bool $is_author_moderator = false
 
bool $post_read = false
 
int $pos_author_id = 0
 
string $post_activation_date = null
 
string $rcid = self::NO_RCID
 

Detailed Description

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de \

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

Constructor & Destructor Documentation

◆ __construct()

ilForumPost::__construct ( private int  $id = 0,
bool  $a_is_moderator = false,
bool  $preventImplicitRead = false 
)

Definition at line 57 of file class.ilForumPost.php.

58 {
59 global $DIC;
60
61 $this->db = $DIC->database();
62
63 if (!$preventImplicitRead) {
64 $this->read();
65 }
66 }
global $DIC
Definition: shib_login.php:26

References $DIC, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ activateParentPosts()

ilForumPost::activateParentPosts ( )

Definition at line 253 of file class.ilForumPost.php.

253 : bool
254 {
255 if ($this->id !== 0) {
256 $query = "SELECT pos_pk FROM frm_posts "
257 . "INNER JOIN frm_posts_tree ON pos_fk = pos_pk "
258 . "WHERE lft < %s AND rgt > %s AND thr_fk = %s";
259 $result = $this->db->queryF(
260 $query,
261 ['integer', 'integer', 'integer'],
262 [$this->lft, $this->rgt, $this->thread_id]
263 );
264
265 $now = date('Y-m-d H:i:s');
266 while ($row = $this->db->fetchAssoc($result)) {
267 $this->db->update(
268 'frm_posts',
269 [
270 'pos_status' => ['integer', 1],
271 'pos_activation_date' => ['timestamp', $now]
272 ],
273 ['pos_pk' => ['integer', $row['pos_pk']]]
274 );
275 }
276
277 return true;
278 }
279
280 return false;
281 }

Referenced by activatePost(), and activatePostAndChildPosts().

+ Here is the caller graph for this function:

◆ activatePost()

ilForumPost::activatePost ( )

Definition at line 200 of file class.ilForumPost.php.

200 : void
201 {
202 if ($this->id !== 0) {
203 $now = date('Y-m-d H:i:s');
204 $this->db->update(
205 'frm_posts',
206 [
207 'pos_status' => ['integer', 1],
208 'pos_activation_date' => ['timestamp', $now]
209 ],
210 ['pos_pk' => ['integer', $this->id]]
211 );
212
213 $this->activateParentPosts();
214 $this->setPostActivationDate($now);
215 $this->setStatus(true);
216 }
217 }
setStatus(bool $a_status)
setPostActivationDate(?string $post_activation_date)

References activateParentPosts(), setPostActivationDate(), and setStatus().

+ Here is the call graph for this function:

◆ activatePostAndChildPosts()

ilForumPost::activatePostAndChildPosts ( )

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

219 : bool
220 {
221 if ($this->id !== 0) {
222 $query = "SELECT pos_pk FROM frm_posts_tree treea "
223 . "INNER JOIN frm_posts_tree treeb ON treeb.thr_fk = treea.thr_fk "
224 . "AND treeb.lft BETWEEN treea.lft AND treea.rgt "
225 . "INNER JOIN frm_posts ON pos_pk = treeb.pos_fk "
226 . "WHERE treea.pos_fk = %s";
227 $result = $this->db->queryF(
228 $query,
229 ['integer'],
230 [$this->id]
231 );
232
233 $now = date('Y-m-d H:i:s');
234 while ($row = $this->db->fetchAssoc($result)) {
235 $this->db->update(
236 'frm_posts',
237 [
238 'pos_status' => ['integer', 1],
239 'pos_activation_date' => ['timestamp', $now]
240 ],
241 ['pos_pk' => ['integer', $row['pos_pk']]]
242 );
243 }
244
245 $this->activateParentPosts();
246
247 return true;
248 }
249
250 return false;
251 }

References activateParentPosts().

+ Here is the call graph for this function:

◆ assignData()

ilForumPost::assignData ( array  $row)

Definition at line 597 of file class.ilForumPost.php.

597 : void
598 {
599 $this->setUserAlias((string) $row['pos_usr_alias']);
600 $this->setSubject((string) $row['pos_subject']);
601 $this->setCreateDate($row['pos_date']);
602 $this->setMessage((string) $row['pos_message']);
603 $this->setForumId((int) $row['pos_top_fk']);
604 $this->setThreadId((int) $row['pos_thr_fk']);
605 $this->setChangeDate($row['pos_update']);
606 $this->setUpdateUserId((int) $row['update_user']);
607 $this->setCensorship((bool) $row['pos_cens']);
608 $this->setCensoredDate($row['pos_cens_date'] ?? null);
609 $this->setCensorshipComment($row['pos_cens_com']);
610 $this->setNotification((bool) $row['notify']);
611 $this->setImportName($row['import_name']);
612 $this->setStatus((bool) $row['pos_status']);
613 $this->setTreeId((int) $row['fpt_pk']);
614 $this->setParentId((int) $row['parent_pos']);
615 $this->setLft((int) $row['lft']);
616 $this->setRgt((int) $row['rgt']);
617 $this->setDepth((int) $row['depth']);
618 $this->setIsRead(isset($row['post_read']) && (int) $row['post_read']);
619 $this->setDisplayUserId((int) $row['pos_display_user_id']);
620 $this->setPosAuthorId((int) $row['pos_author_id']);
621 $this->setIsAuthorModerator((bool) $row['is_author_moderator']);
622 $this->setRCID((string) ($row['rcid'] ?? self::NO_RCID));
623 }
setUpdateUserId(int $a_user_id_update)
setIsAuthorModerator(?bool $is_author_moderator)
setForumId(int $a_forum_id)
setDisplayUserId(int $a_user_id)
setRgt(int $a_rgt)
setParentId(int $a_parent_id)
setImportName(?string $a_import_name)
setSubject(string $a_subject)
setCensorshipComment(?string $a_comment)
setMessage(string $a_message)
setPosAuthorId(int $pos_author_id)
setLft(int $a_lft)
setIsRead(bool $a_is_read)
setCensorship(bool $a_censorship)
setNotification(bool $a_notification)
setUserAlias(?string $a_user_alias)
setTreeId(int $a_tree_id)
setChangeDate(?string $a_changedate)
setCreateDate(?string $a_createdate)
setDepth(int $a_depth)
setRCID(string $rcid)
setThreadId(int $a_thread_id)
setCensoredDate(?string $censored_date)

References setCensoredDate(), setCensorship(), setCensorshipComment(), setChangeDate(), setCreateDate(), setDepth(), setDisplayUserId(), setForumId(), setImportName(), setIsAuthorModerator(), setIsRead(), setLft(), setMessage(), setNotification(), setParentId(), setPosAuthorId(), setRCID(), setRgt(), setStatus(), setSubject(), setThreadId(), setTreeId(), setUpdateUserId(), and setUserAlias().

+ Here is the call graph for this function:

◆ getCensoredDate()

ilForumPost::getCensoredDate ( )

Definition at line 577 of file class.ilForumPost.php.

577 : ?string
578 {
580 }

References $censored_date.

◆ getCensorshipComment()

ilForumPost::getCensorshipComment ( )

Definition at line 452 of file class.ilForumPost.php.

452 : ?string
453 {
455 }
string $censorship_comment

References $censorship_comment.

◆ getChangeDate()

ilForumPost::getChangeDate ( )

Definition at line 422 of file class.ilForumPost.php.

422 : ?string
423 {
424 return $this->changedate;
425 }

References $changedate.

◆ getCreateDate()

ilForumPost::getCreateDate ( )

Definition at line 412 of file class.ilForumPost.php.

412 : ?string
413 {
414 return $this->createdate;
415 }

References $createdate.

◆ getDepth()

ilForumPost::getDepth ( )

Definition at line 542 of file class.ilForumPost.php.

542 : int
543 {
544 return $this->depth;
545 }

References $depth.

◆ getDisplayUserId()

ilForumPost::getDisplayUserId ( )

Definition at line 372 of file class.ilForumPost.php.

372 : int
373 {
375 }

References $display_user_id.

Referenced by ilObjForumGUI\renderPostingForm().

+ Here is the caller graph for this function:

◆ getForumId()

ilForumPost::getForumId ( )

Definition at line 342 of file class.ilForumPost.php.

342 : int
343 {
344 return $this->forum_id;
345 }

References $forum_id.

Referenced by ilObjForumGUI\renderSplitButton().

+ Here is the caller graph for this function:

◆ getId()

ilForumPost::getId ( )

Definition at line 332 of file class.ilForumPost.php.

332 : int
333 {
334 return $this->id;
335 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id.

Referenced by ilObjForumGUI\addActivationFormModal(), and ilObjForumGUI\renderSplitButton().

+ Here is the caller graph for this function:

◆ getImportName()

ilForumPost::getImportName ( )

Definition at line 472 of file class.ilForumPost.php.

472 : ?string
473 {
474 return $this->import_name;
475 }

References $import_name.

Referenced by ilObjForumGUI\renderPostingForm().

+ Here is the caller graph for this function:

◆ getIsRead()

ilForumPost::getIsRead ( )

Definition at line 507 of file class.ilForumPost.php.

507 : bool
508 {
509 return $this->post_read;
510 }

References $post_read.

Referenced by isPostRead().

+ Here is the caller graph for this function:

◆ getLft()

ilForumPost::getLft ( )

Definition at line 522 of file class.ilForumPost.php.

522 : int
523 {
524 return $this->lft;
525 }

References $lft.

Referenced by ilForumTopic\getPostTree().

+ Here is the caller graph for this function:

◆ getMessage()

ilForumPost::getMessage ( )

Definition at line 402 of file class.ilForumPost.php.

402 : string
403 {
404 return $this->message;
405 }

References $message.

Referenced by ilObjForumGUI\renderPostingForm().

+ Here is the caller graph for this function:

◆ getParentId()

ilForumPost::getParentId ( )

Definition at line 512 of file class.ilForumPost.php.

512 : int
513 {
514 return $this->parent_id;
515 }

References $parent_id.

◆ getPosAuthorId()

ilForumPost::getPosAuthorId ( )

Definition at line 562 of file class.ilForumPost.php.

562 : int
563 {
565 }

References $pos_author_id.

Referenced by ilObjForumGUI\renderPostingForm().

+ Here is the caller graph for this function:

◆ getPostActivationDate()

ilForumPost::getPostActivationDate ( )

Definition at line 582 of file class.ilForumPost.php.

582 : ?string
583 {
585 }
string $post_activation_date

References $post_activation_date.

◆ getRCID()

ilForumPost::getRCID ( )

Definition at line 357 of file class.ilForumPost.php.

357 : string
358 {
359 return $this->rcid;
360 }

References $rcid.

◆ getRgt()

ilForumPost::getRgt ( )

Definition at line 532 of file class.ilForumPost.php.

532 : int
533 {
534 return $this->rgt;
535 }

References $rgt.

Referenced by ilForumTopic\getPostTree().

+ Here is the caller graph for this function:

◆ getSubject()

ilForumPost::getSubject ( )

Definition at line 392 of file class.ilForumPost.php.

392 : string
393 {
394 return $this->subject;
395 }

References $subject.

◆ getThread()

ilForumPost::getThread ( )

Definition at line 552 of file class.ilForumPost.php.

552 : ?ilForumTopic
553 {
554 return $this->objThread;
555 }
ilForumTopic $objThread

References $objThread.

◆ getThreadId()

ilForumPost::getThreadId ( )

Definition at line 352 of file class.ilForumPost.php.

352 : int
353 {
354 return $this->thread_id;
355 }

References $thread_id.

Referenced by ilObjForumGUI\addActivationFormModal(), ilForumTopic\getPostTree(), and ilObjForumGUI\renderSplitButton().

+ Here is the caller graph for this function:

◆ getTreeId()

ilForumPost::getTreeId ( )

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

492 : int
493 {
494 return $this->tree_id;
495 }

References $tree_id.

◆ getUpdateUserId()

ilForumPost::getUpdateUserId ( )

Definition at line 432 of file class.ilForumPost.php.

432 : int
433 {
435 }

References $user_id_update.

Referenced by ilForumExportGUI\renderPostHtml().

+ Here is the caller graph for this function:

◆ getUserAlias()

ilForumPost::getUserAlias ( )

Definition at line 382 of file class.ilForumPost.php.

382 : ?string
383 {
384 return $this->user_alias;
385 }

References $user_alias.

Referenced by ilObjForumGUI\renderPostingForm().

+ Here is the caller graph for this function:

◆ hasReplies()

ilForumPost::hasReplies ( )

Definition at line 303 of file class.ilForumPost.php.

303 : bool
304 {
305 if ($this->id && $this->rgt && $this->lft) {
306 $res = $this->db->queryF(
307 'SELECT * FROM frm_posts_tree WHERE lft > %s AND rgt < %s AND thr_fk = %s',
308 ['integer', 'integer', 'integer'],
309 [$this->lft, $this->rgt, $this->thread_id]
310 );
311
312 return $res->numRows() > 0;
313 }
314
315 return false;
316 }
$res
Definition: ltiservices.php:69

References $res.

Referenced by ilObjForumGUI\renderSplitButton().

+ Here is the caller graph for this function:

◆ insert()

ilForumPost::insert ( )

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

68 : void
69 {
70 if ($this->forum_id && $this->thread_id) {
71 $this->id = $this->db->nextId('frm_posts');
72
73 $this->db->insert('frm_posts', [
74 'pos_pk' => ['integer', $this->id],
75 'pos_top_fk' => ['integer', $this->forum_id],
76 'pos_thr_fk' => ['integer', $this->thread_id],
77 'pos_display_user_id' => ['integer', $this->display_user_id],
78 'pos_usr_alias' => ['text', $this->user_alias],
79 'pos_subject' => ['text', $this->subject],
80 'pos_message' => ['clob', $this->message],
81 'pos_date' => ['timestamp', $this->createdate],
82 'pos_update' => ['timestamp', $this->createdate],
83 'update_user' => ['integer', $this->user_id_update],
84 'pos_cens' => ['integer', (int) $this->censored],
85 'notify' => ['integer', (int) $this->notification],
86 'import_name' => ['text', $this->import_name],
87 'pos_status' => ['integer', (int) $this->status],
88 'pos_author_id' => ['integer', $this->pos_author_id],
89 'is_author_moderator' => ['integer', $this->is_author_moderator],
90 'pos_activation_date' => ['timestamp', $this->createdate]
91 ]);
92 }
93 }

References ILIAS\UI\examples\Symbol\Glyph\Notification\notification().

+ Here is the call graph for this function:

◆ isActivated()

ilForumPost::isActivated ( )

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

482 : bool
483 {
484 return $this->status;
485 }

References $status.

Referenced by ilObjForumGUI\renderSplitButton().

+ Here is the caller graph for this function:

◆ isAnyParentDeactivated()

ilForumPost::isAnyParentDeactivated ( )

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

175 : bool
176 {
177 if ($this->id !== 0) {
178 $res = $this->db->queryF(
179 '
180 SELECT * FROM frm_posts_tree
181 INNER JOIN frm_posts ON pos_pk = pos_fk
182 WHERE pos_status = %s
183 AND lft < %s AND rgt > %s
184 AND thr_fk = %s',
185 ['integer', 'integer', 'integer', 'integer'],
186 [0, $this->lft, $this->rgt, $this->thread_id]
187 );
188
189 return $res->numRows() > 0;
190 }
191
192 return false;
193 }

References $res.

◆ isAuthorModerator()

ilForumPost::isAuthorModerator ( )

Definition at line 567 of file class.ilForumPost.php.

567 : ?bool
568 {
570 }

References $is_author_moderator.

◆ isCensored()

ilForumPost::isCensored ( )

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

442 : bool
443 {
444 return $this->censored;
445 }

References $censored.

Referenced by ilObjForumGUI\renderPostingForm(), and ilObjForumGUI\renderSplitButton().

+ Here is the caller graph for this function:

◆ isNotificationEnabled()

ilForumPost::isNotificationEnabled ( )

Definition at line 462 of file class.ilForumPost.php.

462 : bool
463 {
464 return $this->notification;
465 }

References $notification.

◆ isOwner()

ilForumPost::isOwner ( int  $a_user_id = 0)

Definition at line 318 of file class.ilForumPost.php.

318 : bool
319 {
320 if ($this->pos_author_id && $a_user_id) {
321 return $this->pos_author_id === $a_user_id;
322 }
323
324 return false;
325 }

Referenced by ilObjForumGUI\renderPostingForm(), and ilObjForumGUI\renderSplitButton().

+ Here is the caller graph for this function:

◆ isPostRead()

ilForumPost::isPostRead ( )

Definition at line 283 of file class.ilForumPost.php.

283 : bool
284 {
285 return $this->getIsRead();
286 }

References getIsRead().

Referenced by ilObjForumGUI\renderSplitButton().

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

◆ isRead()

ilForumPost::isRead ( int  $a_user_id = 0)

Definition at line 288 of file class.ilForumPost.php.

288 : bool
289 {
290 if ($a_user_id && $this->id) {
291 $res = $this->db->queryF(
292 'SELECT * FROM frm_user_read WHERE usr_id = %s AND post_id = %s',
293 ['integer', 'integer'],
294 [$a_user_id, $this->id]
295 );
296
297 return $res->numRows() > 0;
298 }
299
300 return false;
301 }

References $res.

◆ lookupNotificationStatusByPostId()

static ilForumPost::lookupNotificationStatusByPostId ( int  $post_id)
static

Definition at line 645 of file class.ilForumPost.php.

645 : bool
646 {
647 global $DIC;
648
649 $res = $DIC->database()->queryF(
650 'SELECT notify FROM frm_posts WHERE pos_pk = %s',
651 ['integer'],
652 [$post_id]
653 );
654
655 $row = $DIC->database()->fetchAssoc($res);
656 return (bool) $row['notify'];
657 }

References $DIC, and $res.

◆ lookupPostMessage()

static ilForumPost::lookupPostMessage ( int  $post_id)
static

Definition at line 659 of file class.ilForumPost.php.

659 : string
660 {
661 global $DIC;
662 $ilDB = $DIC->database();
663
664 $res = $ilDB->queryF(
665 'SELECT pos_message FROM frm_posts WHERE pos_pk = %s',
666 ['integer'],
667 [$post_id]
668 );
669
670 if ($row = $ilDB->fetchObject($res)) {
671 return $row->pos_message ?: '';
672 }
673
674 return '';
675 }

References $DIC, $ilDB, and $res.

◆ mergePosts()

static ilForumPost::mergePosts ( int  $sourceThreadId,
int  $targetThreadId,
array  $excludedPostIds = [] 
)
static
Parameters
int[]$excludedPostIds

Definition at line 628 of file class.ilForumPost.php.

628 : void
629 {
630 global $DIC;
631 $ilDB = $DIC->database();
632
633 $conditions = ['pos_thr_fk = ' . $ilDB->quote($sourceThreadId, 'integer')];
634 if ($excludedPostIds !== []) {
635 $conditions[] = $ilDB->in('pos_pk', $excludedPostIds, true, 'integer');
636 }
637
638 $ilDB->manipulateF(
639 'UPDATE frm_posts SET pos_thr_fk = %s WHERE ' . implode(' AND ', $conditions),
640 ['integer',],
641 [$targetThreadId,]
642 );
643 }

References $DIC, and $ilDB.

Referenced by ilForum\mergeThreads().

+ Here is the caller graph for this function:

◆ read()

ilForumPost::read ( )
private

Definition at line 131 of file class.ilForumPost.php.

131 : void
132 {
133 if ($this->id !== 0) {
134 $res = $this->db->queryF(
135 '
136 SELECT * FROM frm_posts
137 INNER JOIN frm_posts_tree ON pos_fk = pos_pk
138 WHERE pos_pk = %s',
139 ['integer'],
140 [$this->id]
141 );
142 $row = $this->db->fetchObject($res);
143
144 if (is_object($row)) {
145 $this->id = (int) $row->pos_pk;
146 $this->forum_id = (int) $row->pos_top_fk;
147 $this->thread_id = (int) $row->pos_thr_fk;
148 $this->display_user_id = (int) $row->pos_display_user_id;
149 $this->user_alias = $row->pos_usr_alias;
150 $this->subject = (string) $row->pos_subject;
151 $this->message = (string) $row->pos_message;
152 $this->createdate = $row->pos_date;
153 $this->changedate = $row->pos_update;
154 $this->user_id_update = (int) $row->update_user;
155 $this->censored = (bool) $row->pos_cens;
156 $this->censored_date = $row->pos_cens_date;
157 $this->censorship_comment = $row->pos_cens_com;
158 $this->notification = (bool) $row->notify;
159 $this->import_name = $row->import_name;
160 $this->status = (bool) $row->pos_status;
161 $this->tree_id = (int) $row->fpt_pk;
162 $this->parent_id = (int) $row->parent_pos;
163 $this->lft = (int) $row->lft;
164 $this->rgt = (int) $row->rgt;
165 $this->depth = (int) $row->depth;
166 $this->pos_author_id = (int) $row->pos_author_id;
167 $this->is_author_moderator = (bool) $row->is_author_moderator;
168 $this->post_activation_date = $row->pos_activation_date;
169 $this->rcid = (string) $row->rcid;
170 $this->objThread = new ilForumTopic($this->thread_id, $this->is_moderator);
171 }
172 }
173 }

References $res, ILIAS\Repository\int(), and ILIAS\UI\examples\Symbol\Glyph\Notification\notification().

Referenced by __construct(), and reload().

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

◆ reload()

ilForumPost::reload ( )

Definition at line 195 of file class.ilForumPost.php.

195 : void
196 {
197 $this->read();
198 }

References read().

+ Here is the call graph for this function:

◆ setCensoredDate()

ilForumPost::setCensoredDate ( ?string  $censored_date)

Definition at line 592 of file class.ilForumPost.php.

592 : void
593 {
594 $this->censored_date = $censored_date;
595 }

References $censored_date.

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setCensorship()

ilForumPost::setCensorship ( bool  $a_censorship)

Definition at line 437 of file class.ilForumPost.php.

437 : void
438 {
439 $this->censored = $a_censorship;
440 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setCensorshipComment()

ilForumPost::setCensorshipComment ( ?string  $a_comment)

Definition at line 447 of file class.ilForumPost.php.

447 : void
448 {
449 $this->censorship_comment = $a_comment;
450 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setChangeDate()

ilForumPost::setChangeDate ( ?string  $a_changedate)

Definition at line 417 of file class.ilForumPost.php.

417 : void
418 {
419 $this->changedate = $a_changedate;
420 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setCreateDate()

ilForumPost::setCreateDate ( ?string  $a_createdate)

Definition at line 407 of file class.ilForumPost.php.

407 : void
408 {
409 $this->createdate = $a_createdate;
410 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setDepth()

ilForumPost::setDepth ( int  $a_depth)

Definition at line 537 of file class.ilForumPost.php.

537 : void
538 {
539 $this->depth = $a_depth;
540 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setDisplayUserId()

ilForumPost::setDisplayUserId ( int  $a_user_id)

Definition at line 367 of file class.ilForumPost.php.

367 : void
368 {
369 $this->display_user_id = $a_user_id;
370 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setForumId()

ilForumPost::setForumId ( int  $a_forum_id)

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

337 : void
338 {
339 $this->forum_id = $a_forum_id;
340 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setId()

ilForumPost::setId ( int  $a_id)

Definition at line 327 of file class.ilForumPost.php.

327 : void
328 {
329 $this->id = $a_id;
330 }

◆ setImportName()

ilForumPost::setImportName ( ?string  $a_import_name)

Definition at line 467 of file class.ilForumPost.php.

467 : void
468 {
469 $this->import_name = $a_import_name;
470 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setIsAuthorModerator()

ilForumPost::setIsAuthorModerator ( ?bool  $is_author_moderator)

Definition at line 572 of file class.ilForumPost.php.

572 : void
573 {
574 $this->is_author_moderator = $is_author_moderator;
575 }

References $is_author_moderator.

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setIsRead()

ilForumPost::setIsRead ( bool  $a_is_read)

Definition at line 502 of file class.ilForumPost.php.

502 : void
503 {
504 $this->post_read = $a_is_read;
505 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setLft()

ilForumPost::setLft ( int  $a_lft)

Definition at line 517 of file class.ilForumPost.php.

517 : void
518 {
519 $this->lft = $a_lft;
520 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setMessage()

ilForumPost::setMessage ( string  $a_message)

Definition at line 397 of file class.ilForumPost.php.

397 : void
398 {
399 $this->message = $a_message;
400 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setNotification()

ilForumPost::setNotification ( bool  $a_notification)

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

457 : void
458 {
459 $this->notification = $a_notification;
460 }

References ILIAS\UI\examples\Symbol\Glyph\Notification\notification().

Referenced by assignData().

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

◆ setParentId()

ilForumPost::setParentId ( int  $a_parent_id)

Definition at line 497 of file class.ilForumPost.php.

497 : void
498 {
499 $this->parent_id = $a_parent_id;
500 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setPosAuthorId()

ilForumPost::setPosAuthorId ( int  $pos_author_id)

Definition at line 557 of file class.ilForumPost.php.

557 : void
558 {
559 $this->pos_author_id = $pos_author_id;
560 }

References $pos_author_id.

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setPostActivationDate()

ilForumPost::setPostActivationDate ( ?string  $post_activation_date)

Definition at line 587 of file class.ilForumPost.php.

587 : void
588 {
589 $this->post_activation_date = $post_activation_date;
590 }

References $post_activation_date.

Referenced by activatePost().

+ Here is the caller graph for this function:

◆ setRCID()

ilForumPost::setRCID ( string  $rcid)

Definition at line 362 of file class.ilForumPost.php.

362 : void
363 {
364 $this->rcid = $rcid;
365 }

References $rcid.

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setRgt()

ilForumPost::setRgt ( int  $a_rgt)

Definition at line 527 of file class.ilForumPost.php.

527 : void
528 {
529 $this->rgt = $a_rgt;
530 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setStatus()

ilForumPost::setStatus ( bool  $a_status)

Definition at line 477 of file class.ilForumPost.php.

477 : void
478 {
479 $this->status = $a_status;
480 }

Referenced by activatePost(), and assignData().

+ Here is the caller graph for this function:

◆ setSubject()

ilForumPost::setSubject ( string  $a_subject)

Definition at line 387 of file class.ilForumPost.php.

387 : void
388 {
389 $this->subject = $a_subject;
390 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setThread()

ilForumPost::setThread ( ilForumTopic  $thread)

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

547 : void
548 {
549 $this->objThread = $thread;
550 }

◆ setThreadId()

ilForumPost::setThreadId ( int  $a_thread_id)

Definition at line 347 of file class.ilForumPost.php.

347 : void
348 {
349 $this->thread_id = $a_thread_id;
350 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setTreeId()

ilForumPost::setTreeId ( int  $a_tree_id)

Definition at line 487 of file class.ilForumPost.php.

487 : void
488 {
489 $this->tree_id = $a_tree_id;
490 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setUpdateUserId()

ilForumPost::setUpdateUserId ( int  $a_user_id_update)

Definition at line 427 of file class.ilForumPost.php.

427 : void
428 {
429 $this->user_id_update = $a_user_id_update;
430 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setUserAlias()

ilForumPost::setUserAlias ( ?string  $a_user_alias)

Definition at line 377 of file class.ilForumPost.php.

377 : void
378 {
379 $this->user_alias = $a_user_alias;
380 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ update()

ilForumPost::update ( )

Definition at line 95 of file class.ilForumPost.php.

95 : bool
96 {
97 if ($this->id !== 0) {
98 $this->db->update(
99 'frm_posts',
100 [
101 'pos_top_fk' => ['integer', $this->forum_id],
102 'pos_thr_fk' => ['integer', $this->thread_id],
103 'pos_subject' => ['text', $this->subject],
104 'pos_message' => ['clob', $this->message],
105 'pos_update' => ['timestamp', $this->changedate],
106 'update_user' => ['integer', $this->user_id_update],
107 'pos_cens' => ['integer', (int) $this->censored],
108 'pos_cens_date' => ['timestamp', $this->censored_date],
109 'pos_cens_com' => ['text', $this->censorship_comment],
110 'notify' => ['integer', (int) $this->notification],
111 'pos_status' => ['integer', (int) $this->status],
112 'rcid' => ['text', ($this->rcid ?? self::NO_RCID)]
113 ],
114 [
115 'pos_pk' => ['integer', $this->id]
116 ]
117 );
118
119 if ($this->objThread->getFirstVisiblePostId() === $this->id) {
120 $this->objThread->setSubject($this->subject);
121 $this->objThread->update();
122 $this->objThread->reload();
123 }
124
125 return true;
126 }
127
128 return false;
129 }

References ILIAS\UI\examples\Symbol\Glyph\Notification\notification().

+ Here is the call graph for this function:

Field Documentation

◆ $censored

bool ilForumPost::$censored = false
private

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

Referenced by isCensored().

◆ $censored_date

string ilForumPost::$censored_date = null
private

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

Referenced by getCensoredDate(), and setCensoredDate().

◆ $censorship_comment

string ilForumPost::$censorship_comment = null
private

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

Referenced by getCensorshipComment().

◆ $changedate

string ilForumPost::$changedate = null
private

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

Referenced by getChangeDate().

◆ $createdate

string ilForumPost::$createdate = null
private

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

Referenced by getCreateDate().

◆ $db

readonly ilDBInterface ilForumPost::$db
private

Definition at line 49 of file class.ilForumPost.php.

◆ $depth

int ilForumPost::$depth = 0
private

Definition at line 47 of file class.ilForumPost.php.

Referenced by getDepth().

◆ $display_user_id

int ilForumPost::$display_user_id = 0
private

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

Referenced by getDisplayUserId().

◆ $forum_id

int ilForumPost::$forum_id = 0
private

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

Referenced by getForumId().

◆ $import_name

string ilForumPost::$import_name = null
private

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

Referenced by getImportName().

◆ $is_author_moderator

bool ilForumPost::$is_author_moderator = false
private

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

Referenced by isAuthorModerator(), and setIsAuthorModerator().

◆ $is_moderator

bool ilForumPost::$is_moderator = false
private

Definition at line 50 of file class.ilForumPost.php.

◆ $lft

int ilForumPost::$lft = 0
private

Definition at line 45 of file class.ilForumPost.php.

Referenced by getLft().

◆ $message

string ilForumPost::$message = ''
private

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

Referenced by getMessage().

◆ $notification

bool ilForumPost::$notification = false
private

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

Referenced by isNotificationEnabled().

◆ $objThread

ilForumTopic ilForumPost::$objThread = null
private

Definition at line 48 of file class.ilForumPost.php.

Referenced by getThread().

◆ $parent_id

int ilForumPost::$parent_id = 0
private

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

Referenced by getParentId().

◆ $pos_author_id

int ilForumPost::$pos_author_id = 0
private

Definition at line 53 of file class.ilForumPost.php.

Referenced by getPosAuthorId(), and setPosAuthorId().

◆ $post_activation_date

string ilForumPost::$post_activation_date = null
private

Definition at line 54 of file class.ilForumPost.php.

Referenced by getPostActivationDate(), and setPostActivationDate().

◆ $post_read

bool ilForumPost::$post_read = false
private

Definition at line 52 of file class.ilForumPost.php.

Referenced by getIsRead().

◆ $rcid

string ilForumPost::$rcid = self::NO_RCID
private

Definition at line 55 of file class.ilForumPost.php.

Referenced by getRCID(), and setRCID().

◆ $rgt

int ilForumPost::$rgt = 0
private

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

Referenced by getRgt().

◆ $status

bool ilForumPost::$status = true
private

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

Referenced by isActivated().

◆ $subject

string ilForumPost::$subject = ''
private

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

Referenced by getSubject().

◆ $thread_id

int ilForumPost::$thread_id = 0
private

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

Referenced by getThreadId().

◆ $tree_id

int ilForumPost::$tree_id = 0
private

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

Referenced by getTreeId().

◆ $user_alias

string ilForumPost::$user_alias = null
private

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

Referenced by getUserAlias().

◆ $user_id_update

int ilForumPost::$user_id_update = 0
private

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

Referenced by getUpdateUserId().

◆ NO_RCID

const ilForumPost::NO_RCID = '-'

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