ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilForumPostsDeleted Class Reference

Class ilForumPostsDeleted. More...

+ Collaboration diagram for ilForumPostsDeleted:

Public Member Functions

 __construct (?ilForumNotificationDataProvider $provider=null)
 
 insert ()
 
 deleteNotifiedEntries ()
 
 getDeletedId ()
 
 setDeletedId (int $deleted_id)
 
 getDeletedDate ()
 
 setDeletedDate (string $deleted_date)
 
 getDeletedBy ()
 
 setDeletedBy (string $deleted_by)
 
 getForumTitle ()
 
 setForumTitle (string $forum_title)
 
 getThreadTitle ()
 
 setThreadTitle (string $thread_title)
 
 getPostTitle ()
 
 setPostTitle (string $post_title)
 
 getPostMessage ()
 
 setPostMessage (string $post_message)
 
 getPostDate ()
 
 setPostDate (string $post_date)
 
 getObjId ()
 
 setObjId (int $obj_id)
 
 getRefId ()
 
 setRefId (int $ref_id)
 
 getThreadId ()
 
 setThreadId (int $thread_id)
 
 getForumId ()
 
 setForumId (int $forum_id)
 
 getPosDisplayUserId ()
 
 setPosDisplayUserId (int $pos_display_user_id)
 
 getPosUserAlias ()
 
 setPosUserAlias (string $pos_usr_alias)
 
 isThreadDeleted ()
 
 setThreadDeleted (bool $thread_deleted)
 

Protected Attributes

int $deleted_id = 0
 
string $deleted_date
 
string $deleted_by = ''
 
string $forum_title = ''
 
string $thread_title = ''
 
string $post_title = ''
 
string $post_message = ''
 
string $post_date = ''
 
int $obj_id = 0
 
int $ref_id = 0
 
int $thread_id = 0
 
int $forum_id = 0
 
int $pos_display_user_id = 0
 
string $pos_usr_alias = ''
 
bool $thread_deleted = false
 

Private Attributes

readonly ilDBInterface $db
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilForumPostsDeleted::__construct ( ?ilForumNotificationDataProvider  $provider = null)

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

45 {
46 global $DIC;
47
48 $this->db = $DIC->database();
49
50 if ($provider !== null) {
51 if (
52 $provider->objPost->getUserAlias() && $provider->objPost->getDisplayUserId() === 0 &&
53 $provider->objPost->getPosAuthorId() === $DIC->user()->getId()
54 ) {
55 $this->setDeletedBy($provider->objPost->getUserAlias());
56 } else {
57 $user = $DIC->user();
58 $this->setDeletedBy($user->getLogin());
59 }
60
61 $this->setDeletedDate(date('Y-m-d H:i:s'));
62 $this->setForumTitle($provider->getForumTitle());
63 $this->setThreadTitle($provider->getThreadTitle());
64 $this->setPostTitle($provider->getPostTitle());
65
66 if ($provider->isPostCensored()) {
67 $this->setPostMessage($provider->getCensorshipComment());
68 } else {
69 $this->setPostMessage($provider->getPostMessage());
70 }
71
72 $this->setPostDate($provider->getPostDate());
73 $this->setObjId($provider->getObjId());
74 $this->setRefId($provider->getRefId());
75 $this->setThreadId($provider->getThreadId());
76 $this->setForumId($provider->getForumId());
77 $this->setPosDisplayUserId($provider->getPosDisplayUserId());
78 $this->setPosUserAlias($provider->getPosUserAlias());
79 }
80 }
setThreadTitle(string $thread_title)
setPostTitle(string $post_title)
setPosDisplayUserId(int $pos_display_user_id)
setPosUserAlias(string $pos_usr_alias)
setPostMessage(string $post_message)
setDeletedDate(string $deleted_date)
setForumTitle(string $forum_title)
setDeletedBy(string $deleted_by)
$provider
Definition: ltitoken.php:80
global $DIC
Definition: shib_login.php:26

References $DIC, $provider, setDeletedBy(), setDeletedDate(), setForumId(), setForumTitle(), setObjId(), setPosDisplayUserId(), setPostDate(), setPostMessage(), setPostTitle(), setPosUserAlias(), setRefId(), setThreadId(), and setThreadTitle().

