@param $composite
@param $clauses

@return $this|WhereBuilder
4731
private function x($composite, $clauses)
    {
        $builder = new self($composite);

        if ($clauses) {
            foreach ($clauses as $x) {
                $builder->add($x);
            }

            $this->add($builder);

            return $this;
        }

        return $builder;
    }
366082
public function addNestedWhereQuery($query, $boolean = 'and')
    {
        if (count($query->wheres)) {
            $type = 'Nested';
            $column = null;
            $value = $query->wheres;
            $this->wheres[] = compact('column', 'type', 'value', 'boolean');
        }

        return $this;
    }
196025
protected function getItemsByCompositeExpression(CompositeExpression $expression = null, QueryBuilder $queryBuilder = null) : array
    {
        if (!$queryBuilder instanceof QueryBuilder) {
            $queryBuilder = $this->getQueryBuilder();
        }

        $queryBuilder->select('*')->from($this->table);
        if (isset($expression)) {
            $queryBuilder->where($expression);
        }

        $indexQueueItemRecords = $queryBuilder->execute()->fetchAll();
        return $this->getIndexQueueItemObjectsFromRecords($indexQueueItemRecords);
    }
806642
public function where($condition, $value = null, $append = false, $clause = "WHERE")
    {
        if (is_array($value)) {
            $condition = $this->formatWhereConditionWithMultipleTokens($condition, $value, $this->escapeValidator);
        } else {
            if ($value === null) {
                $condition = preg_replace("/=\s*\?/", "IS ?", $condition, 1);
                $value = 'NULL';
            } else if (is_bool($value)) {
                $value = $value ? 'TRUE' : 'FALSE';
            } else if (is_int($value) || is_float($value)) {
                // Preserve $value as is
            } else {
                $rid = $this->ridValidator->check($value, true);
                $value = $rid ? $rid : '"' . $this->escapeValidator->check($value, true) . '"';
            }

            $condition = str_replace("?", $value, $condition);
        }

        if (!$this->getTokenValue('Where')) {
            $clause = 'WHERE';
        }

        $this->setTokenValues('Where', array("{$clause} $condition"), $append, false, false);

        return $this;
    }
309017
public function whereExpr($expr, $bind = null)
    {
        foreach ($this->queries as $query) {
            $query->whereExpr($expr, $bind);
        }

        return $this;
    }
473374
protected function _convertOnClause($clause)
    {
        if ($clause === 'CASCADE' || $clause === 'RESTRICT') {
            return strtolower($clause);
        }
        if ($clause === 'NO ACTION') {
            return TableSchema::ACTION_NO_ACTION;
        }

        return TableSchema::ACTION_SET_NULL;
    }
784210
public function from($tables = null): IQueryBuilderHandler
    {
        if ($tables === null) {
            $this->statements['tables'] = null;

            return $this;
        }

        if (\is_array($tables) === false) {
            $tables = \func_get_args();
        }

        $tTables = [];

        foreach ((array)$tables as $key => $value) {
            if (\is_string($key) === true) {
                $this->alias($value, $key);
                $tTables[] = $key;
                continue;
            }

            $tTables[] = $value;
        }

        $tTables = $this->addTablePrefix($tTables, false);
        $this->statements['tables'] = $tTables;

        return $this;
    }
45993
private function validateDeleteClauses(array $clauses)
    {
        foreach ($clauses as $clause) {
            if (!($clause instanceof FromClause)
                and !($clause instanceof JoinClause)
                and !($clause instanceof WhereClause)
                and !($clause instanceof OrderByClause)
                and !($clause instanceof LimitClause)
            ) {
                throw new SqlException('Current query is not a DELETE statement.');
            }
        }

        return $this;
    }
1200032
public function addNestedWhereQuery($query)
    {
        if (count($query->wheres)) {
            $wheres = $this->wheres ?: [];

            $this->wheres = array_merge($wheres, $query->wheres);
        }

        return $this;
    }
271778
public function addWhereClause($clause)
    {
        if (null === $this->whereClause) {
            $this->whereClause = "WHERE {$clause}".PHP_EOL;
        } else {
            $this->whereClause = $this->whereClause."AND {$clause}".PHP_EOL;
        }
    }
90799
public function addWhereAny($filters)
    {
        // Parse and split predicates along with any parameters
        $filters = $this->normalisePredicates(func_get_args());
        $this->splitQueryParameters($filters, $predicates, $parameters);

        $clause = "(" . implode(") OR (", $predicates) . ")";
        return $this->addWhere(array($clause => $parameters));
    }
1250094
public function orHaving(...$conditions) : self
    {
        $this->havingConditions = $this->conditionalQueryBuilder->addConditionToClause(
            $this->havingConditions, 'OR', ...$this->createConditionExpressions($conditions)
        );

        return $this;
    }
1031461
protected function filterByConstraints($constraints) : Builder
	{
		$this->builder->where(function($query) use ($constraints) {
			foreach ($constraints as $filter) {
				if (trim($filter) != '') {
					$query->orWhere('tags', 'like', '%' . $filter . '%');
				}
			}

			return $query;
		});

		return $this->builder;
	}
449524
@SafeVarargs
    public static <T, R> Function<T, List<R>> allMatches(Clause<T, R>... clauses) {
        return new AllMatchesStrategy<>(Arrays.asList(clauses));
    }
215757
@SuppressWarnings("unchecked")
    public static Condition composite(Condition... conditions) {
        Condition init = alwaysTrue();

        for (Condition condition : conditions) {
            Predicate<Call> newPredicate = Predicates.and(init.getPredicate(), condition.getPredicate());
            if (condition instanceof ConditionWithApplicables) {
                init = new ConditionWithApplicables(newPredicate, ((ConditionWithApplicables) condition).getApplicables());
            } else {
                init = Condition.custom(newPredicate);
            }
        }

        return init;
    }
179370
public function where(string ...$condition) : self
    {
        // We want to wipe out anything already in the condition list
        $this->whereConditions = [];
        $this->whereConditions = $this->addConditionToClause(
            $this->whereConditions, 'AND', ...$condition);

        return $this;
    }
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;
        }
    }