Final Class Yiisoft\Db\Expression\Value\JsonValue
| Inheritance | Yiisoft\Db\Expression\Value\JsonValue |
|---|---|
| Implements | Yiisoft\Db\Expression\ExpressionInterface |
Represents data to encode to JSON.
For example:
new JsonValue(['a' => 1, 'b' => 2]); // will be encoded to '{"a": 1, "b": 2}'
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $type | string|null | Yiisoft\Db\Expression\Value\JsonValue | |
| $value | mixed | Yiisoft\Db\Expression\Value\JsonValue |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Db\Expression\Value\JsonValue |
Property Details
Method Details
| public mixed __construct ( mixed $value, string|null $type = null ) | ||
| $value | mixed |
The JSON content. It can be represented as
|
| $type | string|null |
Type of database column, value should be cast to. Defaults to |
public function __construct(public readonly mixed $value, public readonly ?string $type = null) {}
Signup or Login in order to comment.