ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
 
 $is_moderator = false
 
 $is_author_moderator = null
 
 $post_read = false
 
 $pos_author_id = 0
 
 $post_activation_date = '0000-00-00 00:00:00'
 

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

References $ilDB, and read().

92  {
93  global $ilDB;
94 
95  $this->db = $ilDB;
96  $this->id = $a_id;
97 
98  if( !$preventImplicitRead )
99  {
100  $this->read();
101  }
102  }
global $ilDB
+ Here is the call graph for this function:

◆ __destruct()

ilForumPost::__destruct ( )

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

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

Member Function Documentation

◆ activateParentPosts()

ilForumPost::activateParentPosts ( )

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

References $query, $result, and $row.

Referenced by activatePost(), and activatePostAndChildPosts().

367  {
368  if ($this->id)
369  {
370  $query = "SELECT pos_pk FROM frm_posts "
371  . "INNER JOIN frm_posts_tree ON pos_fk = pos_pk "
372  . "WHERE lft < %s AND rgt > %s AND thr_fk = %s";
373  $result = $this->db->queryF(
374  $query,
375  array('integer', 'integer', 'integer'),
376  array($this->lft, $this->rgt, $this->thread_id)
377  );
378 
379  $now = date("Y-m-d H:i:s");
380  while($row = $this->db->fetchAssoc($result))
381  {
382  $this->db->update('frm_posts',
383  array('pos_status' => array('integer', 1),
384  'pos_activation_date' => array('timestamp', $now)),
385  array('pos_pk' => array('integer', $row['pos_pk']))
386  );
387  }
388 
389  return true;
390  }
391 
392  return false;
393  }
$result
+ Here is the caller graph for this function:

◆ activatePost()

ilForumPost::activatePost ( )

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

References activateParentPosts().

316  {
317  if ($this->id)
318  {
319  $this->db->update('frm_posts',
320  array('pos_status' => array('integer', 1),
321  'pos_activation_date' => array('timestamp', date("Y-m-d H:i:s"))),
322  array('pos_pk' => array('integer', $this->id))
323  );
324 
325  $this->activateParentPosts();
326 
327  return true;
328  }
329 
330  return false;
331  }
+ Here is the call graph for this function:

◆ activatePostAndChildPosts()

ilForumPost::activatePostAndChildPosts ( )

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

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

334  {
335  if ($this->id)
336  {
337  $query = "SELECT pos_pk FROM frm_posts_tree treea "
338  . "INNER JOIN frm_posts_tree treeb ON treeb.thr_fk = treea.thr_fk "
339  . "AND treeb.lft BETWEEN treea.lft AND treea.rgt "
340  . "INNER JOIN frm_posts ON pos_pk = treeb.pos_fk "
341  . "WHERE treea.pos_fk = %s";
342  $result = $this->db->queryF(
343  $query,
344  array('integer'),
345  array($this->id)
346  );
347 
348  $now = date("Y-m-d H:i:s");
349  while($row = $this->db->fetchAssoc($result))
350  {
351  $this->db->update('frm_posts',
352  array('pos_status' => array('integer', 1),
353  'pos_activation_date' => array('timestamp', $now)),
354  array('pos_pk' => array('integer', $row['pos_pk']))
355  );
356  }
357 
358  $this->activateParentPosts();
359 
360  return true;
361  }
362 
363  return false;
364  }
$result
+ Here is the call graph for this function:

◆ assignData()

ilForumPost::assignData (   $row)
Parameters
$row

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

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().

