You are here

function i18n_select_query_node_access_alter in Internationalization 7

Implementation of hook_query_node_access_alter().

Rewrite node queries so language selection options are enforced.

File

i18n_select/i18n_select.module, line 140
Multilingual content selection module.

Code

function i18n_select_query_node_access_alter(QueryAlterableInterface $query) {
  if (i18n_select_mode('nodes') && i18n_select_check_query($query, 'nid') && ($table_alias = i18n_select_check_table($query, 'node', 'nid'))) {
    $query
      ->condition($table_alias . '.language', i18n_select_langcodes());

    // Mark query as altered
    $query
      ->addTag('i18n_select');
  }
}