Final Class Yiisoft\Db\Expression\Function\Builder\LengthBuilder
| Inheritance | Yiisoft\Db\Expression\Function\Builder\LengthBuilder |
|---|---|
| Implements | Yiisoft\Db\Expression\ExpressionBuilderInterface |
Builds SQL LENGTH() function expressions for {@see Length} objects.
Public 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
| public mixed __construct ( Yiisoft\Db\QueryBuilder\QueryBuilderInterface $queryBuilder ) | ||
| $queryBuilder | Yiisoft\Db\QueryBuilder\QueryBuilderInterface | |
public function __construct(private readonly QueryBuilderInterface $queryBuilder) {}
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 |
|---|---|---|
public function build(ExpressionInterface $expression, array &$params = []): string
{
return 'LENGTH(' . $this->buildOperand($expression->operand, $params) . ')';
}
Signup or Login in order to comment.