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                 $this->
setId($ilDB->nextId(
"il_news_item"));
 
  423                 $ilDB->insert(
"il_news_item", array(
 
  424                         "id" => array(
"integer", $this->
getId()),
 
  425                         "title" => array(
"text", $this->
getTitle()),
 
  426                         "content" => array(
"clob", $this->
getContent()),
 
  432                         "creation_date" => array(
"timestamp", 
ilUtil::now()),
 
  433                         "update_date" => array(
"timestamp", 
ilUtil::now()),
 
  434                         "user_id" => array(
"integer", $this->
getUserId()),
 
  437                         "priority" => array(
"integer", $this->
getPriority()),
 
  439                         "mob_id" => array(
"integer", $this->
getMobId()),
 
  452                 $query = 
"SELECT * FROM il_news_item WHERE id = ".
 
  453                         $ilDB->quote($this->
getId(), 
"integer");
 
  454                 $set = $ilDB->query(
$query);
 
  455                 $rec = $ilDB->fetchAssoc($set);
 
  484                 $ilDB->update(
"il_news_item", array(
 
  485                         "title" => array(
"text", $this->
getTitle()),
 
  486                         "content" => array(
"clob", $this->
getContent()),
 
  492                         "update_date" => array(
"timestamp", 
ilUtil::now()),
 
  493                         "user_id" => array(
"integer", $this->
getUserId()),
 
  496                         "priority" => array(
"integer", $this->
getPriority()),
 
  498                         "mob_id" => array(
"integer", $this->
getMobId()),
 
  501                         "id" => array(
"integer", $this->
getId())
 
  510         public function delete()
 
  514                 $query = 
"DELETE FROM il_news_item".
 
  515                         " WHERE id = ".$ilDB->quote($this->
getId(), 
"integer");
 
  517                 $ilDB->manipulate(
$query);
 
  529         $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 ".
 
  530                         "FROM il_news_item ".
 
  536                 " ORDER BY creation_date DESC ".
 
  538                 $set = $ilDB->query(
$query);
 
  540                 while($rec = $ilDB->fetchAssoc($set))
 
  557         $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 ".
 
  558                         "FROM il_news_item ".
 
  564                                 " AND visibility = ".$ilDB->quote($this->
getVisibility(), 
"text").
 
  565                 " ORDER BY creation_date DESC ".
 
  568                 $set = $ilDB->query(
$query);
 
  570                 while($rec = $ilDB->fetchAssoc($set))