You are here

public function ImportBaseUsers::__construct in Import 7

General initialization of a Migration object.

Overrides Migration::__construct

File

./import.base.users.inc, line 10
Contains base user migration class.

Class

ImportBaseUsers
@file Contains base user migration class.

Code

public function __construct($arguments) {
  parent::__construct($arguments);
  $this->map = new MigrateSQLMap($this->machineName, array(
    'name' => array(
      'type' => 'varchar',
      'length' => 255,
      'not null' => TRUE,
    ),
  ), MigrateDestinationUser::getKeySchema());
  $this->destination = new MigrateDestinationUser();
  $import_path = drupal_get_path('module', 'import') . '/import/';
  $this->source = new MigrateSourceCSV($import_path . 'import.base.users.csv', $this
    ->csvcolumns(), array(
    'header_rows' => 1,
  ));
  $this
    ->addFieldMapping('name', 'name')
    ->dedupe('users', 'name');
  $this
    ->addFieldMapping('pass', 'pass');
  $this
    ->addFieldMapping('mail', 'mail')
    ->dedupe('users', 'mail');
  $this
    ->addFieldMapping('status', 'status');
  $this
    ->addFieldMapping('roles', 'roles');
  $this
    ->addFieldMapping('picture', 'picture')
    ->sourceMigration('ImportBaseUserPictures');
  $this
    ->addFieldMapping('field_user_bio', 'bio');
  $this
    ->addFieldMapping('field_user_bio:format')
    ->defaultValue('full_html');
}