You are here

function rooms_availability_query_rooms_availability_access_alter in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

Implements hook_query_TAG_alter().

File

modules/rooms_availability/rooms_availability.module, line 110
Manages availability for Bookable Units and displaying dates on the jquery FullCalendar plugin.

Code

function rooms_availability_query_rooms_availability_access_alter(QueryAlterableInterface $query) {

  // Look for unit 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'] === 'rooms_units') {
      rooms_entity_access_query_alter($query, 'rooms_unit', $table['alias'], NULL, 'update availability');
      break;
    }
  }
}