$save = FALSE;
} if ($save) { try { $this->
getEventDispatcher() ->
dispatch(new MigratePreRowSaveEvent($this->migration,
$this->message,
$row), MigrateEvents::PRE_ROW_SAVE
);
$destination_ids =
$id_map->
lookupDestinationIds($this->sourceIdValues
);
$destination_id_values =
$destination_ids ?
reset($destination_ids) :
[];
$destination_id_values =
$destination->
import($row,
$destination_id_values);
$this->
getEventDispatcher() ->
dispatch(new MigratePostRowSaveEvent($this->migration,
$this->message,
$row,
$destination_id_values), MigrateEvents::POST_ROW_SAVE
);
if ($destination_id_values) { // We do not save an idMap entry for config.
if ($destination_id_values !== TRUE
) { $id_map->
saveIdMapping($row,
$destination_id_values,
$this->sourceRowStatus,
$destination->
rollbackAction());
} } else { $id_map->
saveIdMapping($row,
[], MigrateIdMapInterface::STATUS_FAILED
);
if (!
$id_map->
messageCount()) { $message =
$this->
t('New object was not saved, no error provided'
);
$this->
saveMessage($message);