You are here

function efq_views_handler_argument_field_numeric::query in EntityFieldQuery Views Backend 7

Set up the query for this argument.

The argument sent may be found at $this->argument.

Parameters

bool $group_by: Whether the query uses a group-by.

Overrides views_handler_argument_numeric::query

File

handlers/efq_views_handler_argument_field_numeric.inc, line 7

Class

efq_views_handler_argument_field_numeric
Numeric argument handler for fields.

Code

function query($group_by = false) {
  if (!empty($this->options['break_phrase'])) {
    views_break_phrase($this->argument, $this);
  }
  else {
    $this->value = array(
      $this->argument,
    );
    $this->operator = 'and';
  }
  if (count($this->value) > 1 && $this->operator == 'or') {
    $operator = empty($this->options['not']) ? 'IN' : 'NOT IN';
    $this->query->query
      ->fieldCondition($this->definition['field_name'], $this->real_field, $this->value, $operator);
  }
  else {
    $operator = empty($this->options['not']) ? '=' : '<>';
    foreach ($this->value as $value) {
      $this->query->query
        ->fieldCondition($this->definition['field_name'], $this->real_field, $value, $operator);
    }
  }
}