Total Complexity | 7 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 80% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class CHFType extends IntegerType |
||
12 | { |
||
13 | public function getName() |
||
14 | { |
||
15 | return 'CHF'; |
||
16 | } |
||
17 | |||
18 | 2 | public function convertToPHPValue($value, AbstractPlatform $platform) |
|
27 | } |
||
28 | |||
29 | 2 | public function convertToDatabaseValue($value, AbstractPlatform $platform) |
|
30 | { |
||
31 | 2 | if ($value instanceof Money) { |
|
32 | return $value->getAmount(); |
||
33 | } |
||
34 | |||
35 | 2 | if ($value === null) { |
|
36 | 1 | return $value; |
|
37 | } |
||
38 | |||
39 | 1 | throw new \InvalidArgumentException('Cannot convert to dababase value: ' . var_export($value, true)); |
|
40 | } |
||
41 | |||
42 | 1 | public function requiresSQLCommentHint(AbstractPlatform $platform) |
|
45 | } |
||
46 | } |
||
47 |