function bat_unit_bundle_load in Booking and Availability Management Tools for Drupal 8
Same name and namespace in other branches
- 7 modules/bat_unit/bat_unit.module \bat_unit_bundle_load()
Menu argument loader; Load a unit bundle by string.
Parameters
string $bundle: The machine-readable name of a unit bundle to load.
bool $reset: A boolean indicating whether the internal cache should be reset.
Return value
\Drupal\bat_unit\Entity\UnitBundle|null A unit bundle array or FALSE if $bundle does not exist.
1 call to bat_unit_bundle_load()
- BatUnitHandlerUnitBundleField::render in modules/
bat_unit/ src/ Plugin/ views/ field/ BatUnitHandlerUnitBundleField.php - Renders the field.
File
- modules/
bat_unit/ bat_unit.module, line 284 - 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_bundle_load($bundle, $reset = FALSE) {
if ($reset) {
\Drupal::entityTypeManager()
->getStorage('bat_unit_bundle')
->resetCache([
$bundle,
]);
}
return UnitBundle::load($bundle);
}