A news item can be created by different sources. More...
Inheritance diagram for ilNewsItemGen:Public Member Functions | |
| __construct ($a_id=0) | |
| Constructor. | |
| setId ($a_id) | |
| Set Id. | |
| getId () | |
| Get Id. | |
| setTitle ($a_title) | |
| Set Title. | |
| getTitle () | |
| Get Title. | |
| setContent ($a_content) | |
| Set Content. | |
| getContent () | |
| Get Content. | |
| setContextObjId ($a_context_obj_id) | |
| Set ContextObjId. | |
| getContextObjId () | |
| Get ContextObjId. | |
| setContextObjType ($a_context_obj_type) | |
| Set ContextObjType. | |
| getContextObjType () | |
| Get ContextObjType. | |
| setContextSubObjId ($a_context_sub_obj_id) | |
| Set ContextSubObjId. | |
| getContextSubObjId () | |
| Get ContextSubObjId. | |
| setContextSubObjType ($a_context_sub_obj_type) | |
| Set ContextSubObjType. | |
| getContextSubObjType () | |
| Get ContextSubObjType. | |
| setContentType ($a_content_type="text") | |
| Set ContentType. | |
| getContentType () | |
| Get ContentType. | |
| setCreationDate ($a_creation_date) | |
| Set CreationDate. | |
| getCreationDate () | |
| Get CreationDate. | |
| setUpdateDate ($a_update_date) | |
| Set UpdateDate. | |
| getUpdateDate () | |
| Get UpdateDate. | |
| setUserId ($a_user_id) | |
| Set UserId. | |
| getUserId () | |
| Get UserId. | |
| setVisibility ($a_visibility="users") | |
| Set Visibility. | |
| getVisibility () | |
| Get Visibility. | |
| setContentLong ($a_content_long) | |
| Set ContentLong. | |
| getContentLong () | |
| Get ContentLong. | |
| setPriority ($a_priority=1) | |
| Set Priority. | |
| getPriority () | |
| Get Priority. | |
| setContentIsLangVar ($a_content_is_lang_var=0) | |
| Set ContentIsLangVar. | |
| getContentIsLangVar () | |
| Get ContentIsLangVar. | |
| setMobId ($a_mob_id) | |
| Set MobId. | |
| getMobId () | |
| Get MobId. | |
| setPlaytime ($a_playtime) | |
| Set Playtime. | |
| getPlaytime () | |
| Get Playtime. | |
| create () | |
| Create new item. | |
| read () | |
| Read item from database. | |
| update () | |
| Update item in database. | |
| delete () | |
| Delete item from database. | |
| queryNewsForContext () | |
| Query NewsForContext. | |
| queryNewsForVisibility () | |
| Query NewsForVisibility. | |
Protected Attributes | |
| $id | |
| $title | |
| $content | |
| $context_obj_id | |
| $context_obj_type | |
| $context_sub_obj_id | |
| $context_sub_obj_type | |
| $content_type = "text" | |
| $creation_date | |
| $update_date | |
| $user_id | |
| $visibility = "users" | |
| $content_long | |
| $priority = 1 | |
| $content_is_lang_var = 0 | |
| $mob_id | |
| $playtime | |
A news item can be created by different sources.
E.g. when a new forum posting is created, or when a change in a learning module is announced.
Definition at line 38 of file class.ilNewsItemGen.php.
| ilNewsItemGen::__construct | ( | $ | a_id = 0 |
) |
Constructor.
| int | $a_id |
Reimplemented in ilNewsItem.
Definition at line 64 of file class.ilNewsItemGen.php.
References read(), and setId().
Here is the call graph for this function:| ilNewsItemGen::create | ( | ) |
Create new item.
Reimplemented in ilNewsItem.
Definition at line 418 of file class.ilNewsItemGen.php.
References getContent(), getContentIsLangVar(), getContentLong(), getContentType(), getContextObjId(), getContextObjType(), getContextSubObjId(), getContextSubObjType(), getMobId(), getPlaytime(), getPriority(), getTitle(), getUserId(), getVisibility(), and setId().
{
global $ilDB;
$query = "INSERT INTO il_news_item (".
" 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".
" ) VALUES (".
$ilDB->quote($this->getTitle())
.",".$ilDB->quote($this->getContent())
.",".$ilDB->quote($this->getContextObjId())
.",".$ilDB->quote($this->getContextObjType())
.",".$ilDB->quote($this->getContextSubObjId())
.",".$ilDB->quote($this->getContextSubObjType())
.",".$ilDB->quote($this->getContentType())
.","."now()"
.","."now()"
.",".$ilDB->quote($this->getUserId())
.",".$ilDB->quote($this->getVisibility())
.",".$ilDB->quote($this->getContentLong())
.",".$ilDB->quote($this->getPriority())
.",".$ilDB->quote($this->getContentIsLangVar())
.",".$ilDB->quote($this->getMobId())
.",".$ilDB->quote($this->getPlaytime()).")";
$ilDB->query($query);
$this->setId($ilDB->getLastInsertId());
}
Here is the call graph for this function:| ilNewsItemGen::delete | ( | ) |
Delete item from database.
Reimplemented in ilNewsItem.
Definition at line 529 of file class.ilNewsItemGen.php.
References getId().
{
global $ilDB;
$query = "DELETE FROM il_news_item".
" WHERE id = ".$ilDB->quote($this->getId());
$ilDB->query($query);
}
Here is the call graph for this function:| ilNewsItemGen::getContent | ( | ) |
Get Content.
Definition at line 129 of file class.ilNewsItemGen.php.
Referenced by create(), and update().
{
return $this->content;
}
Here is the caller graph for this function:| ilNewsItemGen::getContentIsLangVar | ( | ) |
Get ContentIsLangVar.
Definition at line 369 of file class.ilNewsItemGen.php.
Referenced by create(), and update().
{
return $this->content_is_lang_var;
}
Here is the caller graph for this function:| ilNewsItemGen::getContentLong | ( | ) |
Get ContentLong.
Definition at line 329 of file class.ilNewsItemGen.php.
Referenced by create(), and update().
{
return $this->content_long;
}
Here is the caller graph for this function:| ilNewsItemGen::getContentType | ( | ) |
Get ContentType.
Definition at line 229 of file class.ilNewsItemGen.php.
Referenced by create(), and update().
{
return $this->content_type;
}
Here is the caller graph for this function:| ilNewsItemGen::getContextObjId | ( | ) |
Get ContextObjId.
Definition at line 149 of file class.ilNewsItemGen.php.
Referenced by create(), ilNewsItem::create(), queryNewsForContext(), ilNewsItem::queryNewsForContext(), queryNewsForVisibility(), and update().
{
return $this->context_obj_id;
}
Here is the caller graph for this function:| ilNewsItemGen::getContextObjType | ( | ) |
Get ContextObjType.
Definition at line 169 of file class.ilNewsItemGen.php.
Referenced by create(), ilNewsItem::create(), queryNewsForContext(), ilNewsItem::queryNewsForContext(), queryNewsForVisibility(), and update().
{
return $this->context_obj_type;
}
Here is the caller graph for this function:| ilNewsItemGen::getContextSubObjId | ( | ) |
Get ContextSubObjId.
Definition at line 189 of file class.ilNewsItemGen.php.
Referenced by create(), ilNewsItem::create(), queryNewsForContext(), queryNewsForVisibility(), and update().
{
return $this->context_sub_obj_id;
}
Here is the caller graph for this function:| ilNewsItemGen::getContextSubObjType | ( | ) |
Get ContextSubObjType.
Definition at line 209 of file class.ilNewsItemGen.php.
Referenced by create(), ilNewsItem::create(), queryNewsForContext(), queryNewsForVisibility(), and update().
{
return $this->context_sub_obj_type;
}
Here is the caller graph for this function:| ilNewsItemGen::getCreationDate | ( | ) |
Get CreationDate.
Definition at line 249 of file class.ilNewsItemGen.php.
Referenced by update().
{
return $this->creation_date;
}
Here is the caller graph for this function:| ilNewsItemGen::getId | ( | ) |
Get Id.
Definition at line 89 of file class.ilNewsItemGen.php.
Referenced by delete(), ilNewsItem::delete(), read(), and update().
{
return $this->id;
}
Here is the caller graph for this function:| ilNewsItemGen::getMobId | ( | ) |
Get MobId.
Definition at line 389 of file class.ilNewsItemGen.php.
Referenced by create(), ilNewsItem::delete(), and update().
{
return $this->mob_id;
}
Here is the caller graph for this function:| ilNewsItemGen::getPlaytime | ( | ) |
Get Playtime.
Definition at line 409 of file class.ilNewsItemGen.php.
Referenced by create(), and update().
{
return $this->playtime;
}
Here is the caller graph for this function:| ilNewsItemGen::getPriority | ( | ) |
Get Priority.
Definition at line 349 of file class.ilNewsItemGen.php.
Referenced by create(), and update().
{
return $this->priority;
}
Here is the caller graph for this function:| ilNewsItemGen::getTitle | ( | ) |
Get Title.
Definition at line 109 of file class.ilNewsItemGen.php.
Referenced by create(), and update().
{
return $this->title;
}
Here is the caller graph for this function:| ilNewsItemGen::getUpdateDate | ( | ) |
Get UpdateDate.
Definition at line 269 of file class.ilNewsItemGen.php.
{
return $this->update_date;
}
| ilNewsItemGen::getUserId | ( | ) |
Get UserId.
Definition at line 289 of file class.ilNewsItemGen.php.
Referenced by create(), and update().
{
return $this->user_id;
}
Here is the caller graph for this function:| ilNewsItemGen::getVisibility | ( | ) |
Get Visibility.
Definition at line 309 of file class.ilNewsItemGen.php.
Referenced by create(), queryNewsForVisibility(), and update().
{
return $this->visibility;
}
Here is the caller graph for this function:| ilNewsItemGen::queryNewsForContext | ( | ) |
Query NewsForContext.
Definition at line 544 of file class.ilNewsItemGen.php.
References getContextObjId(), getContextObjType(), getContextSubObjId(), and getContextSubObjType().
{
global $ilDB;
$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 ".
"FROM il_news_item ".
"WHERE ".
"context_obj_id = ".$ilDB->quote($this->getContextObjId()).
" AND context_obj_type = ".$ilDB->quote($this->getContextObjType()).
" AND context_sub_obj_id = ".$ilDB->quote($this->getContextSubObjId()).
" AND context_sub_obj_type = ".$ilDB->quote($this->getContextSubObjType()).
" ORDER BY creation_date DESC ".
"";
$set = $ilDB->query($query);
$result = array();
while($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
$result[] = $rec;
}
return $result;
}
Here is the call graph for this function:| ilNewsItemGen::queryNewsForVisibility | ( | ) |
Query NewsForVisibility.
Definition at line 573 of file class.ilNewsItemGen.php.
References getContextObjId(), getContextObjType(), getContextSubObjId(), getContextSubObjType(), and getVisibility().
{
global $ilDB;
$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 ".
"FROM il_news_item ".
"WHERE ".
"context_obj_id = ".$ilDB->quote($this->getContextObjId()).
" AND context_obj_type = ".$ilDB->quote($this->getContextObjType()).
" AND context_sub_obj_id = ".$ilDB->quote($this->getContextSubObjId()).
" AND context_sub_obj_type = ".$ilDB->quote($this->getContextSubObjType()).
" AND visibility = ".$ilDB->quote($this->getVisibility()).
" ORDER BY creation_date DESC ".
"";
$set = $ilDB->query($query);
$result = array();
while($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
$result[] = $rec;
}
return $result;
}
Here is the call graph for this function:| ilNewsItemGen::read | ( | ) |
Read item from database.
Definition at line 466 of file class.ilNewsItemGen.php.
References getId(), setContent(), setContentIsLangVar(), setContentLong(), setContentType(), setContextObjId(), setContextObjType(), setContextSubObjId(), setContextSubObjType(), setCreationDate(), setMobId(), setPlaytime(), setPriority(), setTitle(), setUpdateDate(), setUserId(), and setVisibility().
Referenced by __construct().
{
global $ilDB;
$query = "SELECT * FROM il_news_item WHERE id = ".
$ilDB->quote($this->getId());
$set = $ilDB->query($query);
$rec = $set->fetchRow(DB_FETCHMODE_ASSOC);
$this->setTitle($rec["title"]);
$this->setContent($rec["content"]);
$this->setContextObjId($rec["context_obj_id"]);
$this->setContextObjType($rec["context_obj_type"]);
$this->setContextSubObjId($rec["context_sub_obj_id"]);
$this->setContextSubObjType($rec["context_sub_obj_type"]);
$this->setContentType($rec["content_type"]);
$this->setCreationDate($rec["creation_date"]);
$this->setUpdateDate($rec["update_date"]);
$this->setUserId($rec["user_id"]);
$this->setVisibility($rec["visibility"]);
$this->setContentLong($rec["content_long"]);
$this->setPriority($rec["priority"]);
$this->setContentIsLangVar($rec["content_is_lang_var"]);
$this->setMobId($rec["mob_id"]);
$this->setPlaytime($rec["playtime"]);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilNewsItemGen::setContent | ( | $ | a_content | ) |
Set Content.
| string | $a_content Content of news. |
Definition at line 119 of file class.ilNewsItemGen.php.
Referenced by read().
{
$this->content = $a_content;
}
Here is the caller graph for this function:| ilNewsItemGen::setContentIsLangVar | ( | $ | a_content_is_lang_var = 0 |
) |
Set ContentIsLangVar.
| boolean | $a_content_is_lang_var |
Definition at line 359 of file class.ilNewsItemGen.php.
Referenced by read().
{
$this->content_is_lang_var = $a_content_is_lang_var;
}
Here is the caller graph for this function:| ilNewsItemGen::setContentLong | ( | $ | a_content_long | ) |
Set ContentLong.
| string | $a_content_long Long content of news |
Definition at line 319 of file class.ilNewsItemGen.php.
Referenced by read().
{
$this->content_long = $a_content_long;
}
Here is the caller graph for this function:| ilNewsItemGen::setContentType | ( | $ | a_content_type = "text" |
) |
Set ContentType.
| string | $a_content_type Content type. |
Definition at line 219 of file class.ilNewsItemGen.php.
Referenced by read().
{
$this->content_type = $a_content_type;
}
Here is the caller graph for this function:| ilNewsItemGen::setContextObjId | ( | $ | a_context_obj_id | ) |
Set ContextObjId.
| int | $a_context_obj_id |
Definition at line 139 of file class.ilNewsItemGen.php.
Referenced by read(), and ilNewsItem::setContext().
{
$this->context_obj_id = $a_context_obj_id;
}
Here is the caller graph for this function:| ilNewsItemGen::setContextObjType | ( | $ | a_context_obj_type | ) |
Set ContextObjType.
| int | $a_context_obj_type |
Definition at line 159 of file class.ilNewsItemGen.php.
Referenced by read(), and ilNewsItem::setContext().
{
$this->context_obj_type = $a_context_obj_type;
}
Here is the caller graph for this function:| ilNewsItemGen::setContextSubObjId | ( | $ | a_context_sub_obj_id | ) |
Set ContextSubObjId.
| int | $a_context_sub_obj_id |
Definition at line 179 of file class.ilNewsItemGen.php.
Referenced by read(), and ilNewsItem::setContext().
{
$this->context_sub_obj_id = $a_context_sub_obj_id;
}
Here is the caller graph for this function:| ilNewsItemGen::setContextSubObjType | ( | $ | a_context_sub_obj_type | ) |
Set ContextSubObjType.
| int | $a_context_sub_obj_type |
Definition at line 199 of file class.ilNewsItemGen.php.
Referenced by read(), and ilNewsItem::setContext().
{
$this->context_sub_obj_type = $a_context_sub_obj_type;
}
Here is the caller graph for this function:| ilNewsItemGen::setCreationDate | ( | $ | a_creation_date | ) |
Set CreationDate.
| string | $a_creation_date Date of creation. |
Definition at line 239 of file class.ilNewsItemGen.php.
Referenced by read().
{
$this->creation_date = $a_creation_date;
}
Here is the caller graph for this function:| ilNewsItemGen::setId | ( | $ | a_id | ) |
Set Id.
| int | $a_id |
Definition at line 79 of file class.ilNewsItemGen.php.
Referenced by __construct(), and create().
{
$this->id = $a_id;
}
Here is the caller graph for this function:| ilNewsItemGen::setMobId | ( | $ | a_mob_id | ) |
Set MobId.
| int | $a_mob_id Media Object ID (if news includes attachement) |
Definition at line 379 of file class.ilNewsItemGen.php.
Referenced by read().
{
$this->mob_id = $a_mob_id;
}
Here is the caller graph for this function:| ilNewsItemGen::setPlaytime | ( | $ | a_playtime | ) |
Set Playtime.
| string | $a_playtime Play Time, hh:mm:ss (of attached media file) |
Definition at line 399 of file class.ilNewsItemGen.php.
Referenced by read().
{
$this->playtime = $a_playtime;
}
Here is the caller graph for this function:| ilNewsItemGen::setPriority | ( | $ | a_priority = 1 |
) |
Set Priority.
| int | $a_priority News Priority |
Definition at line 339 of file class.ilNewsItemGen.php.
Referenced by read().
{
$this->priority = $a_priority;
}
Here is the caller graph for this function:| ilNewsItemGen::setTitle | ( | $ | a_title | ) |
Set Title.
| string | $a_title Title of news item. |
Definition at line 99 of file class.ilNewsItemGen.php.
Referenced by read().
{
$this->title = $a_title;
}
Here is the caller graph for this function:| ilNewsItemGen::setUpdateDate | ( | $ | a_update_date | ) |
Set UpdateDate.
| string | $a_update_date Date of last update. |
Definition at line 259 of file class.ilNewsItemGen.php.
Referenced by read().
{
$this->update_date = $a_update_date;
}
Here is the caller graph for this function:| ilNewsItemGen::setUserId | ( | $ | a_user_id | ) |
Set UserId.
| int | $a_user_id User Id of last update. |
Definition at line 279 of file class.ilNewsItemGen.php.
Referenced by read().
{
$this->user_id = $a_user_id;
}
Here is the caller graph for this function:| ilNewsItemGen::setVisibility | ( | $ | a_visibility = "users" |
) |
Set Visibility.
| string | $a_visibility Access level of news. |
Definition at line 299 of file class.ilNewsItemGen.php.
Referenced by read().
{
$this->visibility = $a_visibility;
}
Here is the caller graph for this function:| ilNewsItemGen::update | ( | ) |
Update item in database.
Definition at line 498 of file class.ilNewsItemGen.php.
References getContent(), getContentIsLangVar(), getContentLong(), getContentType(), getContextObjId(), getContextObjType(), getContextSubObjId(), getContextSubObjType(), getCreationDate(), getId(), getMobId(), getPlaytime(), getPriority(), getTitle(), getUserId(), and getVisibility().
{
global $ilDB;
$query = "UPDATE il_news_item SET ".
" title = ".$ilDB->quote($this->getTitle()).
", content = ".$ilDB->quote($this->getContent()).
", context_obj_id = ".$ilDB->quote($this->getContextObjId()).
", context_obj_type = ".$ilDB->quote($this->getContextObjType()).
", context_sub_obj_id = ".$ilDB->quote($this->getContextSubObjId()).
", context_sub_obj_type = ".$ilDB->quote($this->getContextSubObjType()).
", content_type = ".$ilDB->quote($this->getContentType()).
", creation_date = ".$ilDB->quote($this->getCreationDate()).
", update_date = now()".
", user_id = ".$ilDB->quote($this->getUserId()).
", visibility = ".$ilDB->quote($this->getVisibility()).
", content_long = ".$ilDB->quote($this->getContentLong()).
", priority = ".$ilDB->quote($this->getPriority()).
", content_is_lang_var = ".$ilDB->quote($this->getContentIsLangVar()).
", mob_id = ".$ilDB->quote($this->getMobId()).
", playtime = ".$ilDB->quote($this->getPlaytime()).
" WHERE id = ".$ilDB->quote($this->getId());
$ilDB->query($query);
}
Here is the call graph for this function:ilNewsItemGen::$content [protected] |
Definition at line 43 of file class.ilNewsItemGen.php.
ilNewsItemGen::$content_is_lang_var = 0 [protected] |
Definition at line 55 of file class.ilNewsItemGen.php.
ilNewsItemGen::$content_long [protected] |
Definition at line 53 of file class.ilNewsItemGen.php.
ilNewsItemGen::$content_type = "text" [protected] |
Definition at line 48 of file class.ilNewsItemGen.php.
ilNewsItemGen::$context_obj_id [protected] |
Definition at line 44 of file class.ilNewsItemGen.php.
ilNewsItemGen::$context_obj_type [protected] |
Definition at line 45 of file class.ilNewsItemGen.php.
ilNewsItemGen::$context_sub_obj_id [protected] |
Definition at line 46 of file class.ilNewsItemGen.php.
ilNewsItemGen::$context_sub_obj_type [protected] |
Definition at line 47 of file class.ilNewsItemGen.php.
ilNewsItemGen::$creation_date [protected] |
Definition at line 49 of file class.ilNewsItemGen.php.
ilNewsItemGen::$id [protected] |
Definition at line 41 of file class.ilNewsItemGen.php.
Referenced by ilNewsItem::mergeNews().
ilNewsItemGen::$mob_id [protected] |
Definition at line 56 of file class.ilNewsItemGen.php.
ilNewsItemGen::$playtime [protected] |
Definition at line 57 of file class.ilNewsItemGen.php.
ilNewsItemGen::$priority = 1 [protected] |
Definition at line 54 of file class.ilNewsItemGen.php.
ilNewsItemGen::$title [protected] |
Definition at line 42 of file class.ilNewsItemGen.php.
ilNewsItemGen::$update_date [protected] |
Definition at line 50 of file class.ilNewsItemGen.php.
ilNewsItemGen::$user_id [protected] |
Definition at line 51 of file class.ilNewsItemGen.php.
ilNewsItemGen::$visibility = "users" [protected] |
Definition at line 52 of file class.ilNewsItemGen.php.
Referenced by ilNewsItem::_getDefaultVisibilityForRefId().
1.7.1