695  {
696  $this->setUserAlias($row['pos_usr_alias']);
697  $this->setSubject($row['pos_subject']);
698  $this->setCreateDate($row['pos_date']);
699  $this->setMessage($row['pos_message']);
700  $this->setForumId($row['pos_top_fk']);
701  $this->setThreadId($row['pos_thr_fk']);
702  $this->setChangeDate($row['pos_update']);
703  $this->setUpdateUserId($row['update_user']);
704  $this->setCensorship($row['pos_cens']);
705  $this->setCensoredDate($row['pos_cens_date']);
706  $this->setCensorshipComment($row['pos_cens_com']);
707  $this->setNotification($row['notify']);
708  $this->setImportName($row['import_name']);
709  $this->setStatus($row['pos_status']);
710  $this->setTreeId($row['fpt_pk']);
711  $this->setParentId($row['parent_pos']);
712  $this->setLft($row['lft']);
713  $this->setRgt($row['rgt']);
714  $this->setDepth($row['depth']);
715  $this->setIsRead($row['post_read']);
716  $this->setDisplayUserId($row['pos_display_user_id']);
717  $this->setPosAuthorId($row['pos_author_id']);
718  $this->setIsAuthorModerator($row['is_author_moderator']);
719  $this->buildUserRelatedData($row);
720  }
setCreateDate($a_createdate)
setNotification($a_notification)
setTreeId($a_tree_id)
buildUserRelatedData($row)
setUserAlias($a_user_alias)
setDepth($a_depth)
setImportName($a_import_name)
setForumId($a_forum_id)
setIsAuthorModerator($is_author_moderator)
setThreadId($a_thread_id)
setCensorshipComment($a_comment)
setParentId($a_parent_id)
setDisplayUserId($a_user_id)
setStatus($a_status)
setCensorship($a_censorship)
setPosAuthorId($pos_author_id)
setMessage($a_message)
setSubject($a_subject)
setUpdateUserId($a_user_id_update)
setChangeDate($a_changedate)
setCensoredDate($censored_date)
setIsRead($a_is_read)
+ Here is the call graph for this function:

◆ buildUserRelatedData()

ilForumPost::buildUserRelatedData (   $row)
protected

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

References $lng, and $row.

Referenced by assignData().

252  {
253  global $lng;
254 
255  if ($row['pos_display_user_id'] && $row['pos_pk'])
256  {
257  require_once 'Services/User/classes/class.ilObjUser.php';
258  $tmp_user = new ilObjUser();
259  $tmp_user->setFirstname($row['firstname']);
260  $tmp_user->setLastname($row['lastname']);
261  $tmp_user->setUTitle($row['title']);
262  $tmp_user->setLogin($row['login']);
263 
264  $this->fullname = $tmp_user->getFullname();
265  $this->loginname = $tmp_user->getLogin();
266 
267  $this->fullname = $this->fullname ? $this->fullname : ($this->import_name ? $this->import_name : $lng->txt('unknown'));
268  }
269  }
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ getCensoredDate()

ilForumPost::getCensoredDate ( )
Returns
string

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

References $censored_date.

663  {
664  return $this->censored_date;
665  }

◆ getCensorshipComment()

ilForumPost::getCensorshipComment ( )

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

References $censorship_comment.

Referenced by ilForumExportGUI\executeCommand().

541  {
543  }
+ Here is the caller graph for this function:

◆ getChangeDate()

ilForumPost::getChangeDate ( )

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

References $changedate.

Referenced by ilForumExportGUI\executeCommand().

517  {
518  return $this->changedate;
519  }
+ Here is the caller graph for this function:

◆ getCreateDate()

ilForumPost::getCreateDate ( )

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

References $createdate.

Referenced by ilForumExportGUI\executeCommand().

509  {
510  return $this->createdate;
511  }
+ Here is the caller graph for this function:

◆ getDepth()

ilForumPost::getDepth ( )

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

References $depth.

616  {
617  return $this->depth;
618  }

◆ getDisplayUserId()

ilForumPost::getDisplayUserId ( )

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

References $display_user_id.

Referenced by ilForumExportGUI\executeCommand().

477  {
478  return $this->display_user_id;
479  }
+ Here is the caller graph for this function:

◆ getForumId()

ilForumPost::getForumId ( )

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

References $forum_id.

461  {
462  return $this->forum_id;
463  }

◆ getFullname()

ilForumPost::getFullname ( )

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

References $fullname.

303  {
304  return $this->fullname;
305  }

◆ getId()

ilForumPost::getId ( )

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

References $id.

Referenced by ilForumExportGUI\executeCommand().

453  {
454  return $this->id;
455  }
+ Here is the caller graph for this function:

◆ getImportName()

ilForumPost::getImportName ( )

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

References $import_name.

Referenced by ilForumExportGUI\executeCommand().

557  {
558  return $this->import_name;
559  }
+ Here is the caller graph for this function:

◆ getIsAuthorModerator()

ilForumPost::getIsAuthorModerator ( )
Returns
int|null

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

References $is_author_moderator.

Referenced by ilForumExportGUI\executeCommand().

647  {
649  }
+ Here is the caller graph for this function:

◆ getIsRead()

