ILIAS  release_8 Revision v8.24
class.ilAdvancedMetaDataImporter.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
5
12{
16 public function __construct()
17 {
18 global $DIC;
19
21 }
22
23 public function importXmlRepresentation(
24 string $a_entity,
25 string $a_id,
26 string $a_xml,
27 ilImportMapping $a_mapping
28 ): void {
29 $parser = new ilAdvancedMDParser($a_id, $a_mapping);
30 $parser->setXMLContent($a_xml);
31 $parser->startParsing();
32
33 // records with imported values should be selected
34 foreach ($parser->getRecordIds() as $obj_id => $sub_types) {
36
37 foreach ((array) $sub_types as $sub_type => $rec_ids) {
38 ilAdvancedMDRecord::saveObjRecSelection($obj_id, $sub_type, array_unique($rec_ids), false);
39 }
40 }
41 }
42}
static saveObjRecSelection(int $a_obj_id, string $a_sub_type="", array $a_records=null, bool $a_delete_before=true)
Save repository object record selection.
importXmlRepresentation(string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setXMLContent(string $a_xml_content)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc