You are here

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

Implements hook_query_TAG_alter().

File

modules/rooms_booking/rooms_booking.module, line 622
Manage Bookings - Bookings are tied to a customer profile and possible a Unit ID and Order ID.

Code

function rooms_booking_query_rooms_booking_access_alter(QueryAlterableInterface $query) {

  // Look for a booking 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_bookings') {
      rooms_entity_access_query_alter($query, 'rooms_booking', $table['alias']);
      break;
    }
  }
}