A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.yiiframework.com/doc/api/2.0/yii-db-conditions-hashconditionbuilder below:

HashConditionBuilder, yii\db\conditions\HashConditionBuilder | API Documentation for Yii 2.0

Method builds the raw SQL from the $expression that will not be additionally escaped or quoted.

                public function build(ExpressionInterface $expression, array &$params = [])
{
    $hash = $expression->getHash();
    $parts = [];
    foreach ($hash as $column => $value) {
        if (ArrayHelper::isTraversable($value) || $value instanceof Query) {
            
            $parts[] = $this->queryBuilder->buildCondition(new InCondition($column, 'IN', $value), $params);
        } else {
            if (strpos($column, '(') === false) {
                $column = $this->queryBuilder->db->quoteColumnName($column);
            }
            if ($value === null) {
                $parts[] = "$column IS NULL";
            } elseif ($value instanceof ExpressionInterface) {
                $parts[] = "$column=" . $this->queryBuilder->buildExpression($value, $params);
            } else {
                $phName = $this->queryBuilder->bindParam($value, $params);
                $parts[] = "$column=$phName";
            }
        }
    }
    return count($parts) === 1 ? $parts[0] : '(' . implode(') AND (', $parts) . ')';
}

            

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4