You are here

public function CommerceExampleProductDisplayMigration::__construct in Commerce Migrate 7

General initialization of a Migration object.

Overrides CommerceMigrateExampleMigration::__construct

File

commerce_migrate_example/migrations/product_display.inc, line 18
Import nodes of "product_display" content type.

Class

CommerceExampleProductDisplayMigration
Class CommerceExampleProductDisplayMigration.

Code

public function __construct($arguments = array()) {
  parent::__construct($arguments);
  $this
    ->buildMap(MigrateDestinationNode::getKeySchema());
  $this
    ->setDescription(t('Import product display nodes from CSV file (with no header).'));
  $this
    ->setDestination(new MigrateDestinationNode('product_display'));

  // For a multivalued import, see the field_migrate_example_country mapping
  // in the Migrate Example in beer.inc.
  // Here we do a single SKU per product node.
  $this
    ->addSimpleMappings(array(
    'title',
  ));
  $this
    ->addFieldMapping('body', 'description');
  $this
    ->addFieldMapping('field_product', 'sku')
    ->sourceMigration('CommerceExampleProduct');
}