ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 ()
 
 setFullname ($a_fullname)
 
 getFullname ()
 
 setLoginName ($a_loginname)
 
 getLoginName ()
 
 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 ($source_thread_id, $target_thread_id)
 

Protected Member Functions

 buildUserRelatedData ($row)
 

Private Member Functions

 read ()
 
 getUserData ()
 

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
 
 $fullname = ''
 
 $loginname = ''
 
 $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 12 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 92 of file class.ilForumPost.php.

93 {
94 global $DIC;
95
96 $this->db = $DIC->database();
97 $this->lng = $DIC->language();
98 $this->id = $a_id;
99
100 if (!$preventImplicitRead) {
101 $this->read();
102 }
103 }
global $DIC
Definition: saml.php:7

References $DIC, and read().

+ Here is the call graph for this function:

◆ __destruct()

ilForumPost::__destruct ( )

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

106 {
107 unset($this->db);
108 unset($this->objThread);
109 }

Member Function Documentation

◆ activateParentPosts()

ilForumPost::activateParentPosts ( )

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

358 {
359 if ($this->id) {
360 $query = "SELECT pos_pk FROM frm_posts "
361 . "INNER JOIN frm_posts_tree ON pos_fk = pos_pk "
362 . "WHERE lft < %s AND rgt > %s AND thr_fk = %s";
363 $result = $this->db->queryF(
364 $query,
365 array('integer', 'integer', 'integer'),
366 array($this->lft, $this->rgt, $this->thread_id)
367 );
368
369 $now = date("Y-m-d H:i:s");
370 while ($row = $this->db->fetchAssoc($result)) {
371 $this->db->update(
372 'frm_posts',
373 array('pos_status' => array('integer', 1),
374 'pos_activation_date' => array('timestamp', $now)),
375 array('pos_pk' => array('integer', $row['pos_pk']))
376 );
377 }
378
379 return true;
380 }
381
382 return false;
383 }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
$result
$query

References $query, $result, $row, and date.

Referenced by activatePost(), and activatePostAndChildPosts().

+ Here is the caller graph for this function:

◆ activatePost()

ilForumPost::activatePost ( )

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

306 {
307 if ($this->id) {
308 $now = date("Y-m-d H:i:s");
309 $this->db->update(
310 'frm_posts',
311 array('pos_status' => array('integer', 1),
312 'pos_activation_date' => array('timestamp', $now)),
313 array('pos_pk' => array('integer', $this->id))
314 );
315
316 $this->activateParentPosts();
317 $this->setPostActivationDate($now);
318 $this->setStatus(1);
319 return true;
320 }
321
322 return false;
323 }
setStatus($a_status)
setPostActivationDate($post_activation_date)

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

+ Here is the call graph for this function:

◆ activatePostAndChildPosts()

ilForumPost::activatePostAndChildPosts ( )

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

326 {
327 if ($this->id) {
328 $query = "SELECT pos_pk FROM frm_posts_tree treea "
329 . "INNER JOIN frm_posts_tree treeb ON treeb.thr_fk = treea.thr_fk "
330 . "AND treeb.lft BETWEEN treea.lft AND treea.rgt "
331 . "INNER JOIN frm_posts ON pos_pk = treeb.pos_fk "
332 . "WHERE treea.pos_fk = %s";
333 $result = $this->db->queryF(
334 $query,
335 array('integer'),
336 array($this->id)
337 );
338
339 $now = date("Y-m-d H:i:s");
340 while ($row = $this->db->fetchAssoc($result)) {
341 $this->db->update(
342 'frm_posts',
343 array('pos_status' => array('integer', 1),
344 'pos_activation_date' => array('timestamp', $now)),
345 array('pos_pk' => array('integer', $row['pos_pk']))
346 );
347 }
348
349 $this->activateParentPosts();
350
351 return true;
352 }
353
354 return false;
355 }

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

+ Here is the call graph for this function:

◆ assignData()

ilForumPost::assignData (   $row)
Parameters
$row

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

