You are here

public function EntityUser::import in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/src/Plugin/migrate/destination/EntityUser.php \Drupal\user\Plugin\migrate\destination\EntityUser::import()

Throws

\Drupal\migrate\MigrateException

Overrides EntityContentBase::import

File

core/modules/user/src/Plugin/migrate/destination/EntityUser.php, line 90
Contains \Drupal\user\Plugin\migrate\destination\EntityUser.

Class

EntityUser
Plugin annotation @MigrateDestination( id = "entity:user" )

Namespace

Drupal\user\Plugin\migrate\destination

Code

public function import(Row $row, array $old_destination_id_values = array()) {
  if ($this->password) {
    if ($this->password instanceof MigratePassword) {
      $this->password
        ->enableMd5Prefixing();
    }
    else {
      throw new MigrateException('Password service has been altered by another module, aborting.');
    }
  }

  // Do not overwrite the root account password.
  if ($row
    ->getDestinationProperty('uid') == 1) {
    $row
      ->removeDestinationProperty('pass');
  }
  $ids = parent::import($row, $old_destination_id_values);
  if ($this->password) {
    $this->password
      ->disableMd5Prefixing();
  }
  return $ids;
}