ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilForumPost Class Reference
+ Collaboration diagram for ilForumPost:

Public Member Functions

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

Static Public Member Functions

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

Private Member Functions

 read ()
 

Private Attributes

 $id = 0
 
 $forum_id = 0
 
 $thread_id = 0
 
 $display_user_id = 0
 
 $user_alias = ''
 
 $subject = ''
 
 $message = ''
 
 $createdate = '0000-00-00 00:00:00'
 
 $changedate = '0000-00-00 00:00:00'
 
 $user_id_update = 0
 
 $censored = 0
 
 $censorship_comment = ''
 
 $censored_date = '0000-00-00 00:00:00'
 
 $notification = 0
 
 $import_name = ''
 
 $status = 1
 
 $tree_id = 0
 
 $parent_id = 0
 
 $lft = 0
 
 $rgt = 0
 
 $depth = 0
 
 $objThread = null
 
 $db = null
 
 $lng = null
 
 $is_moderator = false
 
 $is_author_moderator = null
 
 $post_read = false
 
 $pos_author_id = 0
 
 $post_activation_date = null
 

Detailed Description

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilForumPost::__construct (   $a_id = 0,
  $a_is_moderator = false,
  $preventImplicitRead = false 
)

ilForumPost constructor.

Parameters
int$a_id
bool$a_is_moderator
bool$preventImplicitRead

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

87 {
88 global $DIC;
89
90 $this->db = $DIC->database();
91 $this->lng = $DIC->language();
92 $this->id = $a_id;
93
94 if (!$preventImplicitRead) {
95 $this->read();
96 }
97 }
$DIC
Definition: xapitoken.php:46

References $DIC, and read().

+ Here is the call graph for this function:

◆ __destruct()

ilForumPost::__destruct ( )

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

100 {
101 unset($this->db);
102 unset($this->objThread);
103 }

Member Function Documentation

◆ activateParentPosts()

ilForumPost::activateParentPosts ( )

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

299 {
300 if ($this->id) {
301 $query = "SELECT pos_pk FROM frm_posts "
302 . "INNER JOIN frm_posts_tree ON pos_fk = pos_pk "
303 . "WHERE lft < %s AND rgt > %s AND thr_fk = %s";
304 $result = $this->db->queryF(
305 $query,
306 array('integer', 'integer', 'integer'),
307 array($this->lft, $this->rgt, $this->thread_id)
308 );
309
310 $now = date("Y-m-d H:i:s");
311 while ($row = $this->db->fetchAssoc($result)) {
312 $this->db->update(
313 'frm_posts',
314 array('pos_status' => array('integer', 1),
315 'pos_activation_date' => array('timestamp', $now)),
316 array('pos_pk' => array('integer', $row['pos_pk']))
317 );
318 }
319
320 return true;
321 }
322
323 return false;
324 }
$result
$query

References $query, and $result.

Referenced by activatePost(), and activatePostAndChildPosts().

+ Here is the caller graph for this function:

◆ activatePost()

ilForumPost::activatePost ( )

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

247 {
248 if ($this->id) {
249 $now = date("Y-m-d H:i:s");
250 $this->db->update(
251 'frm_posts',
252 array('pos_status' => array('integer', 1),
253 'pos_activation_date' => array('timestamp', $now)),
254 array('pos_pk' => array('integer', $this->id))
255 );
256
257 $this->activateParentPosts();
258 $this->setPostActivationDate($now);
259 $this->setStatus(1);
260 return true;
261 }
262
263 return false;
264 }
setStatus($a_status)
setPostActivationDate($post_activation_date)

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

+ Here is the call graph for this function:

◆ activatePostAndChildPosts()

ilForumPost::activatePostAndChildPosts ( )

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

