You are here

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

General initialization of a Migration object.

Overrides Migration::__construct

File

merci_migrate/merci_reservation.inc, line 4

Class

MerciReservationMigration

Code

public function __construct($arguments) {
  parent::__construct($arguments);
  $this->source = new MigrateSourceReservation();

  //$this->dependencies = array('MerciLineItem');
  $this->destination = new MigrateDestinationEntityAPI('merci_reservation', 'checkout');
  $this->map = new MigrateSQLMap($this->machineName, array(
    'nid' => array(
      'type' => 'int',
      'unsigned' => TRUE,
      'not null' => TRUE,
    ),
  ), MigrateDestinationEntityAPI::getKeySchema('merci_reservation'));
  $this
    ->addFieldMapping('merci_line_item_reference', 'reservation_items')
    ->sourceMigration('MerciLineItem');
  $this
    ->addFieldMapping('field_owner', 'uid');
  $this
    ->addFieldMapping('field_operator', 'uid');
  $this
    ->addFieldMapping('created', 'created');

  /*
      $this->addFieldMapping('merci_checkout_dates', 'field_merci_date_value');
      $this->addFieldMapping('merci_checkout_dates:to', 'field_merci_date_value2');
      $this->addFieldMapping('merci_reservation_status', 'merci_checkout_status');
      $this->addFieldMapping('quantity')->defaultValue(1);
      $this->addFieldMapping('merci_resource_reference', 'merci_item_nid')->sourceMigration('MerciItem');
      $this->addFieldMapping('line_item_label', 'title');
      $this->addFieldMapping('merci_checkout_status', 'merci_reservation_status');
      //$this->addFieldMapping('merci_resource_display', 'resource_display_id');
      $this->addFieldMapping('entity_id','nid');
  */
}