You are here

function rooms_booking_manager_views_data_alter in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

Implements hook_views_data_alter().

File

modules/rooms_booking_manager/views/rooms_booking_manager.views.inc, line 12
rooms_booking_cart_view.views_default.inc

Code

function rooms_booking_manager_views_data_alter(&$data) {
  if (isset($data['field_data_rooms_booked_unit_id']['rooms_booked_unit_id_value'])) {
    $data['field_data_rooms_booked_unit_id']['rooms_booked_unit_id_value']['relationship'] = array(
      'title' => t('Booked Unit'),
      'help' => t("Relate this field to its bookable unit"),
      'handler' => 'views_handler_relationship',
      'base' => 'rooms_units',
      'base field' => 'unit_id',
      'field' => 'rooms_booked_unit_id_value',
      'label' => t('Booking unit'),
    );
  }
}