Final Class Yiisoft\Db\Oracle\Column\JsonColumn
| Inheritance | Yiisoft\Db\Oracle\Column\JsonColumn » Yiisoft\Db\Schema\Column\AbstractJsonColumn |
|---|
Represents a JSON column with eager parsing values retrieved from the database.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| phpTypecast() | Yiisoft\Db\Oracle\Column\JsonColumn |
Method Details
| public mixed phpTypecast ( mixed $value ) | ||
| $value | mixed | |
| throws | JsonException | |
|---|---|---|
public function phpTypecast(mixed $value): mixed
{
if (is_string($value)) {
return json_decode($value, true, 512, JSON_THROW_ON_ERROR);
}
if (is_resource($value)) {
/** @var string */
$value = stream_get_contents($value);
return json_decode($value, true, 512, JSON_THROW_ON_ERROR);
}
return $value;
}
Signup or Login in order to comment.