ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilForumImporter.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
12{
19 public function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
20 {
21 // case i container
22 if ($new_id = $a_mapping->getMapping('Services/Container', 'objs', $a_id)) {
23 $newObj = ilObjectFactory::getInstanceByObjId($new_id, false);
24 } else { // case ii, non container
25 $newObj = new ilObjForum();
26 $newObj->setType('frm');
27 $newObj->create();
28 }
29
30 $parser = new ilForumXMLParser($newObj, $a_xml);
31 $parser->setImportDirectory($this->getImportDirectory());
32 $parser->setImportInstallId($this->getInstallId());
33 $parser->setSchemaVersion($this->getSchemaVersion());
34 $parser->startParsing();
35
36 $a_mapping->addMapping("Modules/Forum", "frm", $a_id, $newObj->getId());
37 }
38}
An exception for terminatinating execution or to throw for unit testing.
Importer class for forums.
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import XML.
Class ilObjForum.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Xml importer class.
getSchemaVersion()
Get schema version.
getInstallId()
Get installation id.
getImportDirectory()
Get import directory.