165 : void {
166 $this->current_value = null;
167
168
169 $new_parent_id = (
int) $this->mapping->getMapping(
"Services/AdvancedMetaData",
"parent", (
string)
$this->obj_id);
170 $this->log->notice('Found new parent id:' . $new_parent_id);
171 if (!$new_parent_id) {
172 return;
173 }
174 $new_sub_id = '';
175 if ($a_sub_type && strcmp($a_sub_type, '-') !== 0) {
176 $new_sub_id = $this->mapping->getMapping(
177 "Services/AdvancedMetaData",
178 "advmd_sub_item",
179 "advmd:" . $a_sub_type . ":" . $a_sub_id
180 );
181 if (!$new_sub_id) {
182 return;
183 }
184 }
185
186
187
188 if (is_array($this->local_record)) {
190 (int) $this->local_record['id'],
191 $this->local_record['xml'],
192 $new_parent_id,
193 $a_sub_type
194 );
195 $this->local_record = null;
196 }
197
199
200
201 if (!$a_local_rec_id) {
203 $rec_id = $field->getRecordId();
204 }
205 }
206 else {
207 $rec_id = $this->local_rec_map[$a_local_rec_id];
208 }
209
211 return;
212 }
213
214
215 if ($a_sub_type) {
216 $rec_idx =
$rec_id .
";" . $a_sub_type .
";" . $new_sub_id;
217 if (!array_key_exists($rec_idx, $this->value_records)) {
220 $new_parent_id,
221 $a_sub_type,
222 $new_sub_id
223 );
224 }
225 } else {
227 if (!array_key_exists($rec_idx, $this->value_records)) {
229 }
230 }
231
232
233 $this->value_records[$rec_idx]->getADTGroup();
234
235
236 $this->log->debug("Find element: " . $a_import_id . ", local rec_id: " . $a_local_rec_id);
237 if (!$a_local_rec_id) {
238 foreach ($this->value_records[$rec_idx]->getDefinitions() as $def) {
239 if ($a_import_id == $def->getImportId()) {
240 $this->current_value = $def;
241 break;
242 }
243 }
244 } else {
245
246 $field_id = $this->local_rec_fields_map[
$rec_id][$a_import_id];
247 if ($field_id) {
248 $this->log->debug("- Field id: " . $field_id);
249 foreach ($this->value_records[$rec_idx]->getDefinitions() as $def) {
250 $this->log->debug("- Def field id: " . $def->getFieldId());
251 if ($field_id == $def->getFieldId()) {
252 $this->current_value = $def;
253 break;
254 }
255 }
256 } else {
257 $this->log->debug("- No Field id. local rec: " . $a_local_rec_id .
258 ", rec id:" .
$rec_id .
", import id: " . $a_import_id .
", map: " . print_r(
259 $this->local_rec_fields_map,
260 true
261 ));
262 }
263 }
264
265
266
267 if ($this->current_value &&
268 !$a_local_rec_id) {
269 $this->record_ids[$new_parent_id][$a_sub_type][] =
$rec_id;
270 }
271 }
static getInstanceByImportId(string $a_import_id)
createLocalRecord(int $a_old_id, string $a_xml, int $a_obj_id, ?string $a_sub_type=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...