You are here

function bat_event_query_bat_event_access_alter in Booking and Availability Management Tools for Drupal 7

Same name and namespace in other branches
  1. 8 modules/bat_event/bat_event.module \bat_event_query_bat_event_access_alter()

Implements hook_query_TAG_alter().

File

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

Code

function bat_event_query_bat_event_access_alter(QueryAlterableInterface $query) {

  // Look for an event base table to pass to the query altering function or
  // else assume we don't have the tables we need to establish order related
  // altering right now.
  foreach ($query
    ->getTables() as $table) {
    if ($table['table'] === 'bat_events') {
      bat_entity_access_query_alter($query, 'bat_event', $table['alias']);
      break;
    }
  }
}