+ Here is the call graph for this function:

Member Function Documentation

◆ deleteNotifiedEntries()

ilForumPostsDeleted::deleteNotifiedEntries ( )

Definition at line 106 of file class.ilForumPostsDeleted.php.

106 : void
107 {
108 $this->db->manipulateF('DELETE FROM frm_posts_deleted WHERE deleted_id > %s', ['integer'], [0]);
109 }

◆ getDeletedBy()

ilForumPostsDeleted::getDeletedBy ( )

Definition at line 131 of file class.ilForumPostsDeleted.php.

131 : string
132 {
133 return $this->deleted_by;
134 }

References $deleted_by.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getDeletedDate()

ilForumPostsDeleted::getDeletedDate ( )

Definition at line 121 of file class.ilForumPostsDeleted.php.

121 : string
122 {
123 return $this->deleted_date;
124 }

References $deleted_date.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getDeletedId()

ilForumPostsDeleted::getDeletedId ( )

Definition at line 111 of file class.ilForumPostsDeleted.php.

111 : int
112 {
113 return $this->deleted_id;
114 }

References $deleted_id.

◆ getForumId()

ilForumPostsDeleted::getForumId ( )

Definition at line 221 of file class.ilForumPostsDeleted.php.

221 : int
222 {
223 return $this->forum_id;
224 }

References $forum_id.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getForumTitle()

ilForumPostsDeleted::getForumTitle ( )

Definition at line 141 of file class.ilForumPostsDeleted.php.

141 : string
142 {
143 return $this->forum_title;
144 }

References $forum_title.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getObjId()

ilForumPostsDeleted::getObjId ( )

Definition at line 191 of file class.ilForumPostsDeleted.php.

191 : int
192 {
193 return $this->obj_id;
194 }

References $obj_id.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getPosDisplayUserId()

ilForumPostsDeleted::getPosDisplayUserId ( )

Definition at line 231 of file class.ilForumPostsDeleted.php.

231 : int
232 {
234 }

References $pos_display_user_id.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getPostDate()

ilForumPostsDeleted::getPostDate ( )

Definition at line 181 of file class.ilForumPostsDeleted.php.

181 : string
182 {
183 return $this->post_date;
184 }

References $post_date.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getPostMessage()

ilForumPostsDeleted::getPostMessage ( )

Definition at line 171 of file class.ilForumPostsDeleted.php.

171 : string
172 {
173 return $this->post_message;
174 }

References $post_message.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getPostTitle()

ilForumPostsDeleted::getPostTitle ( )

Definition at line 161 of file class.ilForumPostsDeleted.php.

161 : string
162 {
163 return $this->post_title;
164 }

References $post_title.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getPosUserAlias()

ilForumPostsDeleted::getPosUserAlias ( )

Definition at line 241 of file class.ilForumPostsDeleted.php.

241 : string
242 {
244 }

References $pos_usr_alias.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getRefId()

ilForumPostsDeleted::getRefId ( )

Definition at line 201 of file class.ilForumPostsDeleted.php.

201 : int
202 {
203 return $this->ref_id;
204 }

References $ref_id.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getThreadId()

ilForumPostsDeleted::getThreadId ( )

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

211 : int
212 {
213 return $this->thread_id;
214 }

References $thread_id.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getThreadTitle()

ilForumPostsDeleted::getThreadTitle ( )

Definition at line 151 of file class.ilForumPostsDeleted.php.

151 : string
152 {
153 return $this->thread_title;
154 }

References $thread_title.

Referenced by insert().

+ Here is the caller graph for this function:

◆ insert()

ilForumPostsDeleted::insert ( )

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

