You are here

protected function User::baseFields in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/user/src/Plugin/migrate/source/d6/User.php \Drupal\user\Plugin\migrate\source\d6\User::baseFields()

Returns the user base fields to be migrated.

Return value

array Associative array having field name as key and description as value.

1 call to User::baseFields()
User::fields in core/modules/user/src/Plugin/migrate/source/d6/User.php
Returns available fields on the source.

File

core/modules/user/src/Plugin/migrate/source/d6/User.php, line 90

Class

User
Drupal 6 user source from database.

Namespace

Drupal\user\Plugin\migrate\source\d6

Code

protected function baseFields() {
  $fields = [
    'uid' => $this
      ->t('User ID'),
    'name' => $this
      ->t('Username'),
    'pass' => $this
      ->t('Password'),
    'mail' => $this
      ->t('Email address'),
    'theme' => $this
      ->t('Theme'),
    'signature' => $this
      ->t('Signature'),
    'signature_format' => $this
      ->t('Signature format'),
    'created' => $this
      ->t('Registered timestamp'),
    'access' => $this
      ->t('Last access timestamp'),
    'login' => $this
      ->t('Last login timestamp'),
    'status' => $this
      ->t('Status'),
    'timezone' => $this
      ->t('Timezone'),
    'language' => $this
      ->t('Language'),
    'picture' => $this
      ->t('Picture'),
    'init' => $this
      ->t('Init'),
    'data' => $this
      ->t('User data'),
  ];

  // Possible field added by Date contributed module.
  // @see https://api.drupal.org/api/drupal/modules%21user%21user.install/function/user_update_7002/7
  if ($this
    ->getDatabase()
    ->schema()
    ->fieldExists('users', 'timezone_name')) {
    $fields['timezone_name'] = $this
      ->t('Timezone (Date)');
  }

  // Possible field added by Event contributed module.
  // @see https://api.drupal.org/api/drupal/modules%21user%21user.install/function/user_update_7002/7
  if ($this
    ->getDatabase()
    ->schema()
    ->fieldExists('users', 'timezone_id')) {
    $fields['timezone_id'] = $this
      ->t('Timezone (Event)');
  }
  return $fields;
}