ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilForumPostsDeleted.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
9 {
13  protected $deleted_id = 0;
17  protected $deleted_date = null;
21  protected $deleted_by = '';
22 
26  protected $forum_title = '';
30  protected $thread_title = '';
31 
35  protected $post_title = '';
39  protected $post_message = '';
40 
44  protected $post_date = '';
45 
49  protected $obj_id = 0;
53  protected $ref_id = 0;
57  protected $thread_id = 0;
58 
62  protected $forum_id = 0;
63 
67  protected $pos_display_user_id = 0;
71  protected $pos_usr_alias = '';
72 
76  protected $thread_deleted = false;
77 
78  private $user;
79  private $db;
80 
85  {
86  global $DIC;
87  $this->user = $DIC->user();
88  $this->db = $DIC->database();
89 
90  if (is_object($provider)) {
91  $this->setDeletedBy($provider->getDeletedBy());
92  $this->setDeletedDate(date('Y-m-d H:i:s'));
93  $this->setForumTitle($provider->getForumTitle());
94  $this->setThreadTitle($provider->getThreadTitle());
95  $this->setPostTitle($provider->getPostTitle());
96 
97  if ($provider->getPostCensored() == 1) {
98  $this->setPostMessage($provider->getCensorshipComment());
99  } else {
100  $this->setPostMessage($provider->getPostMessage());
101  }
102 
103  $this->setPostDate($provider->getPostDate());
104  $this->setObjId($provider->getObjId());
105  $this->setRefId($provider->getRefId());
106  $this->setThreadId($provider->getThreadId());
107  $this->setForumId($provider->getForumId());
108  $this->setPosDisplayUserId($provider->getPosDisplayUserId());
109  $this->setPosUserAlias($provider->getPosUserAlias());
110  }
111  }
112 
116  public function insert()
117  {
118  $next_id = $this->db->nextId('frm_posts_deleted');
119 
120  $this->db->insert('frm_posts_deleted', array(
121  'deleted_id' => array('integer', $next_id),
122  'deleted_date' => array('timestamp', $this->getDeletedDate()),
123  'deleted_by' => array('text', $this->getDeletedBy()),
124  'forum_title' => array('text', $this->getForumTitle()),
125  'thread_title' => array('text', $this->getThreadTitle()),
126  'post_title' => array('text', $this->getPostTitle()),
127  'post_message' => array('text', $this->getPostMessage()),
128 
129  'post_date' => array('timestamp', $this->getPostDate()),
130  'obj_id' => array('integer', $this->getObjId()),
131  'ref_id' => array('integer', $this->getRefId()),
132  'thread_id' => array('integer', $this->getThreadId()),
133  'forum_id' => array('integer', $this->getForumId()),
134  'pos_display_user_id' => array('integer', $this->getPosDisplayUserId()),
135  'pos_usr_alias' => array('text', $this->getPosUserAlias()),
136  'is_thread_deleted' => array('integer', $this->isThreadDeleted())
137  ));
138  }
139 
143  public function deleteNotifiedEntries()
144  {
145  $this->db->manipulateF('DELETE FROM frm_posts_deleted WHERE deleted_id > %s', array('integer'), array(0));
146  }
147 
148 
149  //----------------// SETTER & GETTER //----------------//
153  public function getDeletedId()
154  {
155  return $this->deleted_id;
156  }
157 
161  public function setDeletedId($deleted_id)
162  {
163  $this->deleted_id = $deleted_id;
164  }
165 
169  public function getDeletedDate()
170  {
171  return $this->deleted_date;
172  }
173 
177  public function setDeletedDate($deleted_date)
178  {
179  $this->deleted_date = $deleted_date;
180  }
181 
185  public function getDeletedBy()
186  {
187  return $this->deleted_by;
188  }
189 
193  public function setDeletedBy($deleted_by)
194  {
195  $this->deleted_by = $deleted_by;
196  }
197 
201  public function getForumTitle()
202  {
203  return $this->forum_title;
204  }
205 
209  public function setForumTitle($forum_title)
210  {
211  $this->forum_title = $forum_title;
212  }
213 
217  public function getThreadTitle()
218  {
219  return $this->thread_title;
220  }
221 
225  public function setThreadTitle($thread_title)
226  {
227  $this->thread_title = $thread_title;
228  }
229 
233  public function getPostTitle()
234  {
235  return $this->post_title;
236  }
237 
241  public function setPostTitle($post_title)
242  {
243  $this->post_title = $post_title;
244  }
245 
249  public function getPostMessage()
250  {
251  return $this->post_message;
252  }
253 
257  public function setPostMessage($post_message)
258  {
259  $this->post_message = $post_message;
260  }
261 
265  public function getPostDate()
266  {
267  return $this->post_date;
268  }
269 
273  public function setPostDate($post_date)
274  {
275  $this->post_date = $post_date;
276  }
277 
281  public function getObjId()
282  {
283  return $this->obj_id;
284  }
285 
289  public function setObjId($obj_id)
290  {
291  $this->obj_id = $obj_id;
292  }
293 
297  public function getRefId()
298  {
299  return $this->ref_id;
300  }
301 
305  public function setRefId($ref_id)
306  {
307  $this->ref_id = $ref_id;
308  }
309 
313  public function getThreadId()
314  {
315  return $this->thread_id;
316  }
317 
321  public function setThreadId($thread_id)
322  {
323  $this->thread_id = $thread_id;
324  }
325 
329  public function getForumId()
330  {
331  return $this->forum_id;
332  }
333 
337  public function setForumId($forum_id)
338  {
339  $this->forum_id = $forum_id;
340  }
341 
345  public function getPosDisplayUserId()
346  {
348  }
349 
354  {
355  $this->pos_display_user_id = $pos_display_user_id;
356  }
357 
361  public function getPosUserAlias()
362  {
363  return $this->pos_usr_alias;
364  }
365 
370  {
371  $this->pos_usr_alias = $pos_usr_alias;
372  }
373 
377  public function isThreadDeleted()
378  {
379  return $this->thread_deleted;
380  }
381 
386  {
387  $this->thread_deleted = $thread_deleted;
388  }
389 }
setPosDisplayUserId($pos_display_user_id)
Class ilObjForumNotificationDataProvider.
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
__construct(ilObjForumNotificationDataProvider $provider=null)
Class ilForumPostsDeleted.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.