ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilAdvancedMetaDataImporter.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
26{
30 public function __construct()
31 {
32 global $DIC;
33
35 }
36
37 public function importXmlRepresentation(
38 string $a_entity,
39 string $a_id,
40 string $a_xml,
41 ilImportMapping $a_mapping
42 ): void {
43 $parser = new ilAdvancedMDParser($a_id, $a_mapping);
44 $parser->setXMLContent($a_xml);
45 $parser->startParsing();
46
47 // records with imported values should be selected
48 foreach ($parser->getRecordIds() as $obj_id => $sub_types) {
50
51 foreach ((array) $sub_types as $sub_type => $rec_ids) {
52 ilAdvancedMDRecord::saveObjRecSelection($obj_id, $sub_type, array_unique($rec_ids), false);
53 }
54 }
55 }
56}
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)
setXMLContent(string $a_xml_content)
Xml importer class.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26