ILIAS  release_4-4 Revision
ilForumPost Class Reference
+ Collaboration diagram for ilForumPost:

Public Member Functions

 __construct ($a_id=0, $a_is_moderator=false, $preventImplicitRead=false)
 
 __destruct ()
 
 insert ()
 
 update ()
 
 getDataAsArray ()
 
 getDataAsArrayForExplorer ()
 
 isAnyParentDeactivated ()
 
 reload ()
 
 setFullname ($a_fullname)
 
 getFullname ()
 
 setLoginName ($a_loginname)
 
 getLoginName ()
 
 activatePost ()
 
 activatePostAndChildPosts ()
 
 activateParentPosts ()
 
 deactivatePostAndChildPosts ()
 
 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 ()
 
 setUserId ($a_user_id)
 
 getUserId ()
 
 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 ()
 
 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
 
 $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 = ''
 
 $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
 
 $post_read = false
 

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 
)

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

References read().

67  {
68  global $ilDB;
69 
70  $this->is_moderator = $a_is_moderator;
71  $this->db = $ilDB;
72  $this->id = $a_id;
73 
74  if( !$preventImplicitRead )
75  {
76  $this->read();
77  }
78  }
+ Here is the call graph for this function:

◆ __destruct()

ilForumPost::__destruct ( )

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

81  {
82  unset($this->db);
83  unset($this->objThread);
84  }

Member Function Documentation

◆ activateParentPosts()

ilForumPost::activateParentPosts ( )

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

References $query, $result, and $row.

Referenced by activatePost(), and activatePostAndChildPosts().

390  {
391  if ($this->id)
392  {
393  $query = "SELECT pos_pk FROM frm_posts "
394  . "INNER JOIN frm_posts_tree ON pos_fk = pos_pk "
395  . "WHERE lft < %s AND rgt > %s AND thr_fk = %s";
396  $result = $this->db->queryF(
397  $query,
398  array('integer', 'integer', 'integer'),
399  array($this->lft, $this->rgt, $this->thread_id)
400  );
401 
402  while($row = $this->db->fetchAssoc($result))
403  {
404  $this->db->update('frm_posts',
405  array('pos_status' => array('integer', 1)),
406  array('pos_pk' => array('integer', $row['pos_pk'])));
407  }
408 
409  return true;
410  }
411 
412  return false;
413  }
$result
+ Here is the caller graph for this function:

◆ activatePost()

ilForumPost::activatePost ( )

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

References activateParentPosts().

344  {
345  if ($this->id)
346  {
347  $this->db->update('frm_posts',
348  array('pos_status' => array('integer', 1)),
349  array('pos_pk' => array('integer', $this->id)));
350 
351  $this->activateParentPosts();
352 
353  return true;
354  }
355 
356  return false;
357  }
+ Here is the call graph for this function:

◆ activatePostAndChildPosts()

ilForumPost::activatePostAndChildPosts ( )

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

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

360  {
361  if ($this->id)
362  {
363  $query = "SELECT pos_pk FROM frm_posts_tree treea "
364  . "INNER JOIN frm_posts_tree treeb ON treeb.thr_fk = treea.thr_fk "
365  . "AND treeb.lft BETWEEN treea.lft AND treea.rgt "
366  . "INNER JOIN frm_posts ON pos_pk = treeb.pos_fk "
367  . "WHERE treea.pos_fk = %s";
368  $result = $this->db->queryF(
369  $query,
370  array('integer'),
371  array($this->id)
372  );
373 
374  while($row = $this->db->fetchAssoc($result))
375  {
376  $this->db->update('frm_posts',
377  array('pos_status' => array('integer', 1)),
378  array('pos_pk' => array('integer', $row['pos_pk'])));
379  }
380 
381  $this->activateParentPosts();
382 
383  return true;
384  }
385 
386  return false;
387  }
$result
+ Here is the call graph for this function:

◆ assignData()

ilForumPost::assignData (   $row)

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

References $row, buildUserRelatedData(), setCensorship(), setCensorshipComment(), setChangeDate(), setCreateDate(), setDepth(), setForumId(), setImportName(), setIsRead(), setLft(), setMessage(), setNotification(), setParentId(), setRgt(), setStatus(), setSubject(), setThreadId(), setTreeId(), setUpdateUserId(), setUserAlias(), and setUserId().

