ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilChatroomImporter.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25{
26 public function importXmlRepresentation(string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping): void
27 {
28 if ($new_id = $a_mapping->getMapping('components/ILIAS/Container', 'objs', $a_id)) {
29 $newObj = ilObjectFactory::getInstanceByObjId((int) $new_id, false);
30 } else {
31 $newObj = new ilObjChatroom();
32 $newObj->setTitle('');
33 $newObj->setDescription('');
34 $newObj->setType('chtr');
35 $newObj->create();
36 }
37
38 $parser = new ilChatroomXMLParser($newObj, $a_xml);
39 $parser->setImportInstallId($this->getInstallId());
40 $parser->startParsing();
41
42 $a_mapping->addMapping('components/ILIAS/Chatroom', 'chtr', $a_id, (string) $newObj->getId());
43 }
44}
Class ilChatroomImporter.
importXmlRepresentation(string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
getMapping(string $a_comp, string $a_entity, string $a_old_id)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
Xml importer class.