684 {
685 $this->setUserAlias($row['pos_usr_alias']);
686 $this->setSubject($row['pos_subject']);
687 $this->setCreateDate($row['pos_date']);
688 $this->setMessage($row['pos_message']);
689 $this->setForumId($row['pos_top_fk']);
690 $this->setThreadId($row['pos_thr_fk']);
691 $this->setChangeDate($row['pos_update']);
692 $this->setUpdateUserId($row['update_user']);
693 $this->setCensorship($row['pos_cens']);
694 $this->setCensoredDate($row['pos_cens_date']);
695 $this->setCensorshipComment($row['pos_cens_com']);
696 $this->setNotification($row['notify']);
697 $this->setImportName($row['import_name']);
698 $this->setStatus($row['pos_status']);
699 $this->setTreeId($row['fpt_pk']);
700 $this->setParentId($row['parent_pos']);
701 $this->setLft($row['lft']);
702 $this->setRgt($row['rgt']);
703 $this->setDepth($row['depth']);
704 $this->setIsRead($row['post_read']);
705 $this->setDisplayUserId($row['pos_display_user_id']);
706 $this->setPosAuthorId($row['pos_author_id']);
707 $this->setIsAuthorModerator($row['is_author_moderator']);
709 }
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)
buildUserRelatedData($row)
setMessage($a_message)

References $row, buildUserRelatedData(), 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:

◆ buildUserRelatedData()

ilForumPost::buildUserRelatedData (   $row)
protected

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

249 {
250 if ($row['pos_display_user_id'] && $row['pos_pk']) {
251 require_once 'Services/User/classes/class.ilObjUser.php';
252 $tmp_user = new ilObjUser();
253 $tmp_user->setFirstname($row['firstname']);
254 $tmp_user->setLastname($row['lastname']);
255 $tmp_user->setUTitle($row['title']);
256 $tmp_user->setLogin($row['login']);
257
258 $this->fullname = $tmp_user->getFullname();
259 $this->loginname = $tmp_user->getLogin();
260
261 $this->fullname = $this->fullname ? $this->fullname : ($this->import_name ? $this->import_name : $this->lng->txt('unknown'));
262 }
263 }

References $row.

Referenced by assignData().

+ Here is the caller graph for this function:

◆ getCensoredDate()

ilForumPost::getCensoredDate ( )
Returns
string

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

652 {
654 }

References $censored_date.

◆ getCensorshipComment()

ilForumPost::getCensorshipComment ( )

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

530 {
532 }

References $censorship_comment.

Referenced by ilObjForumGUI\renderPostContent().

+ Here is the caller graph for this function:

◆ getChangeDate()

ilForumPost::getChangeDate ( )

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

506 {
507 return $this->changedate;
508 }

References $changedate.

Referenced by ilObjForumGUI\renderPostContent().

+ Here is the caller graph for this function:

◆ getCreateDate()

ilForumPost::getCreateDate ( )

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

498 {
499 return $this->createdate;
500 }

References $createdate.

Referenced by ilObjForumGUI\renderPostContent().

+ Here is the caller graph for this function:

◆ getDepth()

ilForumPost::getDepth ( )

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

605 {
606 return $this->depth;
607 }

References $depth.

◆ getDisplayUserId()

ilForumPost::getDisplayUserId ( )

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

466 {
468 }

References $display_user_id.

Referenced by ilObjForumGUI\renderPostContent().

+ Here is the caller graph for this function:

◆ getForumId()

ilForumPost::getForumId ( )

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

450 {
451 return $this->forum_id;
452 }

References $forum_id.

Referenced by ilObjForumGUI\renderSplitButton().

+ Here is the caller graph for this function:

◆ getFullname()

ilForumPost::getFullname ( )

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

293 {
294 return $this->fullname;
295 }

References $fullname.

◆ getId()

ilForumPost::getId ( )

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

442 {
443 return $this->id;
444 }

References $id.

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

+ Here is the caller graph for this function:

◆ getImportName()

ilForumPost::getImportName ( )

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

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

References $import_name.

Referenced by ilObjForumGUI\renderPostContent().

+ Here is the caller graph for this function:

◆ getIsAuthorModerator()

ilForumPost::getIsAuthorModerator ( )
Returns
int|null

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

636 {
638 }

References $is_author_moderator.

Referenced by ilObjForumGUI\renderPostContent().

+ Here is the caller graph for this function:

◆ getIsRead()

ilForumPost::getIsRead ( )

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

576 {
577 return $this->post_read;
578 }

References $post_read.

Referenced by isPostRead().

+ Here is the caller graph for this function:

◆ getLft()

ilForumPost::getLft ( )

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

589 {
590 return $this->lft;
591 }

References $lft.

Referenced by ilForumTopic\getPostTree().

+ Here is the caller graph for this function:

◆ getLoginName()

ilForumPost::getLoginName ( )

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

301 {
302 return $this->loginname;
303 }

References $loginname.

◆ getMessage()

