You are here

public function MigrateDestinationRoomsUnit::prepare in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

Put into the data field all stuff that must go there.

@internal param $entity RoomsUnit object to build. Prefilled with any fields mapped in the Migration.* RoomsUnit object to build. Prefilled with any fields mapped in the Migration.

Parameters

$rooms_unit:

\stdClass $source_row: Raw source data object - passed through to prepare handlers.

Overrides MigrateDestinationEntity::prepare

1 call to MigrateDestinationRoomsUnit::prepare()
MigrateDestinationRoomsUnit::import in modules/rooms_unit/rooms_unit.migrate.inc
Imports a single rooms unit.

File

modules/rooms_unit/rooms_unit.migrate.inc, line 69
Class MigrateDestinationRoomsUnit.

Class

MigrateDestinationRoomsUnit

Code

public function prepare($rooms_unit, stdClass $source_row) {
  parent::prepare($rooms_unit, $source_row);

  // Store bed arrangement into data.
  $data = array(
    'bed_arrangement' => array(
      'singles' => $rooms_unit->singles,
      'doubles' => $rooms_unit->doubles,
    ),
  );
  $rooms_unit->data = $data;
}