82 : void
83 {
84 $next_id = $this->db->nextId('frm_posts_deleted');
85
86 $this->db->insert('frm_posts_deleted', [
87 'deleted_id' => ['integer', $next_id],
88 'deleted_date' => ['timestamp', $this->getDeletedDate()],
89 'deleted_by' => ['text', $this->getDeletedBy()],
90 'forum_title' => ['text', $this->getForumTitle()],
91 'thread_title' => ['text', $this->getThreadTitle()],
92 'post_title' => ['text', $this->getPostTitle()],
93 'post_message' => ['text', $this->getPostMessage()],
94
95 'post_date' => ['timestamp', $this->getPostDate()],
96 'obj_id' => ['integer', $this->getObjId()],
97 'ref_id' => ['integer', $this->getRefId()],
98 'thread_id' => ['integer', $this->getThreadId()],
99 'forum_id' => ['integer', $this->getForumId()],
100 'pos_display_user_id' => ['integer', $this->getPosDisplayUserId()],
101 'pos_usr_alias' => ['text', $this->getPosUserAlias()],
102 'is_thread_deleted' => ['integer', $this->isThreadDeleted()]
103 ]);
104 }

References getDeletedBy(), getDeletedDate(), getForumId(), getForumTitle(), getObjId(), getPosDisplayUserId(), getPostDate(), getPostMessage(), getPostTitle(), getPosUserAlias(), getRefId(), getThreadId(), getThreadTitle(), and isThreadDeleted().

+ Here is the call graph for this function:

◆ isThreadDeleted()

ilForumPostsDeleted::isThreadDeleted ( )

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

251 : bool
252 {
254 }

References $thread_deleted.

Referenced by insert().

+ Here is the caller graph for this function:

◆ setDeletedBy()

ilForumPostsDeleted::setDeletedBy ( string  $deleted_by)

Definition at line 136 of file class.ilForumPostsDeleted.php.

136 : void
137 {
138 $this->deleted_by = $deleted_by;
139 }

References $deleted_by.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setDeletedDate()

ilForumPostsDeleted::setDeletedDate ( string  $deleted_date)

Definition at line 126 of file class.ilForumPostsDeleted.php.

126 : void
127 {
128 $this->deleted_date = $deleted_date;
129 }

References $deleted_date.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setDeletedId()

ilForumPostsDeleted::setDeletedId ( int  $deleted_id)

Definition at line 116 of file class.ilForumPostsDeleted.php.

116 : void
117 {
118 $this->deleted_id = $deleted_id;
119 }

References $deleted_id.

◆ setForumId()

ilForumPostsDeleted::setForumId ( int  $forum_id)

Definition at line 226 of file class.ilForumPostsDeleted.php.

226 : void
227 {
228 $this->forum_id = $forum_id;
229 }

References $forum_id.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setForumTitle()

ilForumPostsDeleted::setForumTitle ( string  $forum_title)

Definition at line 146 of file class.ilForumPostsDeleted.php.

146 : void
147 {
148 $this->forum_title = $forum_title;
149 }

References $forum_title.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setObjId()

ilForumPostsDeleted::setObjId ( int  $obj_id)

Definition at line 196 of file class.ilForumPostsDeleted.php.

196 : void
197 {
198 $this->obj_id = $obj_id;
199 }

References $obj_id.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setPosDisplayUserId()

ilForumPostsDeleted::setPosDisplayUserId ( int  $pos_display_user_id)

Definition at line 236 of file class.ilForumPostsDeleted.php.

236 : void
237 {
238 $this->pos_display_user_id = $pos_display_user_id;
239 }

References $pos_display_user_id.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setPostDate()

ilForumPostsDeleted::setPostDate ( string  $post_date)

Definition at line 186 of file class.ilForumPostsDeleted.php.

186 : void
187 {
188 $this->post_date = $post_date;
189 }

References $post_date.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setPostMessage()

ilForumPostsDeleted::setPostMessage ( string  $post_message)

Definition at line 176 of file class.ilForumPostsDeleted.php.

176 : void
177 {
178 $this->post_message = $post_message;
179 }

References $post_message.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setPostTitle()

ilForumPostsDeleted::setPostTitle ( string  $post_title)

Definition at line 166 of file class.ilForumPostsDeleted.php.

166 : void
167 {
168 $this->post_title = $post_title;
169 }

References $post_title.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setPosUserAlias()

ilForumPostsDeleted::setPosUserAlias ( string  $pos_usr_alias)

