You are here

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

Returns a list of fields available to be mapped for the rooms unit (bundle)

Parameters

Migration $migration: Optionally, the migration containing this destination.

Return value

array Keys: machine names of the fields (to be passed to addFieldMapping) Values: Human-friendly descriptions of the fields.

Overrides MigrateDestination::fields

File

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

Class

MigrateDestinationRoomsUnit

Code

public function fields($migration = NULL) {
  $fields = array();

  // First the core (room_unit table) properties
  $fields['unit_id'] = t('Existing Unit ID');
  $fields['type'] = t('Unit Type');
  $fields['name'] = t('Unit Name');
  $fields['base_price'] = t('Base price');
  $fields['default_state'] = t('Default state');
  $fields['bookable'] = t('Default state');
  $fields['min_sleeps'] = t('Min sleeps');
  $fields['max_sleeps'] = t('Max sleeps');
  $fields['min_children'] = t('Min children');
  $fields['max_children'] = t('Max children');
  $fields['singles'] = t('Single beds');
  $fields['doubles'] = t('Double beds');
  $fields['data'] = t('Room unit data');

  // Then add in anything provided by handlers
  $fields += migrate_handler_invoke_all('Entity', 'fields', $this->entityType, $this->bundle, $migration);
  $fields += migrate_handler_invoke_all('RoomsUnit', 'fields', $this->entityType, $this->bundle, $migration);
  return $fields;
}