24 define(
"NEWS_TEXT",
"text");
25 define(
"NEWS_HTML",
"html");
26 define(
"NEWS_AUDIO",
"audio");
27 define(
"NEWS_USERS",
"users");
28 define(
"NEWS_PUBLIC",
"public");
101 $this->title = $a_title;
121 $this->content = $a_content;
141 $this->context_obj_id = $a_context_obj_id;
161 $this->context_obj_type = $a_context_obj_type;
181 $this->context_sub_obj_id = $a_context_sub_obj_id;
201 $this->context_sub_obj_type = $a_context_sub_obj_type;
221 $this->content_type = $a_content_type;
241 $this->creation_date = $a_creation_date;
261 $this->update_date = $a_update_date;
281 $this->user_id = $a_user_id;
301 $this->visibility = $a_visibility;
321 $this->content_long = $a_content_long;
341 $this->priority = $a_priority;
361 $this->content_is_lang_var = $a_content_is_lang_var;
381 $this->mob_id = $a_mob_id;
401 $this->playtime = $a_playtime;
422 $query =
"INSERT INTO il_news_item (".
426 ", context_obj_type".
427 ", context_sub_obj_id".
428 ", context_sub_obj_type".
436 ", content_is_lang_var".
454 .
",".$ilDB->quote($this->
getMobId())
456 $ilDB->query($query);
457 $this->
setId($ilDB->getLastInsertId());
470 $query =
"SELECT * FROM il_news_item WHERE id = ".
471 $ilDB->quote($this->
getId());
472 $set = $ilDB->query($query);
502 $query =
"UPDATE il_news_item SET ".
503 " title = ".$ilDB->quote($this->
getTitle()).
504 ", content = ".$ilDB->quote($this->
getContent()).
511 ", update_date = now()".
512 ", user_id = ".$ilDB->quote($this->
getUserId()).
515 ", priority = ".$ilDB->quote($this->
getPriority()).
517 ", mob_id = ".$ilDB->quote($this->
getMobId()).
518 ", playtime = ".$ilDB->quote($this->
getPlaytime()).
519 " WHERE id = ".$ilDB->quote($this->
getId());
521 $ilDB->query($query);
529 public function delete()
533 $query =
"DELETE FROM il_news_item".
534 " WHERE id = ".$ilDB->quote($this->
getId());
536 $ilDB->query($query);
548 $query =
"SELECT id, title, content, context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, content_type, creation_date, update_date, user_id, visibility, content_long, priority, content_is_lang_var, mob_id, playtime ".
549 "FROM il_news_item ".
555 " ORDER BY creation_date DESC ".
558 $set = $ilDB->query($query);
577 $query =
"SELECT id, title, content, context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, content_type, creation_date, update_date, user_id, visibility, content_long, priority, content_is_lang_var, mob_id, playtime ".
578 "FROM il_news_item ".
585 " ORDER BY creation_date DESC ".
588 $set = $ilDB->query($query);