ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
class.ilCmiXapiExporter.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
31{
32 public const ENTITY = 'cmix';
33 public const SCHEMA_VERSION = '5.1.0';
34
35 // private $main_object = null;
36 private ?ilCmiXapiDataSet $_dataset = null;
37
38 public function __construct()
39 {
41 $this->_dataset = new ilCmiXapiDataSet();
42 //todo check
43 $this->_dataset->initByExporter($this);
44 $this->_dataset->setDSPrefix("ds");
45 }
46
47 public function init(): void
48 {
49 }
50
54 public function getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id): string
55 {
56 return $this->_dataset->getCmiXapiXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true);
57 }
58
60 string $a_entity,
61 string $a_target_release,
62 array $a_ids
63 ): array {
64 $dependencies = [];
65
66 $md_ids = [];
67 foreach ($a_ids as $id) {
68 $md_ids[] = $id . ":0:cmix";
69 }
70 if ($md_ids !== []) {
71 $dependencies[] = [
72 "component" => "components/ILIAS/MetaData",
73 "entity" => "md",
74 "ids" => $md_ids
75 ];
76 }
77
78 return $dependencies;
79 }
80
84 public function getValidSchemaVersions(string $a_entity): array
85 {
86 return array(
87 "5.1.0" => array(
88 "namespace" => "http://www.ilias.de/Modules/CmiXapi/cmix/5_1",
89 "xsd_file" => "xml/ilias_cmix_5_1.xsd",
90 "uses_dataset" => true,
91 "min" => "5.1.0",
92 "max" => "")
93 );
94 }
95}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids)
Get tail dependencies.
ilCmiXapiDataSet $_dataset
getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id)
Get xml representation.
getValidSchemaVersions(string $a_entity)
Xml Exporter class.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc