You are here

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

Helper function to easily get unit types in an array for use in forms, etc.

Return value

array An array of unit types keyed by type name and labels

5 calls to rooms_unit_types_ids()
rooms_availability_reference_field_settings_form in modules/rooms_availability_reference/rooms_availability_reference.module
Implements hook_field_settings_form().
rooms_booking_manager_alter_rooms_booking_settings in modules/rooms_booking_manager/rooms_booking_manager.module
Alters for the 'rooms_booking_settings' form.
rooms_unit_update_7006 in modules/rooms_unit/rooms_unit.install
Adds max and min sleeps for Bookable Unit Types.
rooms_unit_update_7007 in modules/rooms_unit/rooms_unit.install
Renames 'field_options' to 'rooms_booking_unit_options' and attach this field to any bundle of rooms_unit_type.
rooms_unit_update_7008 in modules/rooms_unit/rooms_unit.install
Updates all data saved in Rooms Unit Type to change max/min_children_sleeps to max/min_children.

File

modules/rooms_unit/rooms_unit.module, line 341
Manage units - Units are things that can be booked on a nightly basis (e.g. rooms - but also villas bungalows, etc).

Code

function rooms_unit_types_ids() {
  $unit_types = array();
  $types = rooms_unit_get_types();
  foreach ($types as $type) {
    $unit_types[$type->type] = $type->label;
  }
  return $unit_types;
}