Connects two or more conditions with the `AND` operator.
@param string $operator the operator to use for connecting the given operands
@param array $operands the Mongo conditions to connect.
@return array the generated Mongo condition.
548122
public function buildAndCondition($operator, $operands)
    {
        $operator = $this->normalizeConditionKeyword($operator);
        $parts = [];
        foreach ($operands as $operand) {
            $parts[] = $this->buildCondition($operand);
        }

        return [$operator => $parts];
    }
81668
public function add(BaseOperator ...$operators)
    {
        foreach ($operators as $operator) {
            if ($operator instanceof bAnd) {
                $this->operators['and'][] = $operator;
            } elseif ($operator instanceof bOr) {
                $this->operators['or'][] = $operator;
            } elseif ($operator instanceof bNot) {
                $this->operators['not'][] = $operator;
            } elseif ($operator instanceof Wildcard) {
                $this->operators['wildcard'][] = $operator;
            } elseif ($operator instanceof MatchingRule) {
                $this->operators['matchingrule'][] = $operator;
            } elseif ($operator instanceof Comparison) {
                $this->operators['comparison'][] = $operator;
            } else {
                throw new InvalidArgumentException('Unknown operator type.');
            }
        }
        
        return $this;
    }
480257
public function update($operator, Expression $operand)
    {
        if ($this->operator === $operator && $this->operand === $operand) {
            return $this;
        }

        return new self($operator, $operand);
    }
814663
protected function doOperation( Operator $op ) {
		if ( count( $this->operands ) < 2 ) {
			$op->error( 'missing operand' );
		}
		$right = array_pop( $this->operands );
		$left = array_pop( $this->operands );
		$result = $op->operate( $left, $right );
		$this->operands[] = $result;
	}
1213286
private function _where($operator, array $fields)
    {
        $count = count($fields);

        if ($count < 1 || $count > 3)
        {
            $fields = var_export($fields, true);
            throw new \InvalidArgumentException($fields);
        }

        $this->storageWhere[] = [$operator => $fields];

        return $this;
    }
1349048
final protected static function isOperatorValid (string $operator) : bool
	{
		// Arithmetic Operators
		$operators1 = ['+', '-', '*', '/', '%'];
		// Bitwise Operators
		$operators2 = ['&', '|', '^'];
		// Comparison Operators
		$operators3 = ['=', '<', '>', '>=', '<=', '<>'];
		// Compound Operators
		$operators4 = ['+=', '-=', '*=', '/=', '%=', '&=', '^-=', '|*='];
		// Logical Operators
		$operators5 = ['ALL', 'AND', 'ANY', 'BETWEEN', 'EXISTS', 'IN', 'LIKE', 'NOT', 'OR', 'SOME'];
		$operators 	= array_merge($operators1, $operators2, $operators3, $operators4, $operators5);
		return in_array(strtoupper($operator), $operators);
	}
387999
protected function compare($a, $b, $operator)
    {
        settype($a, 'array');
        settype($b, 'array');

        if (in_array($operator, array('>=', '<=', '>', '<'))) {
            $a = reset($a);
            $b = reset($b);
        }

        switch ($operator) {
            case '>=':
                return $a >= $b;
            case '<=':
                return $a <= $b;
            case '>':
                return $a > $b;
            case '<':
                return $a < $b;
            case '=':
                return count(array_intersect($a, $b)) > 0;
            case '!=':
                return count(array_intersect($a, $b)) == 0;
        }

        return false;
    }
248551
public Formula and(final Formula... operands) {
    final LinkedHashSet<Formula> ops = new LinkedHashSet<>(operands.length);
    Collections.addAll(ops, operands);
    return this.constructAnd(ops);
  }
307020
public function allowOperators($operators)
    {
        if ($this->_allowedOperators) {
            throw new BadMethodCallException('You can only set the allowed operators once.');
        }
        $this->_allowedOperators = is_array($operators) ? $operators : func_get_args();
        $this->checkRestrictions();
        return $this;
    }
389176
final public static function binaryOperation(Expression $leftOperand, $operator, Expression $rightOperand)
    {
        return new BinaryOperationExpression(
                $leftOperand,
                $operator,
                $rightOperand);
    }
926267
public function and(string $field, string $operator, string $field2)
    {
        $this->addClause(
            'where',
            compact('field', 'operator', 'field2')
        );

        return $this;
    }
825324
public function orWhere($field, $condition = false, $operator = '=')
    {
        if (func_num_args() >= 2) {
            $this->where->addOrCondition($field, $condition, $operator);
        } else {
            $this->where->addOrCondition($field);
        }

        return $this;
    }
540082
public function addOperator(string $operator): self
    {
        $this->validateOperator($operator);
        if (!in_array($operator, $this->operators)) {
            $this->operators[] = $operator;
        }

        return $this;
    }
69345
private LinkedHashSet<Formula> condenseOperandsAnd(final Collection<? extends Formula> operands) {
    final LinkedHashSet<Formula> ops = new LinkedHashSet<>();
    this.cnfCheck = true;
    for (final Formula form : operands)
      if (form.type() == AND) {
        for (final Formula f : ((NAryOperator) form).operands) {
          this.addFormulaAnd(ops, f);
          if (!this.formulaAdditionResult[0])
            return null;
          if (!this.formulaAdditionResult[1])
            this.cnfCheck = false;
        }
      } else {
        this.addFormulaAnd(ops, form);
        if (!this.formulaAdditionResult[0])
          return null;
        if (!this.formulaAdditionResult[1])
          this.cnfCheck = false;
      }
    return ops;
  }
231239
public function setOperators(array $operators)
    {
        $invalid = [];
        if (!$this->validateOperators($operators, $invalid)) {
            throw new \InvalidArgumentException(\sprintf('Trying to set invalid operator(s) "%s" for filter "%s"', \implode(', ', $operators), $this->getName()));
        }
        $this->operators = $operators;

        return $this;
    }
1176490
protected function getOperator(string $operator): callable
    {
        if (!$this->hasOperator($operator)) {
            throw new OperatorNotFoundException($operator, sprintf('Operator "%s" does not exist.', $operator));
        }

        return $this->operators[$operator];
    }
882326
public function whereArr($data, $operator = '=')
    {
        foreach ($data as $key => $value) {
            $this->where($key, $value, $operator);
        }

        return $this;
    }