Final Class Yiisoft\Db\Expression\Function\Length
| Inheritance | Yiisoft\Db\Expression\Function\Length |
|---|---|
| Implements | Yiisoft\Db\Expression\ExpressionInterface |
Represents a SQL LENGTH() function that returns the length of string represented as an expression.
Example usage:
$length = new Length('column_name');
LENGTH("column_name")
See also Yiisoft\Db\Expression\Function\Builder\LengthBuilder for building SQL representations of this function expression.
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $operand | string|Yiisoft\Db\Expression\ExpressionInterface | Yiisoft\Db\Expression\Function\Length |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Db\Expression\Function\Length |
Property Details
Method Details
| public mixed __construct ( Yiisoft\Db\Expression\ExpressionInterface|string $operand ) | ||
| $operand | Yiisoft\Db\Expression\ExpressionInterface|string |
The expression for which to calculate the length.
String values will be treated as column names, except when they contain a parentheses |
public function __construct(
public readonly string|ExpressionInterface $operand,
) {}
Signup or Login in order to comment.