@param  Clause $clause

@return void
503566
public static function calculateNegation(Clause $clause)
    {
        if ($clause->impossibilities !== null) {
            return;
        }

        $impossibilities = [];

        foreach ($clause->possibilities as $var_id => $possibility) {
            $impossibility = [];

            foreach ($possibility as $type) {
                if (($type[0] !== '=' && $type[0] !== '~'
                        && (!isset($type[1]) || ($type[1] !== '=' && $type[1] !== '~')))
                    || strpos($type, '(')
                    || strpos($type, 'getclass-')
                ) {
                    $impossibility[] = self::negateType($type);
                }
            }

            if ($impossibility) {
                $impossibilities[$var_id] = $impossibility;
            }
        }

        $clause->impossibilities = $impossibilities;
    }
115727
public function insert(Node $node) : void
    {
        $node->setParent($this->scope);
        $this->scope->insert($node);
    }
1184748
def <<(clause)
      new_clauses = @clauses.dup
      new_clauses.delete clause
      self.class.new(attributes) { new_clauses + [clause] }
    end
1291133
protected function applySearchClauses(Builder $query): void
    {
        if ($searched = $this->getAttribute('request')->search) {
            $this->getAttribute('searchableColumns')
                ->map(function (TableListColumn $column, int $key) use (&$query, $searched) {
                    $table = $column->getAttribute('customColumnTable');
                    $attribute = $column->getAttribute('customColumnTableRealAttribute')
                        ? $column->getAttribute('customColumnTableRealAttribute')
                        : $column->getAttribute('attribute');
                    if ($key > 0) {
                        $query->orWhere($table . '.' . $attribute, 'like', '%' . $searched . '%');
                    } else {
                        $query->where($table . '.' . $attribute, 'like', '%' . $searched . '%');
                    }
                });
        }
    }
823509
public function generateAlias(Clause $clause)
    {
        if ($clause instanceof FieldName)
        {
            $table = $clause->getTable();
            if (empty($table))
            {
                // When no table is defined, it means only one table is being
                // used in the query. Aliases will not be required
                return "";
            }

            $prefix = $table->getPrefix();
            $alias = $prefix . '_' . $clause->getField();
        }
        elseif ($clause instanceof SQLFunction)
        {
            $func = $clause->getFunction();
            $alias = strtolower($func);
        }
        else
            throw new ImplementationException("No alias generation implemented for: " . get_class($clause));

        $cnt = 1;
        $base_alias = $alias;
        while (isset($this->field_aliases[$alias]))
            $alias = $base_alias . (++$cnt);

        $this->field_aliases[$alias] = true;
        return $alias;
    }
682787
protected function compileJoinConstraint(array $clause)
	{
		if ($clause['nested']) {
			return $this->compileNestedJoinConstraint($clause);
		}

		$first = $this->wrap($clause['first']);

		if ($clause['where']) {
			if ($clause['operator'] === 'in' || $clause['operator'] === 'not in') {
				$second = '('.implode(', ', array_fill(0, $clause['second'], '?')).')';
			} else {
				$second = '?';
			}
		} else {
			$second = $this->wrap($clause['second']);
		}

		return "{$clause['boolean']} $first {$clause['operator']} $second";
	}
637065
public function addConstraint(Constraint $constraint) : void
    {
        $constraint->setValidator($this);
        array_push($this->constraints, $constraint);
    }
575158
protected function applyJoins($query)
    {
        foreach ($this->joins as $key => $join) {

            if (isset($this->joinTypes[$key])) {
                $joinMethod = $this->joinTypes[$key];
            } else {
                $joinMethod = 'leftJoin';
            }

            call_user_func_array([ $query, $joinMethod ], $join);
        }
    }
37139
protected function addClauseCondWithBind($clause, $andor, $conditions)
    {
        $cond = array_shift($conditions);
        $cond = $this->quoteNamesIn($cond);

        $bind =& $this->{"bind_{$clause}"};
        foreach ($conditions as $value) {
            $bind[] = $value;
        }

        $clause =& $this->$clause;
        if ($clause) {
            $clause[] = "$andor $cond";
        } else {
            $clause[] = $cond;
        }
    }
