You are here

function finder_views_views_query_alter in Finder 7

Same name and namespace in other branches
  1. 6 modules/finder_views/finder_views.module \finder_views_views_query_alter()

Implements hook_views_query_alter().

See also

hook_views_query_alter()

File

modules/finder_views/finder_views.module, line 532
The finder views module.

Code

function finder_views_views_query_alter($view, &$query) {
  if (isset($view->finder_ids)) {
    if (!empty($view->finder_ids)) {
      $alias = $query
        ->ensure_table($view->base_table);
      $query
        ->add_where(NULL, $alias . '.' . $view->base_field, $view->finder_ids, 'IN');
    }
    else {
      $query
        ->add_where_expression(NULL, '1=0');
    }
  }
}