Total Complexity | 7 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
20 | class ColumnSchema extends \yii\db\ColumnSchema |
||
21 | { |
||
22 | /** |
||
23 | * {@inheritdoc} |
||
24 | */ |
||
25 | public function dbTypecast($value) |
||
26 | { |
||
27 | if ($value === null) { |
||
28 | return $value; |
||
29 | } |
||
30 | |||
31 | if ($value instanceof ExpressionInterface) { |
||
32 | return $value; |
||
33 | } |
||
34 | |||
35 | if ($this->dbType === Schema::TYPE_JSON) { |
||
36 | return new JsonExpression($value, $this->type); |
||
37 | } |
||
38 | |||
39 | return $this->typecast($value); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | public function phpTypecast($value) |
||
56 | } |
||
57 | } |
||
58 |