752068
def add_where_clause(self, clause):
        
        if not isinstance(clause, WhereClause):
            raise StatementException("only instances of WhereClause can be added to statements")
        clause.set_context_id(self.context_counter)
        self.context_counter += clause.get_context_size()
        self.where_clauses.append(clause)
586787
protected function compileNestedJoinConstraint(array $clause)
	{
		$clauses = [];

		foreach ($clause['join']->clauses as $nestedClause) {
			$clauses[] = $this->compileJoinConstraint($nestedClause);
		}

		$clauses[0] = $this->removeLeadingBoolean($clauses[0]);

		$clauses = implode(' ', $clauses);

		return "{$clause['boolean']} ({$clauses})";
	}
1047638
protected function compileColumns($columns, $clause)
    {
        $list = [];
        foreach ((array)$columns as $alias => $column) {
            if (is_string($column) && preg_match('/^(?:([0-9a-zA-Z$_]+)\.)?([0-9a-zA-Z$_]+)$/s', trim($column), $match)) { // for maximum performance, first check the most common case..
                // yes, the expression is just a column name: "col1" or "t1.col1"!
                $column = (!empty($match[1]) ? $this->db->quoteName($match[1]) . '.' : '') . $this->db->quoteName($match[2]);
            }
            else {
                if (is_callable($column)) {
                    $column = $column(new static($this->db));
                }

                if ($column instanceof BuilderContract) {
                    $this->putBindings($clause, $column->bindings());
                    $column = $column->toSql();
                }

                $column = $this->compileExpression($column);
            }

            if (is_string($alias)) {
                if (strncasecmp($column, 'SELECT ', 7) === 0) {
                    $column = "($column)";
                }
                $column .= ' AS ' . $this->db->quoteName($alias);
            }

            $list[] = $column;
        }

        return $list;
    }
535770
private static function logQuery(string $query): void
  {
    $query = trim($query);

    if (strpos($query, "\n")!==false)
    {
      // Query is a multi line query.
      self::$io->logVeryVerbose('Executing query:');
      self::$io->logVeryVerbose('<sql>%s</sql>', $query);
    }
    else
    {
      // Query is a single line query.
      self::$io->logVeryVerbose('Executing query: <sql>%s</sql>', $query);
    }
  }
156918
public function setClauses($clauses)
    {
        $this->clauses = array();

        foreach($clauses as $name => $clause) {
            $this->setClause($name, $clause);
        }
        return $this;
    }
1026902
private function getQueryClause($query, $clause)
    {
        $queries = $query->getMust();

        if ($clause == self::QUERY_CONDITION_NOT) {
            $queries = $query->getMustNot();
        } elseif ($clause == self::QUERY_CONDITION_SHOULD) {
            $queries = $query->getShould();
        }

        return $queries;
    }
404598
public function clause($condition = 'AND')
    {
        if (empty($this->where)) {
            $condition = null;
        }
        $clause = new AnDomainQueryClause($this, $condition);

        return $clause;
    }
773909
function (clause) {
            var cond = argsToArray(arguments).slice(1), cb;
            if (cond.length && isFunction(cond[cond.length - 1])) {
                cb = cond.pop();
            }
            cond = cond.length === 1 ? cond[0] : cond;
            if ((cond == null || cond === undefined || cond === "") || (Array.isArray(cond) && cond.length === 0 && !cb) || (isObject(cond) && isEmpty(cond) && !cb)) {
                return this.mergeOptions();
            } else {
                cond = this._filterExpr(cond, cb);
                var cl = this.__opts[clause];
                cl && (cond = new BooleanExpression("AND", cl, cond));
                var opts = {};
                opts[clause] = cond;
                return this.mergeOptions(opts);
            }
        }