ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilChatroomImporter.php
Go to the documentation of this file.
1 <?php
2 
19 declare(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 }
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.
Class ilChatroomImporter.