You are here

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

General initialization of a Migration object.

Overrides Migration::__construct

File

merci_migrate/merci_restrictions.inc, line 31
Support for node destinations.

Class

MerciItemRestrictionsMigration

Code

public function __construct($arguments) {
  parent::__construct($arguments);
  $this->source = new MerciContentTypesMigrateSource();
  $this->destination = new MigrateDestinationRestrictions('merci_restrictions');
  $this->map = new MigrateSQLMap($this->machineName, array(
    'type' => array(
      'type' => 'varchar',
      'length' => 32,
      'not null' => TRUE,
      'alias' => 'mt',
    ),
  ), MigrateDestinationRestrictions::getKeySchema());
  $this
    ->addFieldMapping('field_max_length_of_checkout', 'merci_max_hours_per_reservation')
    ->callbacks(array(
    $this,
    'modifyMaxHours',
  ));
  $this
    ->addFieldMapping('field_allow_overnight', 'merci_allow_overnight');
  $this
    ->addFieldMapping('field_allow_weekends', 'merci_allow_weekends');
  $this
    ->addFieldMapping('field_auto_checkout', 'merci_autocheckout');
  $this
    ->addFieldMapping('field_auto_checkin', 'merci_autocheckin');
  $this
    ->addFieldMapping('field_self_checkout', 'merci_selfcheckout');
  $this
    ->addFieldMapping('field_minimum_cancelation_time', 'merci_min_cancel_hours');
  $this
    ->addFieldMapping('title', 'type_name');
  $this
    ->addFieldMapping('field_allowed_roles', 'rids');
}