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