You are here

function bat_booking_entity_info_alter in Booking and Availability Management Tools for Drupal 7

Implements hook_entity_info_alter().

We are adding the info about the booking types via a hook to avoid a recursion issue as loading the room types requires the entity info as well.

File

modules/bat_booking/bat_booking.module, line 96

Code

function bat_booking_entity_info_alter(&$entity_info) {
  foreach (bat_booking_get_types() as $type => $info) {
    $entity_info['bat_booking']['bundles'][$type] = array(
      'label' => $info->label,
      'admin' => array(
        'path' => 'admin/bat/config/booking-types/manage/%bat_booking_type',
        'real path' => 'admin/bat/config/booking-types/manage/' . $type,
        'bundle argument' => 5,
        'access arguments' => array(
          'bypass bat_booking entities access',
        ),
      ),
    );
  }
}