ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 }
getSchemaVersion()
Get schema version.
getImportDirectory()
Get import directory.
Importer class for forums.
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 ilObjForum.
Xml importer class.