267 {
268 if ($this->id) {
269 $query = "SELECT pos_pk FROM frm_posts_tree treea "
270 . "INNER JOIN frm_posts_tree treeb ON treeb.thr_fk = treea.thr_fk "
271 . "AND treeb.lft BETWEEN treea.lft AND treea.rgt "
272 . "INNER JOIN frm_posts ON pos_pk = treeb.pos_fk "
273 . "WHERE treea.pos_fk = %s";
274 $result = $this->db->queryF(
275 $query,
276 array('integer'),
277 array($this->id)
278 );
279
280 $now = date("Y-m-d H:i:s");
281 while ($row = $this->db->fetchAssoc($result)) {
282 $this->db->update(
283 'frm_posts',
284 array('pos_status' => array('integer', 1),
285 'pos_activation_date' => array('timestamp', $now)),
286 array('pos_pk' => array('integer', $row['pos_pk']))
287 );
288 }
289
290 $this->activateParentPosts();
291
292 return true;
293 }
294
295 return false;
296 }

References $query, $result, and activateParentPosts().

+ Here is the call graph for this function:

◆ assignData()

ilForumPost::assignData (   $row)
Parameters
$row

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

625 {
626 $this->setUserAlias($row['pos_usr_alias']);
627 $this->setSubject($row['pos_subject']);
628 $this->setCreateDate($row['pos_date']);
629 $this->setMessage($row['pos_message']);
630 $this->setForumId($row['pos_top_fk']);
631 $this->setThreadId($row['pos_thr_fk']);
632 $this->setChangeDate($row['pos_update']);
633 $this->setUpdateUserId($row['update_user']);
634 $this->setCensorship($row['pos_cens']);
635 $this->setCensoredDate($row['pos_cens_date']);
636 $this->setCensorshipComment($row['pos_cens_com']);
637 $this->setNotification($row['notify']);
638 $this->setImportName($row['import_name']);
639 $this->setStatus($row['pos_status']);
640 $this->setTreeId($row['fpt_pk']);
641 $this->setParentId($row['parent_pos']);
642 $this->setLft($row['lft']);
643 $this->setRgt($row['rgt']);
644 $this->setDepth($row['depth']);
645 $this->setIsRead($row['post_read']);
646 $this->setDisplayUserId($row['pos_display_user_id']);
647 $this->setPosAuthorId($row['pos_author_id']);
648 $this->setIsAuthorModerator($row['is_author_moderator']);
649 }
setNotification($a_notification)
setForumId($a_forum_id)
setTreeId($a_tree_id)
setCreateDate($a_createdate)
setCensorshipComment($a_comment)
setIsRead($a_is_read)
setCensorship($a_censorship)
setDepth($a_depth)
setThreadId($a_thread_id)
setIsAuthorModerator($is_author_moderator)
setImportName($a_import_name)
setPosAuthorId($pos_author_id)
setParentId($a_parent_id)
setUserAlias($a_user_alias)
setCensoredDate($censored_date)
setUpdateUserId($a_user_id_update)
setDisplayUserId($a_user_id)
setChangeDate($a_changedate)
setSubject($a_subject)
setMessage($a_message)

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

+ Here is the call graph for this function:

◆ getCensoredDate()

ilForumPost::getCensoredDate ( )
Returns
string

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

593 {
595 }

References $censored_date.

◆ getCensorshipComment()

ilForumPost::getCensorshipComment ( )

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

471 {
473 }

References $censorship_comment.

Referenced by ilObjForumGUI\renderPostContent(), and ilForumExportGUI\renderPostHtml().

+ Here is the caller graph for this function:

◆ getChangeDate()

ilForumPost::getChangeDate ( )

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

447 {
448 return $this->changedate;
449 }

References $changedate.

Referenced by ilObjForumGUI\renderPostContent(), and ilForumExportGUI\renderPostHtml().

+ Here is the caller graph for this function:

◆ getCreateDate()

ilForumPost::getCreateDate ( )

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

439 {
440 return $this->createdate;
441 }

References $createdate.

Referenced by ilObjForumGUI\renderPostContent(), and ilForumExportGUI\renderPostHtml().

+ Here is the caller graph for this function:

◆ getDepth()

ilForumPost::getDepth ( )

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

546 {
547 return $this->depth;
548 }

References $depth.

Referenced by ilObjForumGUI\renderDraftContent(), and ilObjForumGUI\renderPostContent().

+ Here is the caller graph for this function:

◆ getDisplayUserId()

