0 follower

Final Class Yiisoft\Db\Expression\Function\Builder\LengthBuilder

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

Builds SQL LENGTH() function expressions for {@see Length} objects.

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Yiisoft\Db\Expression\Function\Builder\LengthBuilder
build() Builds a SQL LENGTH() function expression from the given {@see Length} object. Yiisoft\Db\Expression\Function\Builder\LengthBuilder

Method Details

Hide inherited methods

__construct() public method

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

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

            
build() public method

Builds a SQL LENGTH() function expression from the given {@see Length} object.

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

The expression to build.

$params array

The parameters to be bound to the query.

return string

The SQL LENGTH() function expression.

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