You are here

function elasticsearch_connector_views_query::add_where in Elasticsearch Connector 7.5

Same name and namespace in other branches
  1. 7 modules/elasticsearch_connector_views/elasticsearch_connector_views_query.inc \elasticsearch_connector_views_query::add_where()
  2. 7.2 modules/elasticsearch_connector_views/elasticsearch_connector_views_query.inc \elasticsearch_connector_views_query::add_where()

Support for groupping.

See also

views_plugin_query_default::add_where().

File

modules/elasticsearch_connector_views/elasticsearch_connector_views_query.inc, line 264
Class for handling a view that gets its data not from the database, but from a Solr server.

Class

elasticsearch_connector_views_query
@file Class for handling a view that gets its data not from the database, but from a Solr server.

Code

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

  // Ensure all variants of 0 are actually 0. Thus '', 0 and NULL are all
  // the default group.
  if (empty($group)) {
    $group = 0;
  }

  // Check for a group.
  if (!isset($this->where[$group])) {
    $this
      ->set_where_group('AND', $group);
  }
  $this->where[$group]['conditions'][] = array(
    'field' => $field,
    'value' => $value,
    'operator' => $operator,
  );
}