677  {
678  $this->setUserAlias($row['pos_usr_alias']);
679  $this->setSubject($row['pos_subject']);
680  $this->setCreateDate($row['pos_date']);
681  $this->setMessage($row['pos_message']);
682  $this->setForumId($row['pos_top_fk']);
683  $this->setThreadId($row['pos_thr_fk']);
684  $this->setChangeDate($row['pos_update']);
685  $this->setUpdateUserId($row['update_user']);
686  $this->setCensorship($row['pos_cens']);
687  $this->setCensorshipComment($row['pos_cens_com']);
688  $this->setNotification($row['notify']);
689  $this->setImportName($row['import_name']);
690  $this->setStatus($row['pos_status']);
691  $this->setTreeId($row['fpt_pk']);
692  $this->setParentId($row['parent_pos']);
693  $this->setLft($row['lft']);
694  $this->setRgt($row['rgt']);
695  $this->setDepth($row['depth']);
696  $this->setIsRead($row['post_read']);
697  $this->setUserId($row['pos_usr_id']);
698  $this->buildUserRelatedData($row);
699  }
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)
setThreadId($a_thread_id)
setCensorshipComment($a_comment)
setParentId($a_parent_id)
setStatus($a_status)
setUserId($a_user_id)
setCensorship($a_censorship)
setMessage($a_message)
setSubject($a_subject)
setUpdateUserId($a_user_id_update)
setChangeDate($a_changedate)
setIsRead($a_is_read)
+ Here is the call graph for this function:

◆ buildUserRelatedData()

ilForumPost::buildUserRelatedData (   $row)
protected

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

References $lng, and $row.

Referenced by assignData().

278  {
279  global $lng;
280 
281  if ($row['pos_usr_id'] && $row['pos_pk'])
282  {
283  require_once 'Services/User/classes/class.ilObjUser.php';
284  $tmp_user = new ilObjUser();
285  $tmp_user->setFirstname($row['firstname']);
286  $tmp_user->setLastname($row['lastname']);
287  $tmp_user->setUTitle($row['title']);
288  $tmp_user->setLogin($row['login']);
289 
290  $this->fullname = $tmp_user->getFullname();
291  $this->loginname = $tmp_user->getLogin();
292 
293  $this->fullname = $this->fullname ? $this->fullname : ($this->import_name ? $this->import_name : $lng->txt('unknown'));
294 
295  return true;
296  }
297  }
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ deactivatePostAndChildPosts()

ilForumPost::deactivatePostAndChildPosts ( )

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

References $query, $result, and $row.

416  {
417  if ($this->id)
418  {
419  $query = "SELECT pos_pk FROM frm_posts_tree treea "
420  . "INNER JOIN frm_posts_tree treeb ON treeb.thr_fk = treea.thr_fk "
421  . "AND treeb.lft BETWEEN treea.lft AND treea.rgt "
422  . "INNER JOIN frm_posts ON pos_pk = treeb.pos_fk "
423  . "WHERE treea.pos_fk = %s";
424  $result = $this->db->queryF(
425  $query,
426  array('integer'),
427  array($this->id)
428  );
429 
430  while($row = $this->db->fetchAssoc($result))
431  {
432  $this->db->update('frm_posts',
433  array('pos_status' => array('integer', 0)),
434  array('pos_pk' => array('integer', $row['pos_pk'])));
435  }
436 
437  return true;
438  }
439 
440  return false;
441  }
$result

◆ getCensorshipComment()

ilForumPost::getCensorshipComment ( )

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

References $censorship_comment.

Referenced by ilForumExportGUI\executeCommand().

589  {
591  }
+ Here is the caller graph for this function:

◆ getChangeDate()

ilForumPost::getChangeDate ( )

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

References $changedate.

Referenced by ilForumExportGUI\executeCommand().

565  {
566  return $this->changedate;
567  }
+ Here is the caller graph for this function:

◆ getCreateDate()

ilForumPost::getCreateDate ( )

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

References $createdate.

Referenced by ilForumExportGUI\executeCommand().

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

◆ getDataAsArray()

ilForumPost::getDataAsArray ( )

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

References $data.

155  {
156  $data = array(
157  'pos_pk' => $this->id,
158  'pos_top_fk' => $this->forum_id,
159  'pos_thr_fk' => $this->thread_id,
160  'pos_usr_id' => $this->user_id,
161  'pos_usr_alias' => $this->user_alias,
162  'title' => $this->fullname,
163  'loginname' => $this->loginname,
164  'pos_message' => $this->message,
165  'pos_subject' => $this->subject,
166  'pos_cens_com' => $this->censorship_comment,
167  'pos_cens' => $this->censored,
168  'pos_date' => $this->createdate,
169  'pos_update' => $this->changedate,
170  'update_user' => $this->user_id_update,
171  'notify' => $this->notification,
172  'import_name' => $this->import_name,
173  'pos_status' => $this->status
174  );
175 
176  return $data;
177  }
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data

◆ getDataAsArrayForExplorer()

ilForumPost::getDataAsArrayForExplorer ( )

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

References $data.

180  {
181  $data = array(
182  'pos_pk' => $this->id,
183  'child' => $this->id,
184  'author' => $this->user_id,
185  'alias' => $this->user_alias,
186  'title' => $this->fullname,
187  'loginname' => $this->loginname,
188  'type' => 'post',
189  'message' => $this->message,
190  'subject' => $this->subject,
191  'pos_cens_com' => $this->censorship_comment,
192  'pos_cens' => $this->censored,
193  'date' => $this->createdate,
194  'create_date' => $this->createdate,
195  'update' => $this->changedate,
196  'update_user' => $this->user_id_update,
197  'tree' => $this->thread_id,
198  'parent' => $this->parent_id,
199  'lft' => $this->lft,
200  'rgt' => $this->rgt,
201  'depth' => $this->depth,
202  'id' => $this->tree_id,
203  'notify' => $this->notification,
204  'import_name' => $this->import_name,
205  'pos_status' => $this->status
206  );
207 
208  return $data;
209  }
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data

◆ getDepth()

ilForumPost::getDepth ( )

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

References $depth.

664  {
665  return $this->depth;
666  }

◆ getForumId()

ilForumPost::getForumId ( )

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

References $forum_id.

509  {
510  return $this->forum_id;
511  }

◆ getFullname()

ilForumPost::getFullname ( )

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

References $fullname.

331  {
332  return $this->fullname;
333  }

◆ getId()

ilForumPost::getId ( )

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

References $id.

Referenced by ilForumExportGUI\executeCommand().

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

◆ getImportName()

ilForumPost::getImportName ( )

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

References $import_name.

Referenced by ilForumExportGUI\executeCommand().

605  {
606  return $this->import_name;
607  }
+ Here is the caller graph for this function:

◆ getIsRead()

ilForumPost::getIsRead ( )

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

References $post_read.

Referenced by isPostRead().

635  {
636  return $this->post_read;
637  }
+ Here is the caller graph for this function:

◆ getLft()

ilForumPost::getLft ( )

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

References $lft.

Referenced by ilForumTopic\getPostTree().

648  {
649  return $this->lft;
650  }
+ Here is the caller graph for this function:

◆ getLoginName()

ilForumPost::getLoginName ( )

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

References $loginname.

339  {
340  return $this->loginname;
341  }

◆ getMessage()

ilForumPost::getMessage ( )

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

References $message.

Referenced by ilForumExportGUI\executeCommand().

549  {
550  return $this->message;
551  }
+ Here is the caller graph for this function:

◆ getParentId()

ilForumPost::getParentId ( )

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

References $parent_id.

640  {
641  return $this->parent_id;
642  }

◆ getRgt()

ilForumPost::getRgt ( )

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

References $rgt.

Referenced by ilForumTopic\getPostTree().

656  {
657  return $this->rgt;
658  }
+ Here is the caller graph for this function:

◆ getSubject()

ilForumPost::getSubject ( )

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

References $subject.

Referenced by ilForumExportGUI\executeCommand().

541  {
542  return $this->subject;
543  }
+ Here is the caller graph for this function:

◆ getThread()

ilForumPost::getThread ( )

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

References $objThread.

672  {
673  return $this->objThread;
674  }

◆ getThreadId()

ilForumPost::getThreadId ( )

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

References $thread_id.

Referenced by ilForumTopic\getPostTree().

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

◆ getTreeId()

ilForumPost::getTreeId ( )

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

References $tree_id.

621  {
622  return $this->tree_id;
623  }

◆ getUpdateUserId()

ilForumPost::getUpdateUserId ( )

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

References $user_id_update.

Referenced by ilForumExportGUI\executeCommand().

573  {
574  return $this->user_id_update;
575  }
+ Here is the caller graph for this function:

