* @since 2.0.14.1 */ class ColumnSchema extends \yii\db\ColumnSchema { /** * {@inheritdoc} */ public function dbTypecast($value) { if ($value === null) { return $value; } if ($value instanceof ExpressionInterface) { return $value; } if ($this->dbType === Schema::TYPE_JSON) { return new JsonExpression($value, $this->type); } return $this->typecast($value); } /** * {@inheritdoc} */ public function phpTypecast($value) { if ($value === null) { return null; } if ($this->type === Schema::TYPE_JSON) { return json_decode($value, true); } return parent::phpTypecast($value); } }