ilForumPost::getIsRead ( )

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

References $post_read.

Referenced by isPostRead().

587  {
588  return $this->post_read;
589  }
+ Here is the caller graph for this function:

◆ getLft()

ilForumPost::getLft ( )

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

References $lft.

Referenced by ilForumTopic\getPostTree().

600  {
601  return $this->lft;
602  }
+ Here is the caller graph for this function:

◆ getLoginName()

ilForumPost::getLoginName ( )

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

References $loginname.

311  {
312  return $this->loginname;
313  }

◆ getMessage()

ilForumPost::getMessage ( )

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

References $message.

Referenced by ilForumExportGUI\executeCommand().

501  {
502  return $this->message;
503  }
+ Here is the caller graph for this function:

◆ getParentId()

ilForumPost::getParentId ( )

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

References $parent_id.

592  {
593  return $this->parent_id;
594  }

◆ getPosAuthorId()

ilForumPost::getPosAuthorId ( )
Returns
int

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

References $pos_author_id.

Referenced by ilForumExportGUI\executeCommand(), and ilObjForumNotificationDataProvider\getPostAnsweredRecipients().

640  {
641  return $this->pos_author_id;
642  }
+ Here is the caller graph for this function:

◆ getPostActivationDate()

ilForumPost::getPostActivationDate ( )
Returns
string

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

References $post_activation_date.

671  {
673  }

◆ getRgt()

ilForumPost::getRgt ( )

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

References $rgt.

Referenced by ilForumTopic\getPostTree().

608  {
609  return $this->rgt;
610  }
+ Here is the caller graph for this function:

◆ getSubject()

ilForumPost::getSubject ( )

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

References $subject.

Referenced by ilForumExportGUI\executeCommand().

493  {
494  return $this->subject;
495  }
+ Here is the caller graph for this function:

◆ getThread()

ilForumPost::getThread ( )

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

References $objThread.

624  {
625  return $this->objThread;
626  }

◆ getThreadId()

ilForumPost::getThreadId ( )

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

References $thread_id.

Referenced by ilForumTopic\getPostTree().

469  {
470  return $this->thread_id;
471  }
+ Here is the caller graph for this function:

◆ getTreeId()

ilForumPost::getTreeId ( )

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

References $tree_id.

573  {
574  return $this->tree_id;
575  }

◆ getUpdateUserId()

ilForumPost::getUpdateUserId ( )

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

References $user_id_update.

Referenced by ilForumExportGUI\executeCommand().

525  {
526  return $this->user_id_update;
527  }
+ Here is the caller graph for this function:

◆ getUserAlias()

ilForumPost::getUserAlias ( )

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

References $user_alias.

Referenced by ilForumExportGUI\executeCommand().

485  {
486  return $this->user_alias;
487  }
+ Here is the caller graph for this function:

◆ getUserData()

ilForumPost::getUserData ( )
private

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

References $lng, and ilObjForumAccess\getCachedUserInstance().

Referenced by read().

272  {
273  global $lng;
274 
275  if ($this->id && $this->display_user_id)
276  {
277  require_once("Modules/Forum/classes/class.ilObjForumAccess.php");
278  if(($tmp_user = ilObjForumAccess::getCachedUserInstance($this->display_user_id)))
279  {
280  $this->fullname = $tmp_user->getFullname();
281  $this->loginname = $tmp_user->getLogin();
282  unset($tmp_user);
283  }
284 
285  $this->fullname = $this->fullname ? $this->fullname : ($this->import_name ? $this->import_name : $lng->txt('unknown'));
286 
287  return true;
288  }
289 
290  return false;
291  }
static getCachedUserInstance($usr_id)
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasReplies()

ilForumPost::hasReplies ( )

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

References $res.

419  {
420  if ($this->id && $this->rgt && $this->lft)
421  {
422  $res = $this->db->queryF('
423  SELECT * FROM frm_posts_tree
424  WHERE lft > %s AND rgt < %s
425  AND thr_fk = %s',
426  array('integer', 'integer', 'integer'),
427  array($this->lft, $this->rgt, $this->thread_id));
428 
429  return $res->numRows() ? true : false;
430  }
431 
432  return false;
433  }

◆ insert()

ilForumPost::insert ( )

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

References $ilDB.

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

◆ isActivated()

ilForumPost::isActivated ( )

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

