You are here

function bat_event_load 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_load()

Fetches an event object.

Parameters

int $event_id: Integer specifying the event id.

bool $reset: A boolean indicating that the internal cache should be reset.

Return value

object A fully-loaded $event object or FALSE if it cannot be loaded.

See also

bat_event_load_multiple()

9 calls to bat_event_load()
bat_event_update_8001 in modules/bat_event/bat_event.install
Migrate event's dates on the new field.
bat_fullcalendar_bat_fullcalendar_modal_content in modules/bat_fullcalendar/bat_fullcalendar.module
Implements hook_bat_fullcalendar_modal_content();
EditRepeatingRuleConfirmationModalForm::checkAvailability in modules/bat_event_series/src/Form/EditRepeatingRuleConfirmationModalForm.php
EditRepeatingRuleConfirmationModalForm::getEvents in modules/bat_event_series/src/Form/EditRepeatingRuleConfirmationModalForm.php
EventForm::validateForm in modules/bat_event/src/Entity/Form/EventForm.php
Button-level validation handlers are highly discouraged for entity forms, as they will prevent entity validation from running. If the entity is going to be saved during the form submission, this method should be manually invoked from the button-level…

... See full list

File

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

Code

function bat_event_load($event_id = NULL, $reset = FALSE) {
  if ($reset) {
    \Drupal::entityTypeManager()
      ->getStorage('bat_event')
      ->resetCache([
      $event_id,
    ]);
  }
  return Event::load($event_id);
}