You are here

function bat_event_constraints_get_info 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_constraints_get_info()

See also

hook_event_constraints_info()

hook_event_constraints_info_alter()

3 calls to bat_event_constraints_get_info()
bat_event_get_calendar_response in modules/bat_event/bat_event.module
Given a date range and a set of valid states it will return all units within the set of valid states.
bat_event_get_matching_units_from_calendar in modules/bat_event/bat_event.module
Returns matching units based on a provided Calendar. A Calendar can be instantiated in a number of ways - bat_event offers bat_event_get_calendar. Using an already setup calendar multiple times reduces overall load.
bat_facets_search_api_query_alter in modules/bat_facets/bat_facets.module
Implements hook_search_api_query_alter().

File

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

Code

function bat_event_constraints_get_info() {

  // Use the advanced drupal_static() pattern, since this is called very often.
  static $drupal_static_fast;
  if (!isset($drupal_static_fast)) {
    $drupal_static_fast['bat_event_constraints_info'] =& drupal_static(__FUNCTION__);
  }
  $constraints_info =& $drupal_static_fast['bat_event_constraints_info'];
  if (empty($constraints_info)) {
    if ($cache = \Drupal::cache()
      ->get('bat_event_constraints_info')) {
      $constraints_info = $cache->data;
    }
    else {
      $constraints_info = \Drupal::moduleHandler()
        ->invokeAll('bat_event_constraints_info');

      // Let other modules alter the entity info.
      \Drupal::moduleHandler()
        ->alter('bat_event_constraints_info', $constraints_info);
      \Drupal::cache()
        ->get('bat_event_constraints_info', $constraints_info);
    }
  }
  return $constraints_info;
}