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");
100 $this->title = $a_title;
120 $this->content = $a_content;
140 $this->context_obj_id = $a_context_obj_id;
160 $this->context_obj_type = $a_context_obj_type;
180 $this->context_sub_obj_id = $a_context_sub_obj_id;
200 $this->context_sub_obj_type = $a_context_sub_obj_type;
220 $this->content_type = $a_content_type;
240 $this->creation_date = $a_creation_date;
260 $this->update_date = $a_update_date;
280 $this->user_id = $a_user_id;
300 $this->visibility = $a_visibility;
320 $this->content_long = $a_content_long;
340 $this->priority = $a_priority;
360 $this->content_is_lang_var = $a_content_is_lang_var;
380 $this->mob_id = $a_mob_id;
400 $this->playtime = $a_playtime;
421 $this->
setId($ilDB->nextId(
"il_news_item"));
422 $ilDB->insert(
"il_news_item", array(
423 "id" => array(
"integer", $this->
getId()),
424 "title" => array(
"text", $this->
getTitle()),
425 "content" => array(
"clob", $this->
getContent()),
431 "creation_date" => array(
"timestamp",
ilUtil::now()),
432 "update_date" => array(
"timestamp",
ilUtil::now()),
433 "user_id" => array(
"integer", $this->
getUserId()),
436 "priority" => array(
"integer", $this->
getPriority()),
438 "mob_id" => array(
"integer", $this->
getMobId()),
451 $query =
"SELECT * FROM il_news_item WHERE id = ".
452 $ilDB->quote($this->
getId(),
"integer");
453 $set = $ilDB->query(
$query);
454 $rec = $ilDB->fetchAssoc($set);
483 $ilDB->update(
"il_news_item", array(
484 "title" => array(
"text", $this->
getTitle()),
485 "content" => array(
"clob", $this->
getContent()),
491 "update_date" => array(
"timestamp",
ilUtil::now()),
492 "user_id" => array(
"integer", $this->
getUserId()),
495 "priority" => array(
"integer", $this->
getPriority()),
497 "mob_id" => array(
"integer", $this->
getMobId()),
500 "id" => array(
"integer", $this->
getId())
509 public function delete()
513 $query =
"DELETE FROM il_news_item".
514 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
516 $ilDB->manipulate(
$query);
528 $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 ".
529 "FROM il_news_item ".
535 " ORDER BY creation_date DESC ".
537 $set = $ilDB->query(
$query);
539 while($rec = $ilDB->fetchAssoc($set))
556 $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 ".
557 "FROM il_news_item ".
563 " AND visibility = ".$ilDB->quote($this->
getVisibility(),
"text").
564 " ORDER BY creation_date DESC ".
567 $set = $ilDB->query(
$query);
569 while($rec = $ilDB->fetchAssoc($set))