public function DrupalRoleMigration::__construct in Drupal-to-Drupal data migration 7.2
Parameters
array $arguments: role_mappings - Array keyed by the legacy role name, with the destination role name as the value.
Overrides DrupalMigration::__construct
3 calls to DrupalRoleMigration::__construct()
3 methods override DrupalRoleMigration::__construct()
File
- ./
role.inc, line 25 - Base class for migrating roles into Drupal.
Class
- DrupalRoleMigration
- Base class for all role migrations - handles commonalities across all supported source Drupal versions.
Code
public function __construct(array $arguments) {
parent::__construct($arguments);
if (!empty($arguments['role_mappings'])) {
$this->roleMappings = $arguments['role_mappings'];
}
$this->source = new MigrateSourceSQL($this
->query(), $this->sourceFields, NULL, $this->sourceOptions);
$this->map = new MigrateSQLMap($this->machineName, array(
'rid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Source role ID',
),
), MigrateDestinationRole::getKeySchema(), $this->mapConnection);
$this->destination = new MigrateDestinationRole();
$this
->addSimpleMappings(array(
'name',
));
}