You are here

public function BookingViewsData::getViewsData in Booking and Availability Management Tools for Drupal 8

Returns views data for the entity type.

Return value

array Views data in the format of hook_views_data().

Overrides EntityViewsData::getViewsData

File

modules/bat_booking/src/Entity/BookingViewsData.php, line 21
Contains \Drupal\bat_booking\Entity\BookingViewsData.

Class

BookingViewsData

Namespace

Drupal\bat_booking\Entity

Code

public function getViewsData() {
  $data = parent::getViewsData();
  $data['booking']['nights']['field'] = [
    'title' => t('Nights'),
    'help' => t('Provide number of nights.'),
    'id' => 'bat_booking_handler_night_field',
  ];
  return $data;
}