public function MigrateExampleProfile2Migration::__construct in Migrate Extras 7.2
General initialization of a Migration object.
Overrides Migration::__construct
File
- migrate_extras_examples/
migrate_extras_profile2/ migrate_extras_profile2.migrate.inc, line 11 - Examples and test fodder for migration into profile2 entities.
Class
- MigrateExampleProfile2Migration
- Migration class to test import of various date fields.
Code
public function __construct() {
parent::__construct();
$this->description = t('Example migration into profile2 entities');
$this->map = new MigrateSQLMap($this->machineName, array(
'id' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
), MigrateDestinationProfile2::getKeySchema());
// Our test data is in a CSV file
$this->source = new MigrateSourceCSV(__DIR__ . '/migrate_extras_profile2.csv', $this
->csvcolumns(), array(), $this
->fields());
$this->destination = new MigrateDestinationProfile2('migrate_extras_profile2');
$this
->addFieldMapping('uid')
->defaultValue(1);
// Unmapped destination fields
$this
->addUnmigratedDestinations(array(
'id',
));
}