// If this entity was translated using Entity Translation, we need to get
// its source language to get the field values in the right language.
// The translations will be migrated by the d7_user_entity_translation
// migration.
$entity_translatable =
$this->
isEntityTranslatable('user'
);
$source_language =
$this->
getEntityTranslationSourceLanguage('user',
$uid);
$language =
$entity_translatable &&
$source_language ?
$source_language :
$row->
getSourceProperty('language'
);
$row->
setSourceProperty('entity_language',
$language);
// Get Field API field values.
foreach ($this->
getFields('user'
) as $field_name =>
$field) { // Ensure we're using the right language if the entity and the field are
// translatable.
$field_language =
$entity_translatable &&
$field['translatable'
] ?
$language : NULL;
$row->
setSourceProperty($field_name,
$this->
getFieldValues('user',
$field_name,
$uid, NULL,
$field_language));
} // Get profile field values. This code is lifted directly from the D6
// ProfileFieldValues plugin.
if ($this->
getDatabase()->
schema()->
tableExists('profile_value'
)) { $query =
$this->
select('profile_value', 'pv'
) ->
fields('pv',
['fid', 'value'
]);