generate and add to query a condition
exploitable by database driver
@param type $command
@param array $conditionList
@param type $separator
@return string
519829
protected function setConditions(&$command , array $conditionList , $separator = 'and') {
        foreach($conditionList as $condition) {
            
            $addCondition = $this->getOperator($condition->getOperator())->convert($condition);
            $this->mergeCondition($command , $addCondition , $separator);
            
        }
        return $command;
    }
530692
public function between($column, $value1, $value2, string $separator = 'AND', bool $not = false)
	{
		$this->wheres[] =
		[
			'type'      => 'between',
			'column'    => $column,
			'value1'    => $value1,
			'value2'    => $value2,
			'separator' => $separator,
			'not'       => $not,
		];

		return $this;
	}
618484
protected function createExpression(Condition $condition, $fieldDescriptor)
    {
        $value = $this->getValue($condition);

        // relative date for cases like "within a week" or "within this month"
        if ('between' === $condition->getOperator() && DataTypes::DATETIME_TYPE === $condition->getType()) {
            $this->expressions[] = $this->listBuilder->createBetweenExpression($fieldDescriptor, [$value, new \DateTime()]);
        } else {
            $this->expressions[] = $this->listBuilder->createWhereExpression(
                $fieldDescriptor,
                $value,
                $condition->getOperator()
            );
        }
    }
1060204
final public function queryOnString(string $query, string $default = '', string $separator = ', '): string
    {
        $array = $this->queryArrayOne($query);
        if (false === $array) {
            return $default;
        }
        return implode($separator, $array);
    }
1079895
public static function count(string $list, string $separator): int
    {
        return count(self::explode($separator, $list));
    }
166229
public function toString($separator = null)
    {
        if (!is_null($separator)) {
            $this->_separator = $separator;
        }

        $this->_prepareData();
        return $this->__toString();
    }
1335438
protected function addJoinExpression($expression, string $separator = 'AND')
    {
        if ($expression instanceof Closure) {
            $expression = Expression::fromClosure($expression);
        }

        $this->conditions[] = [
            'type' => 'joinExpression',
            'expression' => $expression,
            'separator' => $separator,
        ];

        return $this;
    }
332165
public function resolveUserIdToInboxesArray(string $separator, int $mode)
    {
        $return = [];
        foreach ($this->resolveUserIds() as $userId) {
            $return[$userId] = implode($separator, $this->resolveEmailsFromUserId($userId, $mode));
        }

        return $return;
    }
255740
public function currentLanguage(string $language, array $queryParams = [], string $separator = '&'): string
	{
		return $this->current($queryParams, $separator, $language);
	}
422274
public function where($condition, $value = null, $type = null)
    {

        switch ($type) {
            case null:
                $clause = 'WHERE';
                break;
            case 'or':
                $clause = 'OR';
                break;
            case 'and':
                $clause = 'AND';
                break;
            default:
                $clause = 'WHERE';
        }

        $this->oosql_where .= " $clause $condition";

        if ($value instanceof oosql) {

            $this->oosql_where .= $value->getSql();
        } elseif (null !== $value) {

            $this->oosql_conValues[] = $value;
        }

        return $this;
    }
1057634
public function render(string $input, string $separator = '-'): string {
    return static::renderStatic(
      [
        'input'     => $input,
        'separator' => $separator
      ],
      $this->buildRenderChildrenClosure(),
      $this->renderingContext
    );
  }
1002310
protected function addCondition($type, $column, $separator, $value)
    {
        $multiple = is_array($column) ? $column : [$column => $value];

        foreach ($multiple as $key => $val) {

            // Add the table name in case of ambiguous columns
            if (count($this->joinSources) > 0 && string_has($key, '.')) {
                $table = (!is_null($this->tableAlias)) ? $this->tableAlias : $this->formTable;

                $key = "{$table}.{$key}";
            }

            $key = $this->quoteIdentifier($key);
            $this->bindCondition($type, "{$key} {$separator} ?", $val);
        }

        return $this;
    }
451255
public function exists($query, string $separator = 'AND', bool $not = false)
	{
		if($query instanceof Closure)
		{
			$query = new Subquery($query);
		}

		$this->wheres[] =
		[
			'type'      => 'exists',
			'query'     => $query,
			'separator' => $separator,
			'not'       => $not,
		];

		return $this;
	}
1205205
public function toQueryString($separator = '&', $encoding = PHP_QUERY_RFC3986)
    {
        return http_build_query($this->toArray(), null, $separator, $encoding);
    }
1092597
protected function getConditionStringFromQueryBuilder(QueryBuilder $query)
    {
        $initialQueryChunks = explode('where ', $query->toSql());

        if (count($initialQueryChunks) == 1) {
            throw new InvalidArgumentException(
                'The query builder instance must have a where clause to build a condition string from'
            );
        }

        $queryChunks = explode('?', $initialQueryChunks[1]);
        $chunkCount  = count($queryChunks);
        $bindings    = $query->getBindings();
        $whereString = '';

        for ($i = 0; $i < $chunkCount; $i++) {

            $whereString .= $queryChunks[ $i ];

            if (isset($bindings[ $i ])) {

                if (gettype($bindings[ $i ]) === 'string') {
                    $whereString .= '"' . $bindings[ $i ] . '"';
                }
            }
        }

        return $whereString;
    }
575950
public function having($column, $operator, $value, string $separator = 'AND')
	{
		$this->havings[] =
		[
			'column'    => $column,
			'operator'  => $operator,
			'value'     => $value,
			'separator' => $separator,
		];

		return $this;
	}
67953
public static function getFirstStatement($query, $delimiter = null)
    {
        $lexer = new Lexer($query, false, $delimiter);
        $list = $lexer->list;

        /**
         * Whether a full statement was found.
         *
         * @var bool
         */
        $fullStatement = false;

        /**
         * The first full statement.
         *
         * @var string
         */
        $statement = '';

        for ($list->idx = 0; $list->idx < $list->count; ++$list->idx) {
            $token = $list->tokens[$list->idx];

            if ($token->type === Token::TYPE_COMMENT) {
                continue;
            }

            $statement .= $token->token;

            if (($token->type === Token::TYPE_DELIMITER) && ! empty($token->token)) {
                $delimiter = $token->token;
                $fullStatement = true;
                break;
            }
        }

        // No statement was found so we return the entire query as being the
        // remaining part.
        if (! $fullStatement) {
            return [
                null,
                $query,
                $delimiter,
            ];
        }

        // At least one query was found so we have to build the rest of the
        // remaining query.
        $query = '';
        for (++$list->idx; $list->idx < $list->count; ++$list->idx) {
            $query .= $list->tokens[$list->idx]->token;
        }

        return [
            trim($statement),
            $query,
            $delimiter,
        ];
    }