Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. UserEntityTranslation.php

function UserEntityTranslation::prepareRow

Overrides SourcePluginBase::prepareRow

File

core/modules/user/src/Plugin/migrate/source/d7/UserEntityTranslation.php, line 38

Class

UserEntityTranslation
Drupal 7 user entity translations source from database.

Namespace

Drupal\user\Plugin\migrate\source\d7

Code

public function prepareRow(Row $row) {
    $uid = $row->getSourceProperty('entity_id');
    $language = $row->getSourceProperty('language');
    // Get Field API field values.
    foreach ($this->getFields('user') as $field_name => $field) {
        // Ensure we're using the right language if the entity is translatable.
        $field_language = $field['translatable'] ? $language : NULL;
        $row->setSourceProperty($field_name, $this->getFieldValues('user', $field_name, $uid, NULL, $field_language));
    }
    return parent::prepareRow($row);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal