ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilChatroomImporter.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/Export/classes/class.ilXmlImporter.php';
5
10{
17 public function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
18 {
19 require_once 'Modules/Chatroom/classes/class.ilObjChatroom.php';
20
21 if ($new_id = $a_mapping->getMapping('Services/Container', 'objs', $a_id)) {
22 $newObj = ilObjectFactory::getInstanceByObjId($new_id, false);
23 } else {
24 $newObj = new ilObjChatroom();
25 $newObj->setType('chtr');
26 $newObj->create();
27 }
28
29 require_once 'Modules/Chatroom/classes/class.ilChatroomXMLParser.php';
30 $parser = new ilChatroomXMLParser($newObj, $a_xml);
31 $parser->setImportInstallId($this->getInstallId());
32 $parser->startParsing();
33
34 $a_mapping->addMapping('Modules/Chatroom', 'chtr', $a_id, $newObj->getId());
35 }
36}
$parser
Definition: BPMN2Parser.php:23
An exception for terminatinating execution or to throw for unit testing.
Class ilChatroomImporter.
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import XML.
Class ilChatroomXMLParser.
Class ilObjChatroom.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Xml importer class.
getInstallId()
Get installation id.