◆ getUserAlias()

ilForumPost::getUserAlias ( )

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

References $user_alias.

Referenced by ilForumExportGUI\executeCommand().

533  {
534  return $this->user_alias;
535  }
+ Here is the caller graph for this function:

◆ getUserData()

ilForumPost::getUserData ( )
private

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

References $lng, and ilObjForumAccess\getCachedUserInstance().

Referenced by read().

300  {
301  global $lng;
302 
303  if ($this->id && $this->user_id)
304  {
305  require_once("Modules/Forum/classes/class.ilObjForumAccess.php");
306  if(($tmp_user = ilObjForumAccess::getCachedUserInstance($this->user_id)))
307  {
308  $this->fullname = $tmp_user->getFullname();
309  $this->loginname = $tmp_user->getLogin();
310  unset($tmp_user);
311  }
312 
313  $this->fullname = $this->fullname ? $this->fullname : ($this->import_name ? $this->import_name : $lng->txt('unknown'));
314 
315  return true;
316  }
317 
318  return false;
319  }
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:

◆ getUserId()

ilForumPost::getUserId ( )

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

References $user_id.

Referenced by ilForumExportGUI\executeCommand().

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

◆ hasReplies()

ilForumPost::hasReplies ( )

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

References $res.

467  {
468  if ($this->id && $this->rgt && $this->lft)
469  {
470  $res = $this->db->queryf('
471  SELECT * FROM frm_posts_tree
472  WHERE lft > %s AND rgt < %s
473  AND thr_fk = %s',
474  array('integer', 'integer', 'integer'),
475  array($this->lft, $this->rgt, $this->thread_id));
476 
477  return $res->numRows() ? true : false;
478  }
479 
480  return false;
481  }

◆ insert()

ilForumPost::insert ( )

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

87  {
88  global $ilDB;
89 
90  if ($this->forum_id && $this->thread_id)
91  {
92  $this->id = $this->db->nextId('frm_posts');
93 
94  $ilDB->insert('frm_posts', array(
95  'pos_pk' => array('integer', $this->id),
96  'pos_top_fk' => array('integer', $this->forum_id),
97  'pos_thr_fk' => array('integer', $this->thread_id),
98  'pos_usr_id' => array('integer', $this->user_id),
99  'pos_usr_alias' => array('text', $this->user_alias),
100  'pos_subject' => array('text', $this->subject),
101  'pos_message' => array('clob', $this->message),
102  'pos_date' => array('timestamp', $this->createdate),
103  'pos_update' => array('timestamp', $this->createdate),
104  'update_user' => array('integer', $this->user_id_update),
105  'pos_cens' => array('integer', $this->censored),
106  'notify' => array('integer', (int)$this->notification),
107  'import_name' => array('text', (string)$this->import_name),
108  'pos_status' => array('integer', (int)$this->status)
109  ));
110 
111  return true;
112  }
113 
114  return false;
115  }

◆ isActivated()

ilForumPost::isActivated ( )

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

Referenced by ilForumExportGUI\executeCommand().

613  {
614  return $this->status == 1 ? true : false;
615  }
+ Here is the caller graph for this function:

◆ isAnyParentDeactivated()

ilForumPost::isAnyParentDeactivated ( )

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

References $res.

259  {
260  if ($this->id)
261  {
262  $res = $this->db->queryf('
263  SELECT * FROM frm_posts_tree
264  INNER JOIN frm_posts ON pos_pk = pos_fk
265  WHERE pos_status = %s
266  AND lft < %s AND rgt > %s
267  AND thr_fk = %s',
268  array('integer', 'integer', 'integer', 'integer'),
269  array('0', $this->lft, $this->rgt, $this->thread_id));
270 
271  return $res->numRows();
272  }
273 
274  return false;
275  }

◆ isCensored()

ilForumPost::isCensored ( )

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

Referenced by ilForumExportGUI\executeCommand().

581  {
582  return $this->censored == 1 ? true : false;
583  }
+ Here is the caller graph for this function:

◆ isNotificationEnabled()

ilForumPost::isNotificationEnabled ( )

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

597  {
598  return $this->notification == 1 ? true : false;
599  }

◆ isOwner()

ilForumPost::isOwner (   $a_user_id = 0)

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

Referenced by ilForumExportGUI\executeCommand().

