You are here

public function MerciItemDisplayMigration::__construct in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3

General initialization of a Migration object.

Overrides Migration::__construct

File

merci_migrate/merci_item_display.inc, line 4

Class

MerciItemDisplayMigration

Code

public function __construct($arguments) {
  parent::__construct($arguments);
  $this->source = new MerciContentTypesMigrateSource();
  $this->dependencies = array(
    'MerciItem',
    'MerciTaxonomy',
    'MerciItemRestrictions',
  );
  $this->destination = new MigrateDestinationNode('merci_resource_display');
  $this->map = new MigrateSQLMap($this->machineName, array(
    'type' => array(
      'type' => 'varchar',
      'length' => 32,
      'not null' => TRUE,
      'alias' => 'mt',
    ),
  ), MigrateDestinationNode::getKeySchema());
  $this
    ->addFieldMapping('title', 'type_name');
  $this
    ->addFieldMapping('body', 'description');
  $this
    ->addFieldMapping('field_resource_type', 'merci_item_grouping');

  //$this->addFieldMapping('field_crp_product_reference', 'skus')->sourceMigration('MerciItem');
  $this
    ->addFieldMapping('field_crp_product_reference', 'skus');
  $this
    ->addFieldMapping('uid')
    ->defaultValue(1);
  $this
    ->addFieldMapping('field_replacement_cost')
    ->defaultValue(0);
  $this
    ->addFieldMapping('field_late_fine', 'merci_late_fee_per_hour')
    ->defaultValue(0);
  $this
    ->addFieldMapping('field_restrictions', 'type')
    ->sourceMigration('MerciItemRestrictions');
}