Total Complexity | 7 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class LTreeType extends Type |
||
11 | { |
||
12 | public const TYPE_NAME = 'ltree'; |
||
13 | public const TYPE_SEPARATE = '.'; |
||
14 | |||
15 | 1 | public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string |
|
18 | } |
||
19 | |||
20 | 3 | public function convertToPHPValue($value, AbstractPlatform $platform): ?array |
|
31 | } |
||
32 | |||
33 | 4 | public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string |
|
34 | { |
||
35 | 4 | if ($value === null) { |
|
36 | 1 | return null; |
|
37 | } |
||
38 | |||
39 | 3 | if (is_scalar($value)) { |
|
40 | 1 | $value = (array) $value; |
|
41 | } |
||
42 | |||
43 | 3 | return implode(static::TYPE_SEPARATE, $value); |
|
44 | } |
||
45 | |||
46 | 1 | public function getName(): string |
|
49 | } |
||
50 | } |
||
51 |