484  {
485  if ($this->user_id && $a_user_id)
486  {
487  if ((int) $this->user_id == (int) $a_user_id)
488  {
489  return true;
490  }
491  return false;
492  }
493  return false;
494  }
+ Here is the caller graph for this function:

◆ isPostRead()

ilForumPost::isPostRead ( )

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

References getIsRead().

444  {
445  return $this->getIsRead();
446  }
+ Here is the call graph for this function:

◆ isRead()

ilForumPost::isRead (   $a_user_id = 0)

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

References $res.

449  {
450  if ($a_user_id && $this->id)
451  {
452 
453  $res = $this->db->queryf('
454  SELECT * FROM frm_user_read
455  WHERE usr_id = %s
456  AND post_id = %s',
457  array('integer', 'integer'),
458  array($a_user_id, $this->id));
459 
460  return $res->numRows() ? true : false;
461  }
462 
463  return false;
464  }

◆ mergePosts()

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

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

Referenced by ilForum\mergeThreads().

702  {
703  global $ilDB;
704 
705  $ilDB->update('frm_posts',
706  array('pos_thr_fk' => array('integer', $target_thread_id)),
707  array('pos_thr_fk' => array('integer', $source_thread_id)));
708  }
+ Here is the caller graph for this function:

◆ read()

ilForumPost::read ( )
private

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

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

Referenced by __construct(), and reload().

