Exemple #1
0
  /**
   * {@inheritdoc}
   */
  public function query($group_by = FALSE) {
    $this->fillValue();

    $condition_operator = empty($this->options['not']) ? '=' : '<>';

    if (count($this->value) > 1) {
      $filter = $this->query->createFilter(Unicode::strtoupper($this->operator));
      // $filter will be NULL if there were errors in the query.
      if ($filter) {
        foreach ($this->value as $value) {
          $filter->condition($this->realField, $value, $condition_operator);
        }
        $this->query->filter($filter);
      }
    }
    else {
      $this->query->condition($this->realField, reset($this->value), $condition_operator);
    }
  }