You are here

public function FeedsUserProcessor::getMappingTargets in Feeds 8.2

Return available mapping targets.

Overrides FeedsProcessor::getMappingTargets

File

lib/Drupal/feeds/Plugin/feeds/processor/FeedsUserProcessor.php, line 177
FeedsUserProcessor class.

Class

FeedsUserProcessor
Defines a user processor.

Namespace

Drupal\feeds\Plugin\feeds\processor

Code

public function getMappingTargets() {
  $targets = parent::getMappingTargets();
  $targets += array(
    'name' => array(
      'name' => t('User name'),
      'description' => t('Name of the user.'),
      'optional_unique' => TRUE,
    ),
    'mail' => array(
      'name' => t('Email address'),
      'description' => t('Email address of the user.'),
      'optional_unique' => TRUE,
    ),
    'created' => array(
      'name' => t('Created date'),
      'description' => t('The created (e. g. joined) data of the user.'),
    ),
    'pass' => array(
      'name' => t('Unencrypted Password'),
      'description' => t('The unencrypted user password.'),
    ),
    'status' => array(
      'name' => t('Account status'),
      'description' => t('Whether a user is active or not. 1 stands for active, 0 for blocked.'),
    ),
    'language' => array(
      'name' => t('User language'),
      'description' => t('Default language for the user.'),
    ),
  );
  if (module_exists('openid')) {
    $targets['openid'] = array(
      'name' => t('OpenID identifier'),
      'description' => t('The OpenID identifier of the user. <strong>CAUTION:</strong> Use only for migration purposes, misconfiguration of the OpenID identifier can lead to severe security breaches like users gaining access to accounts other than their own.'),
      'optional_unique' => TRUE,
    );
  }

  // Let other modules expose mapping targets.
  self::loadMappers();
  $entity_type = $this
    ->entityType();
  $bundle = $this
    ->bundle();
  drupal_alter('feeds_processor_targets', $targets, $entity_type, $bundle);
  return $targets;
}