4include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
 
   23        return array(
"5.4.0", 
"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") {
 
   53                        "Priority" => 
"integer",
 
   54                        "ContextObjId" => 
"integer",
 
   55                        "ContextObjType" => 
"text",
 
   56                        "ContextSubObjId" => 
"integer",
 
   57                        "ContextSubObjType" => 
"text",
 
   58                        "ContentType" => 
"text",
 
   59                        "Visibility" => 
"text",
 
   60                        "ContentLong" => 
"text",
 
   61                        "ContentIsLangVar" => 
"integer",
 
   67        if ($a_entity == 
"news_settings") {
 
   72                        "PublicFeed" => 
"integer",
 
   73                        "DefaultVisibility" => 
"text",
 
   74                        "KeepRssMin" => 
"integer",
 
   75                        "HideNewsPerDate" => 
"integer",
 
   76                        "HideNewsDate" => 
"text",
 
   77                        "PublicNotifications" => 
"integer" 
   89    public function readData($a_entity, $a_version, $a_ids, $a_field = 
"")
 
   93        if (!is_array($a_ids)) {
 
   94            $a_ids = array($a_ids);
 
   97        if ($a_entity == 
"news") {
 
  102                        " context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, " .
 
  103                        " content_type, visibility, content_long, content_is_lang_var, mob_id, playtime" .
 
  104                        " FROM il_news_item " .
 
  106                        $ilDB->in(
"id", $a_ids, 
false, 
"integer"));
 
  111        if ($a_entity == 
"news_settings") {
 
  112            switch ($a_version) {
 
  114                    foreach ($a_ids as $obj_id) {
 
  115                        $this->
data[$obj_id][
"ObjId"] = $obj_id;
 
  144    public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
 
  152                if ($a_rec[
"MobId"] > 0) {
 
  153                    $mob_id = $a_mapping->getMapping(
"Services/MediaObjects", 
"mob", $a_rec[
"MobId"]);
 
  155                $c = (int) $a_rec[
"ContextObjId"] . 
":" . $a_rec[
"ContextObjType"] . 
":" . (
int) $a_rec[
"ContextSubObjId"] .
 
  156                    ":" . $a_rec[
"ContextSubObjType"];
 
  157                $context = $a_mapping->getMapping(
"Services/News", 
"news_context", 
$c);
 
  161                include_once(
"./Services/News/classes/class.ilNewsItem.php");
 
  163                $newObj->setTitle($a_rec[
"Title"]);
 
  164                $newObj->setContent($a_rec[
"Content"]);
 
  165                $newObj->setPriority($a_rec[
"Priority"]);
 
  166                $newObj->setContextObjId(
$context[0]);
 
  167                $newObj->setContextObjType(
$context[1]);
 
  168                $newObj->setContextSubObjId(
$context[2]);
 
  169                $newObj->setContextSubObjType(
$context[3]);
 
  170                $newObj->setContentType($a_rec[
"ContentType"]);
 
  171                $newObj->setVisibility($a_rec[
"Visibility"]);
 
  172                $newObj->setContentLong($a_rec[
"ContentLong"]);
 
  173                $newObj->setContentIsLangVar($a_rec[
"ContentIsLangVar"]);
 
  174                $newObj->setMobId($mob_id);
 
  175                $newObj->setPlaytime($a_rec[
"Playtime"]);
 
  177                $a_mapping->addMapping(
"Services/News", 
"news", $a_rec[
"Id"], $newObj->getId());
 
  180            case "news_settings":
 
  183                $new_obj_id = $dummy_dataset->getNewObjId($a_mapping,  $a_rec[
"ObjId"]);
 
  185                if ($new_obj_id > 0 && $a_schema_version == 
"5.4.0") {
 
  187                        "public_feed" => 
"PublicFeed",
 
  188                        "keep_rss_min" => 
"KeepRssMin",
 
  189                        "default_visibility" => 
"DefaultVisibility",
 
  190                        "hide_news_per_date" => 
"HideNewsPerDate",
 
  191                        "hide_news_date" => 
"HideNewsDate",
 
  192                        "public_notifications" => 
"PublicNotifications" 
  193                         ] as $set => $field) {
 
An exception for terminatinating execution or to throw for unit testing.
static _write($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
Write setting to database.
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
A dataset contains in data in a common structure that can be shared and transformed for different pur...
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 ...
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.
getTypes($a_entity, $a_version)
Get field types for entity.
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
getSupportedVersions()
Get supported versions.