Final Class Yiisoft\Db\Expression\Value\StructuredValue
| Inheritance | Yiisoft\Db\Expression\Value\StructuredValue |
|---|---|
| Implements | Yiisoft\Db\Expression\ExpressionInterface |
Represents a structured type SQL expression.
See also https://en.wikipedia.org/wiki/Structured_type For example:
`php
new StructuredValue(['price' => 10, 'currency_code' => 'USD']);
`
Will be encoded to ROW(10, USD) in PostgreSQL.
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $type | Yiisoft\Db\Schema\Column\AbstractStructuredColumn|string|null | Yiisoft\Db\Expression\Value\StructuredValue | |
| $value | array|object|string|null | Yiisoft\Db\Expression\Value\StructuredValue |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Db\Expression\Value\StructuredValue |
Property Details
Method Details
| public mixed __construct ( array|object|string|null $value, Yiisoft\Db\Schema\Column\AbstractStructuredColumn|string|null $type = null ) | ||
| $value | array|object|string|null |
The content of the structured type which can be represented as
|
| $type | Yiisoft\Db\Schema\Column\AbstractStructuredColumn|string|null |
The structured column type which can be represented as
The column type is used to typecast structured values before saving into the database and for adding type hint to the SQL statement. If the type isn't specified and DBMS can't guess it from the context, SQL error will be raised. |
public function __construct(
public readonly array|object|string|null $value,
public readonly AbstractStructuredColumn|string|null $type = null,
) {}
Signup or Login in order to comment.