ilForumPost::getDisplayUserId ( )

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

407 {
409 }

References $display_user_id.

Referenced by ilObjForumGUI\renderPostContent(), and ilForumExportGUI\renderPostHtml().

+ Here is the caller graph for this function:

◆ getForumId()

ilForumPost::getForumId ( )

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

391 {
392 return $this->forum_id;
393 }

References $forum_id.

Referenced by ilObjForumGUI\renderSplitButton().

+ Here is the caller graph for this function:

◆ getId()

ilForumPost::getId ( )

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

383 {
384 return $this->id;
385 }

References $id.

Referenced by ilObjForumGUI\ensureValidPageForCurrentPosting(), ilObjForumGUI\renderDraftContent(), ilObjForumGUI\renderPostContent(), and ilObjForumGUI\renderSplitButton().

+ Here is the caller graph for this function:

◆ getImportName()

ilForumPost::getImportName ( )

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

487 {
488 return $this->import_name;
489 }

References $import_name.

Referenced by ilObjForumGUI\renderPostContent(), and ilForumExportGUI\renderPostHtml().

+ Here is the caller graph for this function:

◆ getIsAuthorModerator()

ilForumPost::getIsAuthorModerator ( )
Returns
int|null

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

577 {
579 }

References $is_author_moderator.

Referenced by ilObjForumGUI\renderPostContent(), and ilForumExportGUI\renderPostHtml().

+ Here is the caller graph for this function:

◆ getIsRead()

ilForumPost::getIsRead ( )

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

517 {
518 return $this->post_read;
519 }

References $post_read.

Referenced by isPostRead().

+ Here is the caller graph for this function:

◆ getLft()

ilForumPost::getLft ( )

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

530 {
531 return $this->lft;
532 }

References $lft.

Referenced by ilForumTopic\getPostTree().

+ Here is the caller graph for this function:

◆ getMessage()

ilForumPost::getMessage ( )

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

431 {
432 return $this->message;
433 }

References $message.

Referenced by ilObjForumGUI\renderPostContent(), and ilForumExportGUI\renderPostHtml().

+ Here is the caller graph for this function:

◆ getParentId()

ilForumPost::getParentId ( )

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

522 {
523 return $this->parent_id;
524 }

References $parent_id.

◆ getPosAuthorId()

ilForumPost::getPosAuthorId ( )
Returns
int

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

570 {
572 }

References $pos_author_id.

Referenced by ilObjForumGUI\renderPostContent(), and ilForumExportGUI\renderPostHtml().

+ Here is the caller graph for this function:

◆ getPostActivationDate()

ilForumPost::getPostActivationDate ( )
Returns
string

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

601 {
603 }

References $post_activation_date.

◆ getRgt()

ilForumPost::getRgt ( )

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

538 {
539 return $this->rgt;
540 }

References $rgt.

Referenced by ilForumTopic\getPostTree().

+ Here is the caller graph for this function:

◆ getSubject()

ilForumPost::getSubject ( )

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

423 {
424 return $this->subject;
425 }

References $subject.

Referenced by ilObjForumGUI\renderPostContent(), and ilForumExportGUI\renderPostHtml().

+ Here is the caller graph for this function:

◆ getThread()

ilForumPost::getThread ( )

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

554 {
555 return $this->objThread;
556 }

References $objThread.

◆ getThreadId()

ilForumPost::getThreadId ( )

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

399 {
400 return $this->thread_id;
401 }

References $thread_id.

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

+ Here is the caller graph for this function:

◆ getTreeId()

ilForumPost::getTreeId ( )

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

503 {
504 return $this->tree_id;
505 }

References $tree_id.

◆ getUpdateUserId()

ilForumPost::getUpdateUserId ( )

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

455 {
457 }

References $user_id_update.

Referenced by ilObjForumGUI\renderDraftContent(), ilObjForumGUI\renderPostContent(), and ilForumExportGUI\renderPostHtml().

+ Here is the caller graph for this function:

◆ getUserAlias()

ilForumPost::getUserAlias ( )

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

415 {
416 return $this->user_alias;
417 }

References $user_alias.

