You are here

function bat_unit_types_ids in Booking and Availability Management Tools for Drupal 7

Same name and namespace in other branches
  1. 8 modules/bat_unit/bat_unit.module \bat_unit_types_ids()

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 id and labels

1 call to bat_unit_types_ids()
bat_calendar_reference_field_settings_form in modules/bat_calendar_reference/bat_calendar_reference.module
Implements hook_field_settings_form().

File

modules/bat_unit/bat_unit.module, line 767

Code

function bat_unit_types_ids() {
  $unit_types = array();
  $types = bat_unit_get_types();
  foreach ($types as $type) {
    $unit_types[$type->type_id] = $type->name;
  }
  return $unit_types;
}