ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
82 {
83 if(is_object($provider))
84 {
85 global $ilUser;
86
87 $this->setDeletedBy($ilUser->getLogin());
88 $this->setDeletedDate(date('Y-m-d H:i:s'));
89 $this->setForumTitle($provider->getForumTitle());
90 $this->setThreadTitle($provider->getThreadTitle());
91 $this->setPostTitle($provider->getPostTitle());
92
93 if($provider->getPostCensored() == 1)
94 {
95 $this->setPostMessage($provider->getCensorshipComment());
96 }
97 else
98 {
99 $this->setPostMessage($provider->getPostMessage());
100 }
101
102 $this->setPostDate($provider->getPostDate());
103 $this->setObjId($provider->getObjId());
104 $this->setRefId($provider->getRefId());
105 $this->setThreadId($provider->getThreadId());
106 $this->setForumId($provider->getForumId());
107 $this->setPosDisplayUserId($provider->getPosDisplayUserId());
108 $this->setPosUserAlias($provider->getPosUserAlias());
109 }
110 }
111
115 public function insert()
116 {
117 global $ilDB;
118
119 $next_id = $ilDB->nextId('frm_posts_deleted');
120
121 $ilDB->insert('frm_posts_deleted', array(
122 'deleted_id' => array('integer', $next_id),
123 'deleted_date' => array('timestamp', $this->getDeletedDate()),
124 'deleted_by' => array('text', $this->getDeletedBy()),
125 'forum_title' => array('text', $this->getForumTitle()),
126 'thread_title' => array('text', $this->getThreadTitle()),
127 'post_title' => array('text', $this->getPostTitle()),
128 'post_message' => array('text', $this->getPostMessage()),
129
130 'post_date' => array('timestamp', $this->getPostDate()),
131 'obj_id' => array('integer', $this->getObjId()),
132 'ref_id' => array('integer', $this->getRefId()),
133 'thread_id' => array('integer', $this->getThreadId()),
134 'forum_id' => array('integer', $this->getForumId()),
135 'pos_display_user_id' => array('integer', $this->getPosDisplayUserId()),
136 'pos_usr_alias' => array('text', $this->getPosUserAlias()),
137 'is_thread_deleted' => array('integer', $this->isThreadDeleted())
138 ));
139 }
140
144 public function deleteNotifiedEntries()
145 {
146 global $ilDB;
147
148 $ilDB->manipulateF('DELETE FROM frm_posts_deleted WHERE deleted_id > %s', array('integer'), array(0));
149 }
150
151
152 //----------------// SETTER & GETTER //----------------//
156 public function getDeletedId()
157 {
158 return $this->deleted_id;
159 }
160
164 public function setDeletedId($deleted_id)
165 {
166 $this->deleted_id = $deleted_id;
167 }
168
172 public function getDeletedDate()
173 {
174 return $this->deleted_date;
175 }
176
181 {
182 $this->deleted_date = $deleted_date;
183 }
184
188 public function getDeletedBy()
189 {
190 return $this->deleted_by;
191 }
192
196 public function setDeletedBy($deleted_by)
197 {
198 $this->deleted_by = $deleted_by;
199 }
200
204 public function getForumTitle()
205 {
206 return $this->forum_title;
207 }
208
213 {
214 $this->forum_title = $forum_title;
215 }
216
220 public function getThreadTitle()
221 {
222 return $this->thread_title;
223 }
224
229 {
230 $this->thread_title = $thread_title;
231 }
232
236 public function getPostTitle()
237 {
238 return $this->post_title;
239 }
240
244 public function setPostTitle($post_title)
245 {
246 $this->post_title = $post_title;
247 }
248
252 public function getPostMessage()
253 {
254 return $this->post_message;
255 }
256
261 {
262 $this->post_message = $post_message;
263 }
264
268 public function getPostDate()
269 {
270 return $this->post_date;
271 }
272
276 public function setPostDate($post_date)
277 {
278 $this->post_date = $post_date;
279 }
280
284 public function getObjId()
285 {
286 return $this->obj_id;
287 }
288
292 public function setObjId($obj_id)
293 {
294 $this->obj_id = $obj_id;
295 }
296
300 public function getRefId()
301 {
302 return $this->ref_id;
303 }
304
308 public function setRefId($ref_id)
309 {
310 $this->ref_id = $ref_id;
311 }
312
316 public function getThreadId()
317 {
318 return $this->thread_id;
319 }
320
324 public function setThreadId($thread_id)
325 {
326 $this->thread_id = $thread_id;
327 }
328
332 public function getForumId()
333 {
334 return $this->forum_id;
335 }
336
340 public function setForumId($forum_id)
341 {
342 $this->forum_id = $forum_id;
343 }
344
348 public function getPosDisplayUserId()
349 {
351 }
352
357 {
358 $this->pos_display_user_id = $pos_display_user_id;
359 }
360
364 public function getPosUserAlias()
365 {
367 }
368
373 {
374 $this->pos_usr_alias = $pos_usr_alias;
375 }
376
380 public function isThreadDeleted()
381 {
383 }
384
389 {
390 $this->thread_deleted = $thread_deleted;
391 }
392}
Class ilForumPostsDeleted.
setPosDisplayUserId($pos_display_user_id)
__construct(ilObjForumNotificationDataProvider $provider=NULL)
global $ilDB
global $ilUser
Definition: imgupload.php:15