You are here

function bat_event_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_ids()

Get a list of Event keyed by id and name in value.

File

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

Code

function bat_event_ids($conditions = []) {
  $events = [];
  $query = \Drupal::entityQuery('bat_event');
  $result = $query
    ->execute();
  if (count($result) > 0) {
    $entities = bat_event_load_multiple($result, $conditions);
    foreach ($entities as $event) {
      $events[$event
        ->id()] = $event
        ->label();
    }
  }
  return $events;
}