function rooms_booking_entity_info_alter in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 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.
@todo This needs to be improved
File
- modules/
rooms_booking/ rooms_booking.module, line 408 - Manage Bookings - Bookings are tied to a customer profile and possible a Unit ID and Order ID.
Code
function rooms_booking_entity_info_alter(&$entity_info) {
foreach (rooms_booking_get_types() as $type => $info) {
$entity_info['rooms_booking']['bundles'][$type] = array(
'label' => $info->label,
'admin' => array(
'path' => 'admin/rooms/bookings/booking-types/manage/%rooms_booking_type',
'real path' => 'admin/rooms/bookings/booking-types/manage/' . $type,
'bundle argument' => 5,
'access arguments' => array(
'administer rooms_booking_type entities',
),
),
);
}
}