protected function updateEntity(EntityInterface
$entity, Row
$row) { $empty_destinations =
$row->
getEmptyDestinationProperties();
// By default, an update will be preserved.
$rollback_action = MigrateIdMapInterface::ROLLBACK_PRESERVE;
// Make sure we have the right translation.
if ($this->
isTranslationDestination()) { $property =
$this->storage->
getEntityType()->
getKey('langcode'
);
if ($row->
hasDestinationProperty($property)) { $language =
$row->
getDestinationProperty($property);
if (!
$entity->
hasTranslation($language)) { $entity->
addTranslation($language);
// We're adding a translation, so delete it on rollback.
$rollback_action = MigrateIdMapInterface::ROLLBACK_DELETE;
} $entity =
$entity->
getTranslation($language);
} }