Skip to content
PHP Ecosystem
Explore

ExpressionBuilder

API reference › yii › db › ExpressionBuilder

classyii\db\ExpressionBuilder
ImplementsExpressionBuilderInterface
Uses traitsExpressionBuilderTrait
Since2.0.14
Sourceframework/db/ExpressionBuilder.php

Class ExpressionBuilder builds objects of Expression class.

PropertyTypeDescriptionDefined by
$queryBuilder protectedQueryBuilderDefault: null.ExpressionBuilderTrait
MethodDescriptionDefined by
__construct()ExpressionBuilderTrait constructor.ExpressionBuilderTrait
build()Method builds the raw SQL from the $expression that will not be additionally escaped or quoted.ExpressionBuilder
public function build(yii\db\Expression|yii\db\ExpressionInterface $expression, array &$params = []): string

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

Parameters

ParameterTypeDescription
$expressionExpression|ExpressionInterfaceThe expression to be built
$paramsarrayThe binding parameters.

Returns

string: The raw SQL that will not be additionally escaped or quoted.