You are here

function bat_unit_get_types in Booking and Availability Management Tools for Drupal 8

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

Gets an array of all type bundles, keyed by the bundle name.

Parameters

string $bundle_name: If set, the bundle with the given name is returned.

Return value

\Drupal\bat_unit\Entity\UnitType[] Depending whether $bundle isset, an array of types or a single one.

4 calls to bat_unit_get_types()
BatEventUiBulkUpdateForm::buildForm in modules/bat_event_ui/src/Form/BatEventUiBulkUpdateForm.php
Form constructor.
BatEventUiEventTypeForm::buildForm in modules/bat_event_ui/src/Form/BatEventUiEventTypeForm.php
Form constructor.
BatUnitHandlerTypeIdFilter::getValueOptions in modules/bat_unit/src/Plugin/views/filter/BatUnitHandlerTypeIdFilter.php
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.
bat_unit_types_ids in modules/bat_unit/bat_unit.module
Helper function to easily get unit types in an array for use in forms, etc.

File

modules/bat_unit/bat_unit.module, line 561
Manage units - Units are things that can be booked for some period of time. (e.g. rooms - but also villas bungalows, cars, drills, you-get-the-idea etc.)

Code

function bat_unit_get_types($bundle_name = NULL) {
  return UnitType::loadMultiple();
}