You are here

function bat_booking_get_bundles in Booking and Availability Management Tools for Drupal 8

Gets an array of all booking 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_booking\Entity\BookingBundle[] Depending whether $type isset, an array of booking types or a single one.

2 calls to bat_booking_get_bundles()
BookingAddAccessCheck::access in modules/bat_booking/src/Access/BookingAddAccessCheck.php
Checks access to the unit add page for the unit type.
BookingPermissions::permissions in modules/bat_booking/src/BookingPermissions.php

File

modules/bat_booking/bat_booking.module, line 85

Code

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