ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
4 require_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 }
Class ilObjChatroom.
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import XML.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
$parser
Definition: BPMN2Parser.php:23
getInstallId()
Get installation id.
Class ilChatroomXMLParser.
Xml importer class.
Class ilChatroomImporter.