Definition at line 246 of file class.ilForumPostsDeleted.php.

246 : void
247 {
248 $this->pos_usr_alias = $pos_usr_alias;
249 }

References $pos_usr_alias.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setRefId()

ilForumPostsDeleted::setRefId ( int  $ref_id)

Definition at line 206 of file class.ilForumPostsDeleted.php.

206 : void
207 {
208 $this->ref_id = $ref_id;
209 }

References $ref_id.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setThreadDeleted()

ilForumPostsDeleted::setThreadDeleted ( bool  $thread_deleted)

Definition at line 256 of file class.ilForumPostsDeleted.php.

256 : void
257 {
258 $this->thread_deleted = $thread_deleted;
259 }

References $thread_deleted.

◆ setThreadId()

ilForumPostsDeleted::setThreadId ( int  $thread_id)

Definition at line 216 of file class.ilForumPostsDeleted.php.

216 : void
217 {
218 $this->thread_id = $thread_id;
219 }

References $thread_id.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setThreadTitle()

ilForumPostsDeleted::setThreadTitle ( string  $thread_title)

Definition at line 156 of file class.ilForumPostsDeleted.php.

156 : void
157 {
158 $this->thread_title = $thread_title;
159 }

References $thread_title.

Referenced by __construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $db

readonly ilDBInterface ilForumPostsDeleted::$db
private

Definition at line 27 of file class.ilForumPostsDeleted.php.

◆ $deleted_by

string ilForumPostsDeleted::$deleted_by = ''
protected

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

Referenced by getDeletedBy(), and setDeletedBy().

◆ $deleted_date

string ilForumPostsDeleted::$deleted_date
protected

Definition at line 29 of file class.ilForumPostsDeleted.php.

Referenced by getDeletedDate(), and setDeletedDate().

◆ $deleted_id

int ilForumPostsDeleted::$deleted_id = 0
protected

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

Referenced by getDeletedId(), and setDeletedId().

◆ $forum_id

int ilForumPostsDeleted::$forum_id = 0
protected

Definition at line 39 of file class.ilForumPostsDeleted.php.

Referenced by getForumId(), and setForumId().

◆ $forum_title

string ilForumPostsDeleted::$forum_title = ''
protected

Definition at line 31 of file class.ilForumPostsDeleted.php.

Referenced by getForumTitle(), and setForumTitle().

◆ $obj_id

int ilForumPostsDeleted::$obj_id = 0
protected

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

Referenced by getObjId(), and setObjId().

◆ $pos_display_user_id

int ilForumPostsDeleted::$pos_display_user_id = 0
protected

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

Referenced by getPosDisplayUserId(), and setPosDisplayUserId().

◆ $pos_usr_alias

string ilForumPostsDeleted::$pos_usr_alias = ''
protected

Definition at line 41 of file class.ilForumPostsDeleted.php.

Referenced by getPosUserAlias(), and setPosUserAlias().

◆ $post_date

string ilForumPostsDeleted::$post_date = ''
protected

Definition at line 35 of file class.ilForumPostsDeleted.php.

Referenced by getPostDate(), and setPostDate().

◆ $post_message

string ilForumPostsDeleted::$post_message = ''
protected

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

Referenced by getPostMessage(), and setPostMessage().

◆ $post_title

string ilForumPostsDeleted::$post_title = ''
protected

Definition at line 33 of file class.ilForumPostsDeleted.php.

Referenced by getPostTitle(), and setPostTitle().

◆ $ref_id

int ilForumPostsDeleted::$ref_id = 0
protected

Definition at line 37 of file class.ilForumPostsDeleted.php.

Referenced by getRefId(), and setRefId().

◆ $thread_deleted

bool ilForumPostsDeleted::$thread_deleted = false
protected

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

Referenced by isThreadDeleted(), and setThreadDeleted().

◆ $thread_id

int ilForumPostsDeleted::$thread_id = 0
protected

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

Referenced by getThreadId(), and setThreadId().

◆ $thread_title

string ilForumPostsDeleted::$thread_title = ''
protected

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

Referenced by getThreadTitle(), and setThreadTitle().


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