ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilContainerReferenceExporter.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
27{
28 public function getXmlExportHeadDependencies(string $a_entity, string $a_target_release, array $a_ids): array
29 {
30 global $DIC;
31
32 $log = $DIC->logger()->root();
33
35
36 $obj_id = end($a_ids);
37
38 $log->debug(__METHOD__ . ': ' . $obj_id);
39 if ($eo->getOption(ilExportOptions::KEY_ROOT) != $obj_id) {
40 return [];
41 }
42 if (count(ilExportOptions::getInstance()->getSubitemsForExport()) > 1) {
43 return [
44 [
45 'component' => 'components/ILIAS/Container',
46 'entity' => 'struct',
47 'ids' => $a_ids
48 ]
49 ];
50 }
51 return [];
52 }
53
55
56 public function getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id): string
57 {
58 global $DIC;
59
60 $log = $DIC->logger()->root();
61
62 $refs = ilObject::_getAllReferences((int) $a_id);
63 $ref_ref_id = end($refs);
64 $ref = ilObjectFactory::getInstanceByRefId($ref_ref_id, false);
65
66 if (!$ref instanceof ilContainerReference) {
67 $log->debug(__METHOD__ . $a_id . ' is not instance of type category!');
68 return '';
69 }
70 $writer = $this->initWriter($ref);
72 $writer->export(false);
73 return $writer->getXml();
74 }
75
79 public function getValidSchemaVersions(string $a_entity): array
80 {
81 return [
82 "4.3.0" => [
83 "namespace" => "https://www.ilias.de/Modules/CategoryReference/catr/4_3",
84 "xsd_file" => "ilias_catr_4_3.xsd",
85 "uses_dataset" => false,
86 "min" => "4.3.0",
87 "max" => ""
88 ]
89 ];
90 }
91
92 public function init(): void
93 {
94 }
95}
getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id)
getXmlExportHeadDependencies(string $a_entity, string $a_target_release, array $a_ids)
Get head dependencies.
initWriter(ilContainerReference $ref)
Class for container reference export.
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
static _getAllReferences(int $id)
get all reference ids for object ID
Xml Exporter class.
$log
Definition: ltiresult.php:34
global $DIC
Definition: shib_login.php:26