$vs_preferred_term = $va_subject['preferred_term']; switch ($va_subject['record_type']) { default: $vn_type_id = null; $pb_is_enabled = true; break; } print str_repeat(chr(8), $vn_last_message_length); $vs_message = "[Notice] IMPORTING #" . ($vn_term_count + 1) . " [" . $va_subject['subject_id'] . "] " . $vs_preferred_term; if (($vn_l = 100 - strlen($vs_message)) < 1) { $vn_l = 1; } $vs_message .= str_repeat(' ', $vn_l); $vn_last_message_length = strlen($vs_message); print $vs_message; $t_place->clear(); $t_place->set('parent_id', null); $t_place->set('type_id', $vn_type_id); $t_place->set('idno', $va_subject['subject_id']); $t_place->set('hierarchy_id', $vn_tgn_id); // Add description if ($vs_description_element_code && $va_subject['description']) { $t_place->addAttribute(array($vs_description_element_code => $va_subject['description'], 'locale_id' => $pn_en_locale_id), $vs_description_element_code); } // Add georeference if ($vs_georef_element_code && ($va_coords['latitude']['decimal'] && $va_coords['longitude']['decimal'])) { $t_place->addAttribute(array($vs_georef_element_code => "[" . $va_coords['latitude']['decimal'] . $va_coords['latitude']['direction'] . "," . $va_coords['longitude']['decimal'] . $va_coords['longitude']['direction'] . "]", 'locale_id' => $pn_en_locale_id), $vs_georef_element_code); DataMigrationUtils::postError($t_place, "[Error] While adding georeference to place"); } if ($vn_place_id = $t_place->insert(array('dontSetHierarchicalIndexing' => true))) { if (!$t_place->addLabel(array('name' => $vs_preferred_term, 'description' => ''), $pn_en_locale_id, null, true)) {