You are here

function views_contextual_filters_or_query::add_where in Views Contextual Filters OR 7

Add a simple WHERE clause to the query. The caller is responsible for ensuring that all fields are fully qualified (TABLE.FIELD) and that the table already exists in the query.

Overrides views_plugin_query_default::add_where

File

plugins/views_contextual_filters_or_query.inc, line 43
Defines the alter query object.

Class

views_contextual_filters_or_query
Object used to create a SELECT query.

Code

function add_where($group, $field, $value = NULL, $operator = NULL) {
  parent::add_where($group, $field, $value, $operator);

  // Check for a group.
  if ($group === 0 && isset($this->where[$group])) {
    $op = $this->options['contextual_filters_or'] ? 'OR' : 'AND';
    $this
      ->set_where_group($op, $group);
  }
}