Display the values with AND or OR (if multiple showOnValues are defined).

@param string $operator
331066
public function setShowOnValueOperator($operator = 'OR')
    {
        if ($operator != 'AND' && $operator != 'OR') {
            throw new \InvalidArgumentException('not allowed operator: "'.$operator.'" (AND / OR is allowed)');
        }

        $this->showOnValueOperator = (string) $operator;
    }
1366882
protected function mapConditionOperator(string $operator) : string
    {
        ConditionOperator::validate($operator);

        static $dbOperatorMap = [
            ConditionOperator::EQUALS                           => BinOp::EQUAL,
            ConditionOperator::NOT_EQUALS                       => BinOp::NOT_EQUAL,
            ConditionOperator::IN                               => BinOp::IN,
            ConditionOperator::NOT_IN                           => BinOp::NOT_IN,
            ConditionOperator::LESS_THAN                        => BinOp::LESS_THAN,
            ConditionOperator::LESS_THAN_OR_EQUAL               => BinOp::LESS_THAN_OR_EQUAL,
            ConditionOperator::GREATER_THAN                     => BinOp::GREATER_THAN,
            ConditionOperator::GREATER_THAN_OR_EQUAL            => BinOp::GREATER_THAN_OR_EQUAL,
            ConditionOperator::STRING_CONTAINS                  => BinOp::STR_CONTAINS,
            ConditionOperator::STRING_CONTAINS_CASE_INSENSITIVE => BinOp::STR_CONTAINS_CASE_INSENSITIVE,
        ];

        return $dbOperatorMap[$operator];
    }
901971
public function orHaving(string $column, $value, string $operator = self::OPERATOR_EQ): self
    {
        $this->criteria($this->having, $column, $value, $operator, self::LOGICAL_OR);

        return $this;
    }
1372407
private function formatWhere($where, $operator = 'AND')
    {
        if (is_string($where)) {
            return $where;
        }

        $fullWhere = [];

        if (is_array($where)) {
            foreach ($where as $key => $value) {
                $fullWhere[] = sprintf(
                    '%s = %s',
                    $this->quoteIdentifier($key),
                    $this->quote($value)
                );
            }
        } elseif (is_a($where, 'Database\Query\Where')) {
            $operator = $where->getOperator();
            $whereClause = $where->getWhereClause();

            if (!empty($whereClause)) {
                foreach ($whereClause as $part) {
                    if ($part[0] === '=') {
                        $fullWhere[] = $this->formatWhere($part[1], $operator);
                    } else {
                        $q = sprintf(
                            '%s %s',
                            $this->quoteIdentifier($part[1]),
                            $part[0]
                        );

                        if (isset($part[2])) {
                            $q .= ' ' . $this->quote($part[2]);
                        }

                        $fullWhere[] = $q;
                    }
                }
            }
        }

        return '(' . implode(" {$operator} ", $fullWhere) . ')';
    }
998443
private void addOperator(final String operator) {
        // This should never happen but sanity check...
        Validate.notNull(operator);

        if(lastOperator == null) {
            lastOperator = operator;
        }

        /* Logic to determine whether to put parentheses around the existing fieldtext. This is tied to the use of the
         * NOT operator as it also adds parentheses.
         */
        if(not) {
            if(componentCount == 1) {
                fieldTextString.insert(0, "NOT+");
            } else {
                fieldTextString.insert(0, "NOT(").append(')');
            }
        } else if(!lastOperator.equals(operator)) {
            fieldTextString.insert(0, '(').append(')');
        }

        lastOperator = operator;

        fieldTextString.append('+').append(operator).append('+');
    }
41767
public function setOperator($operator)
    {
        if ($operator !== null && $operator !== Query::OP_AND && $operator !== Query::OP_OR) {
            throw new \InvalidArgumentException("Operator must be Query::OP_AND or Query::OP_OR");
        }

        $this->operator = $operator;

        return $this;
    }
1214056
protected function getEvaluatorByOperatorType($operator)
    {
        $evaluatorsByOperator = array();
        $evaluatorsByOperator[self::AND_OPERATOR] = 'andEvaluator';
        $evaluatorsByOperator[self::OR_OPERATOR] = 'orEvaluator';
        $evaluatorsByOperator[self::NOT_OPERATOR] = 'notEvaluator';

        return $evaluatorsByOperator[$operator];
    }
65281
public function orHaving($column, $operator = null, $value = null)
    {
        return $this->having($column, $operator, $value, 'or');
    }
1337550
public function orWhere($column, $operator, $value = null)
    {
        $this->orWheres[] = new Where($column, $operator, $value, 'OR');

        return $this;
    }
1094551
private function validateOperator(string $operator)
    {
        if (!in_array($operator, self::VALID_OPERATORS)) {
            throw new \InvalidArgumentException(sprintf(
                '%s is not a valid operator'
            ), $operator);
        }
    }
78031
public function orWhere($key, $operator, $value)
    {
        $this->where[] = 'OR '.$key.' '.$operator.' '.'?';
        $this->bindings[] = $value;

        return $this;
    }
342917
protected function invalidOperator($operator)
    {
        return ! in_array(strtolower($operator), $this->operators, true) &&
               ! in_array(strtolower($operator), $this->grammar->getOperators(), true);
    }
745109
private static function checkInlineOperator(&$operator, &$value, $settings = [])
    {
        if (is_array($value)) {
            return;
        }

        // Boolean does not provide inline operations.
        if (Arr::get($settings, 'filter') === 'boolean') {
            return;
        }

        $value_array = explode(' ', trim($value), 2);

        if (count($value_array) == 1) {
            return;
        }

        $check_operator = array_shift($value_array);

        if (self::checkOperator(Arr::get($settings, 'filter', 'string'), $check_operator)) {
            $operator = $check_operator;
            $value = array_shift($value_array);
        }
    }
992400
protected function validate(array $values, $operator)
    {
        if (!in_array($operator, array('=', '!='))) {
            return $this->translation->text('Unsupported operator');
        }

        if (count($values) != 1) {
            return $this->translation->text('@field has invalid value', array(
                '@field' => $this->translation->text('Condition')));
        }

        $scope = filter_var(reset($values), FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);

        if (!isset($scope)) {
            return $this->translation->text('@field has invalid value', array(
                '@field' => $this->translation->text('Condition')));
        }

        return true;
    }
1075738
private function setSimpleOperator($operator, $value)
    {
        if (empty($operator)) {
            throw new InvalidArgumentException('The operator must not be null' .
                ' or empty.');
        }

        if (is_null($value) || $value === '') {
            throw new InvalidArgumentException('The value string must not be' .
                ' null or empty');
        }

        $this->simpleOperator = $operator;
        $this->simpleValue = $value;
    }
647595
final protected static function validateOperator (string $operator, string $defaultOperator="=") : string
	{
		return static::isOperatorValid($operator) ? $operator : ($defaultOperator ?: '=');
	}
1174960
public function where($field, $operator = null, $value = null, $boolean = 'AND')
    {
        // If the developer is adding multiple where statements together,
        // we will enforce that by adding the approriate boolean.

        if ($this->condition && count($this->condition) > 0) {
            $this->condition[] = $boolean;
        }

        // Here we will make some assumptions about the operator. If only two values
        // are passed in, we will assume the operator is an equals sign. Furthermore,
        // we will identify if the value is null and apply the respective operator.

        list($value, $operator) = $this->prepareValueAndOperator(
            $value, $operator, func_num_args() == 2
        );

        $this->condition[] = [
            'field' => compact('field'),
            'op' => $operator,
            'value' => $value
        ];

        return $this;
    }