ilForumPost::getMessage ( )

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

490 {
491 return $this->message;
492 }

References $message.

Referenced by ilObjForumGUI\renderPostContent().

+ Here is the caller graph for this function:

◆ getParentId()

ilForumPost::getParentId ( )

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

581 {
582 return $this->parent_id;
583 }

References $parent_id.

◆ getPosAuthorId()

ilForumPost::getPosAuthorId ( )
Returns
int

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

629 {
631 }

References $pos_author_id.

Referenced by ilObjForumGUI\renderPostContent().

+ Here is the caller graph for this function:

◆ getPostActivationDate()

ilForumPost::getPostActivationDate ( )
Returns
string

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

660 {
662 }

References $post_activation_date.

◆ getRgt()

ilForumPost::getRgt ( )

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

597 {
598 return $this->rgt;
599 }

References $rgt.

Referenced by ilForumTopic\getPostTree().

+ Here is the caller graph for this function:

◆ getSubject()

ilForumPost::getSubject ( )

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

482 {
483 return $this->subject;
484 }

References $subject.

Referenced by ilObjForumGUI\renderPostContent().

+ Here is the caller graph for this function:

◆ getThread()

ilForumPost::getThread ( )

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

613 {
614 return $this->objThread;
615 }

References $objThread.

◆ getThreadId()

ilForumPost::getThreadId ( )

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

458 {
459 return $this->thread_id;
460 }

References $thread_id.

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

+ Here is the caller graph for this function:

◆ getTreeId()

ilForumPost::getTreeId ( )

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

562 {
563 return $this->tree_id;
564 }

References $tree_id.

◆ getUpdateUserId()

ilForumPost::getUpdateUserId ( )

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

514 {
516 }

References $user_id_update.

Referenced by ilObjForumGUI\renderPostContent().

+ Here is the caller graph for this function:

◆ getUserAlias()

ilForumPost::getUserAlias ( )

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

474 {
475 return $this->user_alias;
476 }

References $user_alias.

Referenced by ilObjForumGUI\renderPostContent().

+ Here is the caller graph for this function:

◆ getUserData()

ilForumPost::getUserData ( )
private

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

266 {
267 if ($this->id && $this->display_user_id) {
268 require_once("Modules/Forum/classes/class.ilObjForumAccess.php");
269 if (($tmp_user = ilObjForumAccess::getCachedUserInstance($this->display_user_id))) {
270 $this->fullname = $tmp_user->getFullname();
271 $this->loginname = $tmp_user->getLogin();
272 unset($tmp_user);
273 }
274
275 $this->fullname = $this->fullname ? $this->fullname : ($this->import_name ? $this->import_name : $this->lng->txt('unknown'));
276
277 return true;
278 }
279
280 return false;
281 }
static getCachedUserInstance($usr_id)

References ilObjForumAccess\getCachedUserInstance().

Referenced by read().

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

◆ hasReplies()

ilForumPost::hasReplies ( )

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

409 {
410 if ($this->id && $this->rgt && $this->lft) {
411 $res = $this->db->queryF(
412 '
413 SELECT * FROM frm_posts_tree
414 WHERE lft > %s AND rgt < %s
415 AND thr_fk = %s',
416 array('integer', 'integer', 'integer'),
417 array($this->lft, $this->rgt, $this->thread_id)
418 );
419
420 return $res->numRows() ? true : false;
421 }
422
423 return false;
424 }
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 111 of file class.ilForumPost.php.

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

References notification().

+ Here is the call graph for this function:

◆ isActivated()

ilForumPost::isActivated ( )

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

554 {
555 return $this->status == 1 ? true : false;
556 }

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

+ Here is the caller graph for this function:

◆ isAnyParentDeactivated()

ilForumPost::isAnyParentDeactivated ( )

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

229 {
230 if ($this->id) {
231 $res = $this->db->queryF(
232 '
233 SELECT * FROM frm_posts_tree
234 INNER JOIN frm_posts ON pos_pk = pos_fk
235 WHERE pos_status = %s
236 AND lft < %s AND rgt > %s
237 AND thr_fk = %s',
238 array('integer', 'integer', 'integer', 'integer'),
239 array('0', $this->lft, $this->rgt, $this->thread_id)
240 );
241
242 return $res->numRows();
243 }
244
245 return false;
246 }

References $res.

◆ isCensored()

ilForumPost::isCensored ( )

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

522 {
523 return $this->censored == 1 ? true : false;
524 }

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

+ Here is the caller graph for this function:

◆ isNotificationEnabled()

ilForumPost::isNotificationEnabled ( )

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

538 {
539 return $this->notification == 1 ? true : false;
540 }

References notification().

+ Here is the call graph for this function:

◆ isOwner()

ilForumPost::isOwner (   $a_user_id = 0)

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

427 {
428 if ($this->pos_author_id && $a_user_id) {
429 if ((int) $this->pos_author_id == (int) $a_user_id) {
430 return true;
431 }
432 return false;
433 }
434 return false;
435 }

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

+ Here is the caller graph for this function:

◆ isPostRead()

ilForumPost::isPostRead ( )

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

386 {
387 return $this->getIsRead();
388 }

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 390 of file class.ilForumPost.php.

391 {
392 if ($a_user_id && $this->id) {
393 $res = $this->db->queryF(
394 '
395 SELECT * FROM frm_user_read
396 WHERE usr_id = %s
397 AND post_id = %s',
398 array('integer', 'integer'),
399 array($a_user_id, $this->id)
400 );
401
402 return $res->numRows() ? true : false;
403 }
404
405 return false;
406 }

References $res.

◆ mergePosts()

static ilForumPost::mergePosts (   $source_thread_id,
  $target_thread_id 
)
static
Parameters
$source_thread_id
$target_thread_id

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

716 {
717 global $DIC;
718 $ilDB = $DIC->database();
719
720 $ilDB->update(
721 'frm_posts',
722 array('pos_thr_fk' => array('integer', $target_thread_id)),
723 array('pos_thr_fk' => array('integer', $source_thread_id))
724 );
725 }
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 177 of file class.ilForumPost.php.

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

References $res, $row, getUserData(), 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 283 of file class.ilForumPost.php.

284 {
285 return $this->read();
286 }

References read().

+ Here is the call graph for this function:

◆ setCensoredDate()

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

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

676 {
677 $this->censored_date = $censored_date;
678 }

References $censored_date.

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setCensorship()

ilForumPost::setCensorship (   $a_censorship)

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

518 {
519 $this->censored = $a_censorship;
520 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setCensorshipComment()

ilForumPost::setCensorshipComment (   $a_comment)

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

526 {
527 $this->censorship_comment = $a_comment;
528 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setChangeDate()

ilForumPost::setChangeDate (   $a_changedate)

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

502 {
503 $this->changedate = $a_changedate;
504 }

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

+ Here is the caller graph for this function:

◆ setCreateDate()

ilForumPost::setCreateDate (   $a_createdate)

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

494 {
495 $this->createdate = $a_createdate;
496 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setDepth()

ilForumPost::setDepth (   $a_depth)

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

601 {
602 $this->depth = $a_depth;
603 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setDisplayUserId()

ilForumPost::setDisplayUserId (   $a_user_id)

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

462 {
463 $this->display_user_id = $a_user_id;
464 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setForumId()

ilForumPost::setForumId (   $a_forum_id)

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

446 {
447 $this->forum_id = $a_forum_id;
448 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setFullname()

ilForumPost::setFullname (   $a_fullname)

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

289 {
290 $this->fullname = $a_fullname;
291 }

◆ setId()

ilForumPost::setId (   $a_id)

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

438 {
439 $this->id = $a_id;
440 }

◆ setImportName()

ilForumPost::setImportName (   $a_import_name)

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

542 {
543 $this->import_name = $a_import_name;
544 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setIsAuthorModerator()

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

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

644 {
645 $this->is_author_moderator = $is_author_moderator;
646 }

References $is_author_moderator.

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setIsRead()

ilForumPost::setIsRead (   $a_is_read)

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

571 {
572 $this->post_read = $a_is_read;
573 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setLft()

ilForumPost::setLft (   $a_lft)

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

585 {
586 $this->lft = $a_lft;
587 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setLoginName()

ilForumPost::setLoginName (   $a_loginname)

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

297 {
298 $this->loginname = $a_loginname;
299 }

◆ setMessage()

ilForumPost::setMessage (   $a_message)

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

486 {
487 $this->message = $a_message;
488 }

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

+ Here is the caller graph for this function:

◆ setNotification()

ilForumPost::setNotification (   $a_notification)

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

534 {
535 $this->notification = $a_notification;
536 }

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 565 of file class.ilForumPost.php.

566 {
567 $this->parent_id = $a_parent_id;
568 }

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 620 of file class.ilForumPost.php.

621 {
622 $this->pos_author_id = $pos_author_id;
623 }

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 667 of file class.ilForumPost.php.

668 {
669 $this->post_activation_date = $post_activation_date;
670 }

References $post_activation_date.

Referenced by activatePost().

+ Here is the caller graph for this function:

◆ setRgt()

ilForumPost::setRgt (   $a_rgt)

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

593 {
594 $this->rgt = $a_rgt;
595 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setStatus()

ilForumPost::setStatus (   $a_status)

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

550 {
551 $this->status = $a_status;
552 }

Referenced by activatePost(), and assignData().

+ Here is the caller graph for this function:

◆ setSubject()

ilForumPost::setSubject (   $a_subject)

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

478 {
479 $this->subject = $a_subject;
480 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setThread()

ilForumPost::setThread ( ilForumTopic  $thread)

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

609 {
610 $this->objThread = $thread;
611 }

◆ setThreadId()

ilForumPost::setThreadId (   $a_thread_id)

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

454 {
455 $this->thread_id = $a_thread_id;
456 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setTreeId()

ilForumPost::setTreeId (   $a_tree_id)

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

558 {
559 $this->tree_id = $a_tree_id;
560 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setUpdateUserId()

ilForumPost::setUpdateUserId (   $a_user_id_update)

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

510 {
511 $this->user_id_update = $a_user_id_update;
512 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setUserAlias()

ilForumPost::setUserAlias (   $a_user_alias)

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

470 {
471 $this->user_alias = $a_user_alias;
472 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ update()

ilForumPost::update ( )

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

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

References notification().

+ Here is the call graph for this function:

Field Documentation

◆ $censored

ilForumPost::$censored = 0
private

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

◆ $censored_date

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

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

Referenced by getCensoredDate(), and setCensoredDate().

◆ $censorship_comment

ilForumPost::$censorship_comment = ''
private

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

Referenced by getCensorshipComment().

◆ $changedate

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

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

Referenced by getChangeDate().

◆ $createdate

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

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

Referenced by getCreateDate().

◆ $db

ilForumPost::$db = null
private

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

◆ $depth

ilForumPost::$depth = 0
private

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

Referenced by getDepth().

◆ $display_user_id

ilForumPost::$display_user_id = 0
private

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

Referenced by getDisplayUserId().

◆ $forum_id

ilForumPost::$forum_id = 0
private

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

Referenced by getForumId().

◆ $fullname

ilForumPost::$fullname = ''
private

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

Referenced by getFullname().

◆ $id

ilForumPost::$id = 0
private

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

Referenced by getId().

◆ $import_name

ilForumPost::$import_name = ''
private

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

Referenced by getImportName().

◆ $is_author_moderator

ilForumPost::$is_author_moderator = null
private

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

Referenced by getIsAuthorModerator(), and setIsAuthorModerator().

◆ $is_moderator

ilForumPost::$is_moderator = false
private

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

◆ $lft

ilForumPost::$lft = 0
private

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

Referenced by getLft().

◆ $lng

ilForumPost::$lng = null
private

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

◆ $loginname

ilForumPost::$loginname = ''
private

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

Referenced by getLoginName().

◆ $message

ilForumPost::$message = ''
private

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

Referenced by getMessage().

◆ $notification

ilForumPost::$notification = 0
private

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

◆ $objThread

ilForumPost::$objThread = null
private

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

Referenced by getThread().

◆ $parent_id

ilForumPost::$parent_id = 0
private

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

Referenced by getParentId().

◆ $pos_author_id

ilForumPost::$pos_author_id = 0
private

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

Referenced by getPosAuthorId(), and setPosAuthorId().

◆ $post_activation_date

ilForumPost::$post_activation_date = null
private

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

Referenced by getPostActivationDate(), and setPostActivationDate().

◆ $post_read

ilForumPost::$post_read = false
private

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

Referenced by getIsRead().

◆ $rgt

ilForumPost::$rgt = 0
private

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

Referenced by getRgt().

◆ $status

ilForumPost::$status = 1
private

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

◆ $subject

ilForumPost::$subject = ''
private

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

Referenced by getSubject().

◆ $thread_id

ilForumPost::$thread_id = 0
private

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

Referenced by getThreadId().

◆ $tree_id

ilForumPost::$tree_id = 0
private

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

Referenced by getTreeId().

◆ $user_alias

ilForumPost::$user_alias = ''
private

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

Referenced by getUserAlias().

◆ $user_id_update

ilForumPost::$user_id_update = 0
private

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

Referenced by getUpdateUserId().


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