212  {
213  if ($this->id)
214  {
215  $res = $this->db->queryf('
216  SELECT * FROM frm_posts
217  INNER JOIN frm_posts_tree ON pos_fk = pos_pk
218  WHERE pos_pk = %s',
219  array('integer'), array($this->id));
220  $row = $res->fetchRow(DB_FETCHMODE_OBJECT);
221 
222  if (is_object($row))
223  {
224  $this->id = $row->pos_pk;
225  $this->forum_id = $row->pos_top_fk;
226  $this->thread_id = $row->pos_thr_fk;
227  $this->user_id = $row->pos_usr_id;
228  $this->user_alias = $row->pos_usr_alias;
229  $this->subject = $row->pos_subject;
230  $this->message = $row->pos_message;
231  $this->createdate = $row->pos_date;
232  $this->changedate = $row->pos_update;
233  $this->user_id_update = $row->update_user;
234  $this->censored = $row->pos_cens;
235  $this->censorship_comment = $row->pos_cens_com;
236  $this->notification = $row->notify;
237  $this->import_name = $row->import_name ;
238  $this->status = $row->pos_status;
239  $this->tree_id = $row->fpt_pk;
240  $this->parent_id = $row->parent_pos;
241  $this->lft = $row->lft;
242  $this->rgt = $row->rgt;
243  $this->depth = $row->depth;
244 
245  $this->getUserData();
246 
247  $this->objThread = new ilForumTopic($this->thread_id, $this->is_moderator);
248 
249  return true;
250  }
251 
252  return false;
253  }
254 
255  return false;
256  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reload()

ilForumPost::reload ( )

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

References read().

322  {
323  return $this->read();
324  }
+ Here is the call graph for this function:

◆ setCensorship()

ilForumPost::setCensorship (   $a_censorship)

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

Referenced by assignData().

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

◆ setCensorshipComment()

ilForumPost::setCensorshipComment (   $a_comment)

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

Referenced by assignData().

585  {
586  $this->censorship_comment = $a_comment;
587  }
+ Here is the caller graph for this function:

◆ setChangeDate()

ilForumPost::setChangeDate (   $a_changedate)

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

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

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

◆ setCreateDate()

ilForumPost::setCreateDate (   $a_createdate)

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

Referenced by assignData().

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

◆ setDepth()

ilForumPost::setDepth (   $a_depth)

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

Referenced by assignData().

660  {
661  $this->depth = $a_depth;
662  }
+ Here is the caller graph for this function:

◆ setForumId()

ilForumPost::setForumId (   $a_forum_id)

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

Referenced by assignData().

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

◆ setFullname()

ilForumPost::setFullname (   $a_fullname)

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

327  {
328  $this->fullname = $a_fullname;
329  }

◆ setId()

ilForumPost::setId (   $a_id)

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

497  {
498  $this->id = $a_id;
499  }

◆ setImportName()

ilForumPost::setImportName (   $a_import_name)

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

Referenced by assignData().

601  {
602  $this->import_name = $a_import_name;
603  }
+ Here is the caller graph for this function:

◆ setIsRead()

ilForumPost::setIsRead (   $a_is_read)

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

Referenced by assignData().

630  {
631  $this->post_read = $a_is_read;
632  }
+ Here is the caller graph for this function:

◆ setLft()

ilForumPost::setLft (   $a_lft)

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

Referenced by assignData().

644  {
645  $this->lft = $a_lft;
646  }
+ Here is the caller graph for this function:

◆ setLoginName()

ilForumPost::setLoginName (   $a_loginname)

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

335  {
336  $this->loginname = $a_loginname;
337  }

◆ setMessage()

ilForumPost::setMessage (   $a_message)

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

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

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

◆ setNotification()

ilForumPost::setNotification (   $a_notification)

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

Referenced by assignData().

593  {
594  $this->notification = $a_notification;
595  }
+ Here is the caller graph for this function:

◆ setParentId()

ilForumPost::setParentId (   $a_parent_id)

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

Referenced by assignData().

625  {
626  $this->parent_id = $a_parent_id;
627  }
+ Here is the caller graph for this function:

◆ setRgt()

ilForumPost::setRgt (   $a_rgt)

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

Referenced by assignData().

652  {
653  $this->rgt = $a_rgt;
654  }
+ Here is the caller graph for this function:

◆ setStatus()

ilForumPost::setStatus (   $a_status)

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

Referenced by assignData().

609  {
610  $this->status = $a_status;
611  }
+ Here is the caller graph for this function:

◆ setSubject()

ilForumPost::setSubject (   $a_subject)

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

Referenced by assignData().

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

◆ setThread()

ilForumPost::setThread ( ilForumTopic  $thread)

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

668  {
669  $this->objThread = $thread;
670  }

◆ setThreadId()

ilForumPost::setThreadId (   $a_thread_id)

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

Referenced by assignData().

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

◆ setTreeId()

ilForumPost::setTreeId (   $a_tree_id)

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

Referenced by assignData().

617  {
618  $this->tree_id = $a_tree_id;
619  }
+ Here is the caller graph for this function:

◆ setUpdateUserId()

ilForumPost::setUpdateUserId (   $a_user_id_update)

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

Referenced by assignData().

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

◆ setUserAlias()

ilForumPost::setUserAlias (   $a_user_alias)

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

Referenced by assignData().

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

◆ setUserId()

ilForumPost::setUserId (   $a_user_id)

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

Referenced by assignData().

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

◆ update()

ilForumPost::update ( )

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

References $id.

118  {
119  global $ilDB;
120 
121  if($this->id)
122  {
123  $ilDB->update('frm_posts',
124  array(
125  'pos_top_fk' => array('integer', $this->forum_id),
126  'pos_thr_fk' => array('integer', $this->thread_id),
127  'pos_subject' => array('text', $this->subject),
128  'pos_message' => array('clob', $this->message),
129  'pos_update' => array('timestamp', $this->changedate),
130  'update_user' => array('integer', $this->user_id_update),
131  'pos_cens' => array('integer', $this->censored),
132  'pos_cens_com' => array('text', $this->censorship_comment),
133  'notify' => array('integer', (int)$this->notification),
134  'pos_status' => array('integer', (int)$this->status)
135  ),
136  array(
137  'pos_pk' => array('integer', (int)$this->id)
138  )
139  );
140 
141  if($this->objThread->getFirstPostId() == $this->id)
142  {
143  $this->objThread->setSubject($this->subject);
144  $this->objThread->update();
145  $this->objThread->reload();
146  }
147 
148  return true;
149  }
150 
151  return false;
152  }

Field Documentation

◆ $censored

ilForumPost::$censored = 0
private

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

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

◆ $depth

ilForumPost::$depth = 0
private

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

Referenced by getDepth().

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

Referenced by getImportName().

◆ $is_moderator

ilForumPost::$is_moderator = false
private

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

◆ $lft

ilForumPost::$lft = 0
private

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

Referenced by getLft().

◆ $loginname

ilForumPost::$loginname = ''
private

Definition at line 56 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 38 of file class.ilForumPost.php.

◆ $objThread

ilForumPost::$objThread = null
private

Definition at line 58 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().

◆ $post_read

ilForumPost::$post_read = false
private

Definition at line 64 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 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 44 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

ilForumPost::$user_id = 0
private

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

Referenced by getUserId().

◆ $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: