You are here

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

Implements hook_query_TAG_alter().

File

modules/rooms_unit/rooms_unit.module, line 247
Manage units - Units are things that can be booked on a nightly basis (e.g. rooms - but also villas bungalows, etc).

Code

function rooms_unit_query_rooms_unit_access_alter(QueryAlterableInterface $query) {

  // Look for an 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']);
      break;
    }
  }
}