You are here

function commerce_order_query_commerce_order_access_alter in Commerce Core 7

Implements hook_query_TAG_alter().

File

modules/order/commerce_order.module, line 856
Defines the core Commerce order entity and API functions to manage orders and interact with them.

Code

function commerce_order_query_commerce_order_access_alter(QueryAlterableInterface $query) {

  // Look for an order 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'] === 'commerce_order') {
      commerce_entity_access_query_alter($query, 'commerce_order', $table['alias']);
      break;
    }
  }
}