3declare(strict_types=1);
46 $this->
logger = $DIC->logger()->exp();
51 $this->import_mapping = $mapping;
61 xml_set_object($a_xml_parser, $this);
62 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
63 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
79 case "ContainerReference":
83 switch ($a_attribs[
'type']) {
98 $this->
logger->info(
'No mapping found for: ' . $a_attribs[
'id']);
107 if ($attribute_target ===
'') {
108 $this->
logger->debug(
'No target id provided');
114 $obj_mapping_id = $this->import_mapping->getMapping(
'Services/Container',
'objs', $attribute_target);
115 if (!$obj_mapping_id) {
116 $this->
logger->debug(
'Cannot find object mapping for target_id: ' . $attribute_target);
120 return (
int) $obj_mapping_id;
132 $this->cdata = $this->trimAndStrip($this->cdata);
134 case "ContainerReference":
140 $this->getReference()->setTitle(trim($this->cdata));
156 if (!empty($a_data)) {
157 $this->cdata .= $a_data;
165 protected function save(): void
169 $this->getReference()->create();
170 $this->getReference()->createReference();
171 $this->getReference()->putInTree($this->getParentId());
172 $this->getReference()->setPermissions($this->getParentId());
174 $this->getReference()->update();
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
trimAndStripAttribs(array $attribs)
setImportMapping(ilImportMapping $mapping)
handlerEndTag( $a_xml_parser, string $a_name)
handlerCharacterData( $a_xml_parser, string $a_data)
handlerBeginTag( $a_xml_parser, string $a_name, array $a_attribs)
ilImportMapping $import_mapping
__construct(string $a_xml, int $a_parent_id=0)
parseTargetId(string $attribute_target)
setHandlers($a_xml_parser)
setReference(ilContainerReference $ref)
ilContainerReference $ref
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Component logger with individual log levels by component id.
setXMLContent(string $a_xml_content)
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc