You are here

function bat_event_series_get_types in Booking and Availability Management Tools for Drupal 8

Gets an array of all event series 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

\Drupal\bat_event_series\Entity\EventSeriesType[] Depending whether $type isset, an array of event series types or a single one.

1 call to bat_event_series_get_types()
EventSeriesAddAccessCheck::access in modules/bat_event_series/src/Access/EventSeriesAddAccessCheck.php
Checks access to the event add page for the event series type.

File

modules/bat_event_series/bat_event_series.module, line 232

Code

function bat_event_series_get_types($type_name = NULL, $reset = FALSE) {
  if ($reset) {
    \Drupal::entityTypeManager()
      ->getStorage('bat_event_series_type')
      ->resetCache();
  }
  $types = EventSeriesType::loadMultiple();
  return isset($type_name) ? $types[$type_name] : $types;
}