4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
23 return array(
"4.1.0");
34 return "http://www.ilias.de/xml/Services/News/" . $a_entity;
43 protected function getTypes($a_entity, $a_version)
45 if ($a_entity ==
"news") {
52 "Priority" =>
"integer",
53 "ContextObjId" =>
"integer",
54 "ContextObjType" =>
"text",
55 "ContextSubObjId" =>
"integer",
56 "ContextSubObjType" =>
"text",
57 "ContentType" =>
"text",
58 "Visibility" =>
"text",
59 "ContentLong" =>
"text",
60 "ContentIsLangVar" =>
"integer",
74 public function readData($a_entity, $a_version, $a_ids, $a_field =
"")
78 if (!is_array($a_ids)) {
79 $a_ids =
array($a_ids);
82 if ($a_entity ==
"news") {
86 " context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, " .
87 " content_type, visibility, content_long, content_is_lang_var, mob_id, playtime" .
88 " FROM il_news_item " .
90 $ilDB->in(
"id", $a_ids,
false,
"integer"));
111 public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
119 if ($a_rec[
"MobId"] > 0) {
120 $mob_id = $a_mapping->getMapping(
"Services/MediaObjects",
"mob", $a_rec[
"MobId"]);
122 $c = (int) $a_rec[
"ContextObjId"] .
":" . $a_rec[
"ContextObjType"] .
":" . (
int) $a_rec[
"ContextSubObjId"] .
123 ":" . $a_rec[
"ContextSubObjType"];
124 $context = $a_mapping->getMapping(
"Services/News",
"news_context", $c);
125 $context = explode(
":", $context);
128 include_once(
"./Services/News/classes/class.ilNewsItem.php");
130 $newObj->setTitle($a_rec[
"Title"]);
131 $newObj->setContent($a_rec[
"Content"]);
132 $newObj->setPriority($a_rec[
"Priority"]);
133 $newObj->setContextObjId($context[0]);
134 $newObj->setContextObjType($context[1]);
135 $newObj->setContextSubObjId($context[2]);
136 $newObj->setContextSubObjType($context[3]);
137 $newObj->setContentType($a_rec[
"ContentType"]);
138 $newObj->setVisibility($a_rec[
"Visibility"]);
139 $newObj->setContentLong($a_rec[
"ContentLong"]);
140 $newObj->setContentIsLangVar($a_rec[
"ContentIsLangVar"]);
141 $newObj->setMobId($mob_id);
142 $newObj->setPlaytime($a_rec[
"Playtime"]);
144 $a_mapping->addMapping(
"Services/News",
"news", $a_rec[
"Id"], $newObj->getId());
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true, $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
getSupportedVersions()
Get supported versions.
getTypes($a_entity, $a_version)
Get field types for entity.
Create styles array
The data for the language used.
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
A dataset contains in data in a common structure that can be shared and transformed for different pur...
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.