ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilNewsExporter.php
Go to the documentation of this file.
1<?php
2
25{
27
28 public function init(): void
29 {
30 $this->ds = new ilNewsDataSet();
31 $this->ds->initByExporter($this);
32 $this->ds->setDSPrefix("ds");
33 }
34
38 public function getXmlExportHeadDependencies(string $a_entity, string $a_target_release, array $a_ids): array
39 {
40 $mob_ids = [];
41
42 foreach ($a_ids as $id) {
43 $mob_id = ilNewsItem::_lookupMobId((int) $id);
44 if ($mob_id > 0) {
45 $mob_ids[$mob_id] = $mob_id;
46 }
47 }
48
49 return [
50 [
51 "component" => "components/ILIAS/MediaObjects",
52 "entity" => "mob",
53 "ids" => $mob_ids
54 ]
55 ];
56 }
57
58 public function getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id): string
59 {
60 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true);
61 }
62
63 public function getValidSchemaVersions(string $a_entity): array
64 {
65 return [
66 "5.4.0" => [
67 "namespace" => "https://www.ilias.de/Services/News/news/5_4",
68 "xsd_file" => "ilias_news_5_4.xsd",
69 "uses_dataset" => true,
70 "min" => "5.4.0",
71 "max" => ""
72 ],
73 "4.1.0" => [
74 "namespace" => "https://www.ilias.de/Services/News/news/4_1",
75 "xsd_file" => "ilias_news_4_1.xsd",
76 "uses_dataset" => true,
77 "min" => "4.1.0",
78 "max" => ""
79 ]
80 ];
81 }
82}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id)
getXmlExportHeadDependencies(string $a_entity, string $a_target_release, array $a_ids)
getValidSchemaVersions(string $a_entity)
Returns schema versions that the component can export to.
static _lookupMobId(int $a_news_id)
Lookup mob id.
Xml Exporter class.