You are here

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

Gets an array of all booking types, keyed by the type name.

Parameters

string $type_name: If set, the type with the given name is returned.

bool $reset: A boolean indicating that the internal cache should be reset.

Return value

RoomsBookingType[] Depending whether $type isset, an array of booking types or a single one.

7 calls to rooms_booking_get_types()
RoomsBookingUIController::hook_menu in modules/rooms_booking/rooms_booking.admin.inc
Overrides hook_menu() defaults.
rooms_availability_event_manager_form in modules/rooms_availability/rooms_availability.module
The Event Manager Form.
rooms_booking_entity_info_alter in modules/rooms_booking/rooms_booking.module
Implements hook_entity_info_alter().
rooms_booking_form_wrapper in modules/rooms_booking/rooms_booking.admin.inc
Form callback wrapper: edit a Booking.
rooms_booking_manager_alter_rooms_booking_settings in modules/rooms_booking_manager/rooms_booking_manager.module
Alters for the 'rooms_booking_settings' form.

... See full list

1 string reference to 'rooms_booking_get_types'
rooms_booking_type_form in modules/rooms_booking/rooms_booking_type.admin.inc
Generates the Booking type editing form.

File

modules/rooms_booking/rooms_booking.module, line 645
Manage Bookings - Bookings are tied to a customer profile and possible a Unit ID and Order ID.

Code

function rooms_booking_get_types($type_name = NULL, $reset = FALSE) {

  // entity_load will get the Entity controller for our booking entity and call
  // the load function of that object.
  $types = entity_load_multiple_by_name('rooms_booking_type', isset($type_name) ? array(
    $type_name,
  ) : FALSE);
  return isset($type_name) ? reset($types) : $types;
}