28 $this->
setId((
int)$a_id);
60 $this->title = $a_title;
80 $this->content = $a_content;
101 $this->creation_date = $a_creation_date;
121 $this->update_date = $a_update_date;
141 $this->visibility = $a_visibility;
161 $this->user_id = $a_user_id;
184 $next_id = $ilDB->nextId(
'payment_news');
187 $ilDB->insert(
'payment_news', array(
188 'news_id' => array(
'integer', $next_id),
189 'news_title' => array(
'text', $this->
getTitle()),
190 'news_content' => array(
'clob', $this->
getContent()),
192 'creation_date' => array(
'timestamp', $createdate->get(
IL_CAL_DATETIME)),
193 'update_date' => array(
'timestamp', $createdate->get(
IL_CAL_DATETIME)),
194 'user_id' => array(
'integer', $this->
getUserId())
196 $this->
id = $next_id;
211 $result = $ilDB->queryf(
'SELECT * FROM payment_news WHERE news_id = %s',
213 array($this->
getId())
216 while($record = $ilDB->fetchAssoc($result))
218 $this->
setTitle($record[
'news_title']);
238 if((
int)$this->
getId())
240 $ilDB->update(
'payment_news',
242 'news_title' => array(
'text', $this->
getTitle()),
243 'news_content' => array(
'clob', $this->
getContent()),
245 'update_date' => array(
'timestamp', $updatedate->get(
IL_CAL_DATETIME)),
246 'user_id' => array(
'integer', $this->
getUserId())
249 'news_id' => array(
'integer', $this->
getId())
263 public function delete()
267 if((
int)$this->
getId())
269 $query =
'DELETE FROM payment_news WHERE news_id = %s';
270 $statement = $ilDB->manipulateF(
$query, array(
'integer'),array($this->
getId()));