You are here

function bat_event_types_ids in Booking and Availability Management Tools for Drupal 8

Same name and namespace in other branches
  1. 7 modules/bat_event/bat_event.module \bat_event_types_ids()

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

Return value

array An array of event types keyed by type id and labels

2 calls to bat_event_types_ids()
BatCalendarUnitReference::fieldSettingsForm in modules/bat_calendar_reference/src/Plugin/Field/FieldType/BatCalendarUnitReference.php
Returns a form for the field-level settings.
BatCalendarUnitTypeReference::fieldSettingsForm in modules/bat_calendar_reference/src/Plugin/Field/FieldType/BatCalendarUnitTypeReference.php
Returns a form for the field-level settings.

File

modules/bat_event/bat_event.module, line 298
Manage Events - Events store the EventValue of a Unit over a period of time.

Code

function bat_event_types_ids() {
  $event_types = [];
  $types = bat_event_get_types();
  foreach ($types as $type) {
    $event_types[$type
      ->id()] = $type
      ->label();
  }
  return $event_types;
}