continue;
}
$relatedContactFieldName = $relatedContactKey ? $mappedField['name'] : NULL;
- // RelatedContactType is not part of the mapping but rather calculated from the relationship.
- $relatedContactType = $this->getRelatedContactType($mappedField['relationship_type_id'], $mappedField['relationship_direction']);
$relatedContactLocationTypeID = $relatedContactKey ? $mappedField['location_type_id'] : NULL;
$relatedContactWebsiteTypeID = $relatedContactKey ? $mappedField['website_type_id'] : NULL;
}
else {
if (!isset($params[$relatedContactKey])) {
- $params[$relatedContactKey] = [];
- }
-
- if (!isset($params[$relatedContactKey]['contact_type']) && !empty($relatedContactType)) {
- $params[$relatedContactKey]['contact_type'] = $relatedContactType;
+ $params[$relatedContactKey] = ['contact_type' => $this->getRelatedContactType($mappedField['relationship_type_id'], $mappedField['relationship_direction'])];
}
if (isset($relatedContactLocationTypeID) && !empty($importedValue)) {