Referenced by ilObjForumGUI\renderPostContent(), and ilForumExportGUI\renderPostHtml().

+ Here is the caller graph for this function:

◆ hasReplies()

ilForumPost::hasReplies ( )

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

350 {
351 if ($this->id && $this->rgt && $this->lft) {
352 $res = $this->db->queryF(
353 '
354 SELECT * FROM frm_posts_tree
355 WHERE lft > %s AND rgt < %s
356 AND thr_fk = %s',
357 array('integer', 'integer', 'integer'),
358 array($this->lft, $this->rgt, $this->thread_id)
359 );
360
361 return $res->numRows() ? true : false;
362 }
363
364 return false;
365 }
foreach($_POST as $key=> $value) $res

References $res.

Referenced by ilObjForumGUI\renderSplitButton().

+ Here is the caller graph for this function:

◆ insert()

ilForumPost::insert ( )

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

106 {
107 if ($this->forum_id && $this->thread_id) {
108 $this->id = $this->db->nextId('frm_posts');
109
110 $this->db->insert('frm_posts', array(
111 'pos_pk' => array('integer', $this->id),
112 'pos_top_fk' => array('integer', $this->forum_id),
113 'pos_thr_fk' => array('integer', $this->thread_id),
114 'pos_display_user_id' => array('integer', $this->display_user_id),
115 'pos_usr_alias' => array('text', $this->user_alias),
116 'pos_subject' => array('text', $this->subject),
117 'pos_message' => array('clob', $this->message),
118 'pos_date' => array('timestamp', $this->createdate),
119 'pos_update' => array('timestamp', $this->createdate),
120 'update_user' => array('integer', $this->user_id_update),
121 'pos_cens' => array('integer', $this->censored),
122 'notify' => array('integer', (int) $this->notification),
123 'import_name' => array('text', (string) $this->import_name),
124 'pos_status' => array('integer', (int) $this->status),
125 'pos_author_id' => array('integer', (int) $this->pos_author_id),
126 'is_author_moderator' => array('integer', $this->is_author_moderator),
127 'pos_activation_date' => array('timestamp', $this->createdate)
128 ));
129
130 return true;
131 }
132
133 return false;
134 }
notification()
Definition: notification.php:2

References notification().

+ Here is the call graph for this function:

◆ isActivated()

ilForumPost::isActivated ( )

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

495 {
496 return $this->status == 1 ? true : false;
497 }

Referenced by ilObjForumGUI\renderPostContent(), ilForumExportGUI\renderPostHtml(), and ilObjForumGUI\renderSplitButton().

+ Here is the caller graph for this function:

◆ isAnyParentDeactivated()

ilForumPost::isAnyParentDeactivated ( )

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

222 {
223 if ($this->id) {
224 $res = $this->db->queryF(
225 '
226 SELECT * FROM frm_posts_tree
227 INNER JOIN frm_posts ON pos_pk = pos_fk
228 WHERE pos_status = %s
229 AND lft < %s AND rgt > %s
230 AND thr_fk = %s',
231 array('integer', 'integer', 'integer', 'integer'),
232 array('0', $this->lft, $this->rgt, $this->thread_id)
233 );
234
235 return $res->numRows();
236 }
237
238 return false;
239 }

References $res.

◆ isCensored()

ilForumPost::isCensored ( )

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

463 {
464 return $this->censored == 1 ? true : false;
465 }

Referenced by ilObjForumGUI\renderDraftContent(), ilObjForumGUI\renderPostContent(), ilForumExportGUI\renderPostHtml(), and ilObjForumGUI\renderSplitButton().

+ Here is the caller graph for this function:

◆ isNotificationEnabled()

ilForumPost::isNotificationEnabled ( )

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

479 {
480 return $this->notification == 1 ? true : false;
481 }

References notification().

+ Here is the call graph for this function:

◆ isOwner()

ilForumPost::isOwner (   $a_user_id = 0)

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

368 {
369 if ($this->pos_author_id && $a_user_id) {
370 if ((int) $this->pos_author_id == (int) $a_user_id) {
371 return true;
372 }
373 return false;
374 }
375 return false;
376 }

Referenced by ilObjForumGUI\renderPostContent(), ilForumExportGUI\renderPostHtml(), and ilObjForumGUI\renderSplitButton().

+ Here is the caller graph for this function:

◆ isPostRead()

ilForumPost::isPostRead ( )

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

327 {
328 return $this->getIsRead();
329 }

References getIsRead().

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

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

◆ isRead()

ilForumPost::isRead (   $a_user_id = 0)

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

332 {
333 if ($a_user_id && $this->id) {
334 $res = $this->db->queryF(
335 '
336 SELECT * FROM frm_user_read
337 WHERE usr_id = %s
338 AND post_id = %s',
339 array('integer', 'integer'),
340 array($a_user_id, $this->id)
341 );
342
343 return $res->numRows() ? true : false;
344 }
345
346 return false;
347 }

References $res.

◆ mergePosts()

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

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

657 {
658 global $DIC;
659 $ilDB = $DIC->database();
660
661 $conditions = ['pos_thr_fk = ' . $ilDB->quote($sourceThreadId, 'integer')];
662 if ($excludedPostIds !== []) {
663 $conditions[] = $ilDB->in('pos_pk', $excludedPostIds, true, 'integer');
664 }
665
666 $ilDB->manipulateF(
667 'UPDATE frm_posts SET pos_thr_fk = %s WHERE ' . implode(' AND ', $conditions),
668 ['integer',],
669 [$targetThreadId,]
670 );
671 }
global $ilDB

References $DIC, and $ilDB.

Referenced by ilForum\mergeThreads().

+ Here is the caller graph for this function:

◆ read()

ilForumPost::read ( )
private

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

172 {
173 if ($this->id) {
174 $res = $this->db->queryF(
175 '
176 SELECT * FROM frm_posts
177 INNER JOIN frm_posts_tree ON pos_fk = pos_pk
178 WHERE pos_pk = %s',
179 array('integer'),
180 array($this->id)
181 );
182 $row = $this->db->fetchObject($res);
183
184 if (is_object($row)) {
185 $this->id = $row->pos_pk;
186 $this->forum_id = $row->pos_top_fk;
187 $this->thread_id = $row->pos_thr_fk;
188 $this->display_user_id = $row->pos_display_user_id;
189 $this->user_alias = $row->pos_usr_alias;
190 $this->subject = $row->pos_subject;
191 $this->message = $row->pos_message;
192 $this->createdate = $row->pos_date;
193 $this->changedate = $row->pos_update;
194 $this->user_id_update = $row->update_user;
195 $this->censored = $row->pos_cens;
196 $this->censored_date = $row->pos_cens_date;
197 $this->censorship_comment = $row->pos_cens_com;
198 $this->notification = $row->notify;
199 $this->import_name = $row->import_name;
200 $this->status = $row->pos_status;
201 $this->tree_id = $row->fpt_pk;
202 $this->parent_id = $row->parent_pos;
203 $this->lft = $row->lft;
204 $this->rgt = $row->rgt;
205 $this->depth = $row->depth;
206 $this->pos_author_id = $row->pos_author_id;
207 $this->is_author_moderator = $row->is_author_moderator;
208 $this->post_activation_date = $row->pos_activation_date;
209
210 $this->objThread = new ilForumTopic($this->thread_id, $this->is_moderator);
211
212 return true;
213 }
214 $this->id = 0;
215 return false;
216 }
217
218 return false;
219 }

References $res, and 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 241 of file class.ilForumPost.php.

242 {
243 return $this->read();
244 }

References read().

+ Here is the call graph for this function:

◆ setCensoredDate()

ilForumPost::setCensoredDate (   $censored_date)
Parameters
string$censored_date

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

617 {
618 $this->censored_date = $censored_date;
619 }

References $censored_date.

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setCensorship()

ilForumPost::setCensorship (   $a_censorship)

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

