ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilChatroomExporter.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25{
26 public function init(): void
27 {
28 }
29
30 public function getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id): string
31 {
32 $chat = ilObjectFactory::getInstanceByObjId((int) $a_id, false);
33 if (!($chat instanceof ilObjChatroom)) {
34 $GLOBALS['DIC']->logger()->root()->warning(
35 $a_id . ' is not id of chatroom instance. Skipped generation of export XML.'
36 );
37 return '';
38 }
39
40 $writer = new ilChatroomXMLWriter($chat);
41 $writer->start();
42
43 return $writer->getXML();
44 }
45
46 public function getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids): array
47 {
48 $deps = [];
49
50 if ('chtr' === $a_entity) {
51 $deps[] = [
52 'component' => 'components/ILIAS/ILIASObject',
53 'entity' => 'common',
54 'ids' => $a_ids
55 ];
56 }
57
58 return $deps;
59 }
60
61 public function getValidSchemaVersions(string $a_entity): array
62 {
63 return [
64 '5.3.0' => [
65 'namespace' => 'https://www.ilias.de/Modules/Chatroom/chtr/5_3',
66 'xsd_file' => 'ilias_chtr_5_3.xsd',
67 'uses_dataset' => false,
68 'min' => '5.3.0',
69 'max' => '8.999'
70 ],
71 '9.0' => [
72 'namespace' => 'https://www.ilias.de/Modules/Chatroom/chtr/9',
73 'xsd_file' => 'ilias_chtr_9.xsd',
74 'uses_dataset' => false,
75 'min' => '9.0',
76 'max' => ''
77 ]
78 ];
79 }
80}
Class ilChatroomExporter.
getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids)
Get tail dependencies.
getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id)
getValidSchemaVersions(string $a_entity)
Returns schema versions that the component can export to.
Class ilChatroomXMLWriter.
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
Xml Exporter class.
$GLOBALS["DIC"]
Definition: wac.php:54