0 follower

Final Class Yiisoft\Db\Mssql\Builder\LengthBuilder

InheritanceYiisoft\Db\Mssql\Builder\LengthBuilder
ImplementsYiisoft\Db\Expression\ExpressionBuilderInterface

Builds SQL LEN() function expressions for Length objects.

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Yiisoft\Db\Mssql\Builder\LengthBuilder
build() Builds a SQL LEN() function expression from the given Length object. Yiisoft\Db\Mssql\Builder\LengthBuilder

Method Details

Hide inherited methods

__construct() public method

public __construct( \Yiisoft\Db\QueryBuilder\QueryBuilderInterface $queryBuilder ): mixed
$queryBuilder \Yiisoft\Db\QueryBuilder\QueryBuilderInterface

                public function __construct(private readonly QueryBuilderInterface $queryBuilder) {}

            
build() public method

Builds a SQL LEN() function expression from the given Length object.

public build( \Yiisoft\Db\Expression\Function\Length $expression, array &$params = [] ): string
$expression \Yiisoft\Db\Expression\Function\Length

The expression to build.

$params array

The parameters to be bound to the query.

return string

The SQL LEN() function expression.

                public function build(ExpressionInterface $expression, array &$params = []): string
{
    return 'LEN(' . $this->buildOperand($expression->operand, $params) . ')';
}