459 {
460 $this->censored = $a_censorship;
461 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setCensorshipComment()

ilForumPost::setCensorshipComment (   $a_comment)

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

467 {
468 $this->censorship_comment = $a_comment;
469 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setChangeDate()

ilForumPost::setChangeDate (   $a_changedate)

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

443 {
444 $this->changedate = $a_changedate;
445 }

Referenced by assignData(), ilObjForumGUI\renderPostContent(), and ilForumExportGUI\renderPostHtml().

+ Here is the caller graph for this function:

◆ setCreateDate()

ilForumPost::setCreateDate (   $a_createdate)

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

435 {
436 $this->createdate = $a_createdate;
437 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setDepth()

ilForumPost::setDepth (   $a_depth)

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

542 {
543 $this->depth = $a_depth;
544 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setDisplayUserId()

ilForumPost::setDisplayUserId (   $a_user_id)

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

403 {
404 $this->display_user_id = $a_user_id;
405 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setForumId()

ilForumPost::setForumId (   $a_forum_id)

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

387 {
388 $this->forum_id = $a_forum_id;
389 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setId()

ilForumPost::setId (   $a_id)

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

379 {
380 $this->id = $a_id;
381 }

◆ setImportName()

ilForumPost::setImportName (   $a_import_name)

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

483 {
484 $this->import_name = $a_import_name;
485 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setIsAuthorModerator()

ilForumPost::setIsAuthorModerator (   $is_author_moderator)
Parameters
int|null

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

585 {
586 $this->is_author_moderator = $is_author_moderator;
587 }

References $is_author_moderator.

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setIsRead()

ilForumPost::setIsRead (   $a_is_read)

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

512 {
513 $this->post_read = $a_is_read;
514 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setLft()

ilForumPost::setLft (   $a_lft)

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

526 {
527 $this->lft = $a_lft;
528 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setMessage()

ilForumPost::setMessage (   $a_message)

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

427 {
428 $this->message = $a_message;
429 }

Referenced by assignData(), ilObjForumGUI\renderPostContent(), and ilForumExportGUI\renderPostHtml().

+ Here is the caller graph for this function:

◆ setNotification()

ilForumPost::setNotification (   $a_notification)

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

475 {
476 $this->notification = $a_notification;
477 }

References notification().

Referenced by assignData().

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

◆ setParentId()

ilForumPost::setParentId (   $a_parent_id)

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

507 {
508 $this->parent_id = $a_parent_id;
509 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setPosAuthorId()

ilForumPost::setPosAuthorId (   $pos_author_id)
Parameters
int$pos_author_id

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

562 {
563 $this->pos_author_id = $pos_author_id;
564 }

References $pos_author_id.

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setPostActivationDate()

ilForumPost::setPostActivationDate (   $post_activation_date)
Parameters
string$post_activation_date

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

609 {
610 $this->post_activation_date = $post_activation_date;
611 }

References $post_activation_date.

Referenced by activatePost().

+ Here is the caller graph for this function:

◆ setRgt()

ilForumPost::setRgt (   $a_rgt)

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

534 {
535 $this->rgt = $a_rgt;
536 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setStatus()

ilForumPost::setStatus (   $a_status)

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

491 {
492 $this->status = $a_status;
493 }

Referenced by activatePost(), and assignData().

+ Here is the caller graph for this function:

◆ setSubject()

ilForumPost::setSubject (   $a_subject)

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

419 {
420 $this->subject = $a_subject;
421 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setThread()

ilForumPost::setThread ( ilForumTopic  $thread)

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

550 {
551 $this->objThread = $thread;
552 }

◆ setThreadId()

ilForumPost::setThreadId (   $a_thread_id)

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

395 {
396 $this->thread_id = $a_thread_id;
397 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setTreeId()

ilForumPost::setTreeId (   $a_tree_id)

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

499 {
500 $this->tree_id = $a_tree_id;
501 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setUpdateUserId()

ilForumPost::setUpdateUserId (   $a_user_id_update)

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

451 {
452 $this->user_id_update = $a_user_id_update;
453 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setUserAlias()

ilForumPost::setUserAlias (   $a_user_alias)

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

411 {
412 $this->user_alias = $a_user_alias;
413 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ update()

ilForumPost::update ( )

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

137 {
138 if ($this->id) {
139 $this->db->update(
140 'frm_posts',
141 array(
142 'pos_top_fk' => array('integer', $this->forum_id),
143 'pos_thr_fk' => array('integer', $this->thread_id),
144 'pos_subject' => array('text', $this->subject),
145 'pos_message' => array('clob', $this->message),
146 'pos_update' => array('timestamp', $this->changedate),
147 'update_user' => array('integer', $this->user_id_update),
148 'pos_cens' => array('integer', $this->censored),
149 'pos_cens_date' => array('timestamp', $this->censored_date),
150 'pos_cens_com' => array('text', $this->censorship_comment),
151 'notify' => array('integer', (int) $this->notification),
152 'pos_status' => array('integer', (int) $this->status)
153 ),
154 array(
155 'pos_pk' => array('integer', (int) $this->id)
156 )
157 );
158
159 if ($this->objThread->getFirstPostId() == $this->id) {
160 $this->objThread->setSubject($this->subject);
161 $this->objThread->update();
162 $this->objThread->reload();
163 }
164
165 return true;
166 }
167
168 return false;
169 }

References notification().

+ Here is the call graph for this function:

Field Documentation

◆ $censored

ilForumPost::$censored = 0
private

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

◆ $censored_date

ilForumPost::$censored_date = '0000-00-00 00:00:00'
private

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

Referenced by getCensoredDate(), and setCensoredDate().

◆ $censorship_comment

ilForumPost::$censorship_comment = ''
private

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

Referenced by getCensorshipComment().

◆ $changedate

ilForumPost::$changedate = '0000-00-00 00:00:00'
private

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

Referenced by getChangeDate().

◆ $createdate

ilForumPost::$createdate = '0000-00-00 00:00:00'
private

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

Referenced by getCreateDate().

◆ $db

ilForumPost::$db = null
private

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

◆ $depth

ilForumPost::$depth = 0
private

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

Referenced by getDepth().

◆ $display_user_id

ilForumPost::$display_user_id = 0
private

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

Referenced by getDisplayUserId().

◆ $forum_id

ilForumPost::$forum_id = 0
private

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

Referenced by getForumId().

◆ $id

ilForumPost::$id = 0
private

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

Referenced by getId().

◆ $import_name

ilForumPost::$import_name = ''
private

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

Referenced by getImportName().

◆ $is_author_moderator

ilForumPost::$is_author_moderator = null
private

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

Referenced by getIsAuthorModerator(), and setIsAuthorModerator().

◆ $is_moderator

ilForumPost::$is_moderator = false
private

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

◆ $lft

ilForumPost::$lft = 0
private

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

Referenced by getLft().

◆ $lng

ilForumPost::$lng = null
private

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

◆ $message

ilForumPost::$message = ''
private

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

Referenced by getMessage().

◆ $notification

ilForumPost::$notification = 0
private

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

◆ $objThread

ilForumPost::$objThread = null
private

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

Referenced by getThread().

◆ $parent_id

ilForumPost::$parent_id = 0
private

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

Referenced by getParentId().

◆ $pos_author_id

ilForumPost::$pos_author_id = 0
private

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

Referenced by getPosAuthorId(), and setPosAuthorId().

◆ $post_activation_date

ilForumPost::$post_activation_date = null
private

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

Referenced by getPostActivationDate(), and setPostActivationDate().

◆ $post_read

ilForumPost::$post_read = false
private

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

Referenced by getIsRead().

◆ $rgt

ilForumPost::$rgt = 0
private

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

Referenced by getRgt().

◆ $status

ilForumPost::$status = 1
private

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

◆ $subject

ilForumPost::$subject = ''
private

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

Referenced by getSubject().

◆ $thread_id

ilForumPost::$thread_id = 0
private

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

Referenced by getThreadId().

◆ $tree_id

ilForumPost::$tree_id = 0
private

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

Referenced by getTreeId().

◆ $user_alias

ilForumPost::$user_alias = ''
private

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

Referenced by getUserAlias().

◆ $user_id_update

ilForumPost::$user_id_update = 0
private

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

Referenced by getUpdateUserId().


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