Referenced by ilForumExportGUI\executeCommand(), and ilObjForumGUI\setTreeStateAsynchObject().

565  {
566  return $this->status == 1 ? true : false;
567  }
+ Here is the caller graph for this function:

◆ isAnyParentDeactivated()

ilForumPost::isAnyParentDeactivated ( )

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

References $res.

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

◆ isCensored()

ilForumPost::isCensored ( )

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

Referenced by ilForumExportGUI\executeCommand().

533  {
534  return $this->censored == 1 ? true : false;
535  }
+ Here is the caller graph for this function:

◆ isNotificationEnabled()

ilForumPost::isNotificationEnabled ( )

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

549  {
550  return $this->notification == 1 ? true : false;
551  }

◆ isOwner()

ilForumPost::isOwner (   $a_user_id = 0)

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

Referenced by ilForumExportGUI\executeCommand().

436  {
437  if ($this->pos_author_id && $a_user_id)
438  {
439  if ((int) $this->pos_author_id == (int) $a_user_id)
440  {
441  return true;
442  }
443  return false;
444  }
445  return false;
446  }
+ Here is the caller graph for this function:

◆ isPostRead()

ilForumPost::isPostRead ( )

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

References getIsRead().

396  {
397  return $this->getIsRead();
398  }
+ Here is the call graph for this function:

◆ isRead()

ilForumPost::isRead (   $a_user_id = 0)

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

References $res.

401  {
402  if ($a_user_id && $this->id)
403  {
404 
405  $res = $this->db->queryF('
406  SELECT * FROM frm_user_read
407  WHERE usr_id = %s
408  AND post_id = %s',
409  array('integer', 'integer'),
410  array($a_user_id, $this->id));
411 
412  return $res->numRows() ? true : false;
413  }
414 
415  return false;
416  }

◆ mergePosts()

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

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

References $ilDB.

Referenced by ilForum\mergeThreads().

727  {
728  global $ilDB;
729 
730  $ilDB->update('frm_posts',
731  array('pos_thr_fk' => array('integer', $target_thread_id)),
732  array('pos_thr_fk' => array('integer', $source_thread_id)));
733  }
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilForumPost::read ( )
private

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

References $res, $row, and getUserData().

Referenced by __construct(), and reload().

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

◆ reload()

ilForumPost::reload ( )

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

References read().

294  {
295  return $this->read();
296  }
+ Here is the call graph for this function:

◆ setCensoredDate()

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

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

References $censored_date.

Referenced by assignData().

687  {
688  $this->censored_date = $censored_date;
689  }
+ Here is the caller graph for this function:

◆ setCensorship()

ilForumPost::setCensorship (   $a_censorship)

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

Referenced by assignData().

529  {
530  $this->censored = $a_censorship;
531  }
+ Here is the caller graph for this function:

◆ setCensorshipComment()

ilForumPost::setCensorshipComment (   $a_comment)

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

Referenced by assignData().

537  {
538  $this->censorship_comment = $a_comment;
539  }
+ Here is the caller graph for this function:

◆ setChangeDate()

ilForumPost::setChangeDate (   $a_changedate)

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

Referenced by assignData(), and ilForumExportGUI\executeCommand().

513  {
514  $this->changedate = $a_changedate;
515  }
+ Here is the caller graph for this function:

◆ setCreateDate()

ilForumPost::setCreateDate (   $a_createdate)

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

Referenced by assignData().

505  {
506  $this->createdate = $a_createdate;
507  }
+ Here is the caller graph for this function:

◆ setDepth()

ilForumPost::setDepth (   $a_depth)

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

Referenced by assignData().

612  {
613  $this->depth = $a_depth;
614  }
+ Here is the caller graph for this function:

◆ setDisplayUserId()

ilForumPost::setDisplayUserId (   $a_user_id)

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

Referenced by assignData().

473  {
474  $this->display_user_id = $a_user_id;
475  }
+ Here is the caller graph for this function:

◆ setForumId()

ilForumPost::setForumId (   $a_forum_id)

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

Referenced by assignData().

457  {
458  $this->forum_id = $a_forum_id;
459  }
+ Here is the caller graph for this function:

◆ setFullname()

ilForumPost::setFullname (   $a_fullname)

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

299  {
300  $this->fullname = $a_fullname;
301  }

◆ setId()

ilForumPost::setId (   $a_id)

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

449  {
450  $this->id = $a_id;
451  }

