protected function initValue($a_import_id, $a_sub_type = "", $a_sub_id = 0) { $this->current_value = null; if ($field = ilAdvancedMDFieldDefinition::getInstanceByImportId($a_import_id)) { $rec_id = $field->getRecordId(); $new_parent_id = $this->mapping->getMapping("Services/AdvancedMetaData", "parent", $this->obj_id); if (!$new_parent_id) { return; } if ($a_sub_type) { $new_sub_id = $this->mapping->getMapping("Services/AdvancedMetaData", "advmd_sub_item", "advmd:" . $a_sub_type . ":" . $a_sub_id); if (!$new_sub_id) { return; } $rec_idx = $rec_id . ";" . $a_sub_type . ";" . $new_sub_id; if (!array_key_exists($rec_idx, $this->value_records)) { $this->value_records[$rec_idx] = new ilAdvancedMDValues($rec_id, $new_parent_id, $a_sub_type, $new_sub_id); } } else { $rec_idx = $rec_id . ";;"; if (!array_key_exists($rec_idx, $this->value_records)) { $this->value_records[$rec_idx] = new ilAdvancedMDValues($rec_id, $new_parent_id); } } // init ADTGroup before definitions to bind definitions to group $this->value_records[$rec_idx]->getADTGroup(); foreach ($this->value_records[$rec_idx]->getDefinitions() as $def) { if ($a_import_id == $def->getImportId()) { $this->current_value = $def; break; } } // valid field found, record will be imported if ($this->current_value) { $this->record_ids[$new_parent_id][$a_sub_type][] = $rec_id; } } }