◆ setImportName()

ilForumPost::setImportName (   $a_import_name)

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

Referenced by assignData().

553  {
554  $this->import_name = $a_import_name;
555  }
+ Here is the caller graph for this function:

◆ setIsAuthorModerator()

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

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

References $is_author_moderator.

Referenced by assignData().

655  {
656  $this->is_author_moderator = $is_author_moderator;
657  }
+ Here is the caller graph for this function:

◆ setIsRead()

ilForumPost::setIsRead (   $a_is_read)

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

Referenced by assignData().

582  {
583  $this->post_read = $a_is_read;
584  }
+ Here is the caller graph for this function:

◆ setLft()

ilForumPost::setLft (   $a_lft)

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

Referenced by assignData().

596  {
597  $this->lft = $a_lft;
598  }
+ Here is the caller graph for this function:

◆ setLoginName()

ilForumPost::setLoginName (   $a_loginname)

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

307  {
308  $this->loginname = $a_loginname;
309  }

◆ setMessage()

ilForumPost::setMessage (   $a_message)

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

Referenced by assignData(), and ilForumExportGUI\executeCommand().

497  {
498  $this->message = $a_message;
499  }
+ Here is the caller graph for this function:

◆ setNotification()

ilForumPost::setNotification (   $a_notification)

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

Referenced by assignData().

545  {
546  $this->notification = $a_notification;
547  }
+ Here is the caller graph for this function:

◆ setParentId()

ilForumPost::setParentId (   $a_parent_id)

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

Referenced by assignData().

577  {
578  $this->parent_id = $a_parent_id;
579  }
+ Here is the caller graph for this function:

◆ setPosAuthorId()

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

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

References $pos_author_id.

Referenced by assignData().

632  {
633  $this->pos_author_id = $pos_author_id;
634  }
+ Here is the caller graph for this function:

◆ setPostActivationDate()

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

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

References $post_activation_date.

679  {
680  $this->post_activation_date = $post_activation_date;
681  }

◆ setRgt()

ilForumPost::setRgt (   $a_rgt)

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

Referenced by assignData().

604  {
605  $this->rgt = $a_rgt;
606  }
+ Here is the caller graph for this function:

◆ setStatus()

ilForumPost::setStatus (   $a_status)

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

Referenced by assignData().

561  {
562  $this->status = $a_status;
563  }
+ Here is the caller graph for this function:

◆ setSubject()

ilForumPost::setSubject (   $a_subject)

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

Referenced by assignData().

489  {
490  $this->subject = $a_subject;
491  }
+ Here is the caller graph for this function:

◆ setThread()

ilForumPost::setThread ( ilForumTopic  $thread)

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

620  {
621  $this->objThread = $thread;
622  }

◆ setThreadId()

ilForumPost::setThreadId (   $a_thread_id)

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

Referenced by assignData().

465  {
466  $this->thread_id = $a_thread_id;
467  }
+ Here is the caller graph for this function:

◆ setTreeId()

ilForumPost::setTreeId (   $a_tree_id)

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

Referenced by assignData().

569  {
570  $this->tree_id = $a_tree_id;
571  }
+ Here is the caller graph for this function:

◆ setUpdateUserId()

ilForumPost::setUpdateUserId (   $a_user_id_update)

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

Referenced by assignData().

521  {
522  $this->user_id_update = $a_user_id_update;
523  }
+ Here is the caller graph for this function:

◆ setUserAlias()

ilForumPost::setUserAlias (   $a_user_alias)

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

Referenced by assignData().

481  {
482  $this->user_alias = $a_user_alias;
483  }
+ Here is the caller graph for this function:

◆ update()

ilForumPost::update ( )

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

References $id, and $ilDB.

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

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(), and update().

◆ $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 77 of file class.ilForumPost.php.

Referenced by getIsAuthorModerator(), and setIsAuthorModerator().

◆ $is_moderator

ilForumPost::$is_moderator = false
private

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

◆ $lft

ilForumPost::$lft = 0
private

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

Referenced by getLft().

◆ $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 81 of file class.ilForumPost.php.

Referenced by getPosAuthorId(), and setPosAuthorId().

◆ $post_activation_date

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

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

Referenced by getPostActivationDate(), and setPostActivationDate().

◆ $post_read

ilForumPost::$post_read = false
private

Definition at line 79 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: