src/Bridge/Doctrine/DBAL/Types/AbstractCsvCollectionEnumType.php 1 location
|
@@ 19-28 (lines=10) @@
|
16 |
|
|
17 |
|
abstract class AbstractCsvCollectionEnumType extends SimpleArrayType |
18 |
|
{ |
19 |
|
public function convertToDatabaseValue($value, AbstractPlatform $platform) |
20 |
|
{ |
21 |
|
if (\is_array($value)) { |
22 |
|
return implode(',', array_unique(array_values(array_map(static function (EnumInterface $enum) { |
23 |
|
return $enum->getValue(); |
24 |
|
}, $value)))); |
25 |
|
} |
26 |
|
|
27 |
|
return parent::convertToDatabaseValue($value, $platform); |
28 |
|
} |
29 |
|
|
30 |
|
public function convertToPHPValue($value, AbstractPlatform $platform) |
31 |
|
{ |
src/Bridge/Doctrine/DBAL/Types/AbstractJsonCollectionEnumType.php 1 location
|
@@ 19-28 (lines=10) @@
|
16 |
|
|
17 |
|
abstract class AbstractJsonCollectionEnumType extends JsonType |
18 |
|
{ |
19 |
|
public function convertToDatabaseValue($value, AbstractPlatform $platform) |
20 |
|
{ |
21 |
|
if (\is_array($value)) { |
22 |
|
$value = array_unique(array_values(array_map(static function (EnumInterface $enum) { |
23 |
|
return $enum->getValue(); |
24 |
|
}, $value))); |
25 |
|
} |
26 |
|
|
27 |
|
return parent::convertToDatabaseValue($value, $platform); |
28 |
|
} |
29 |
|
|
30 |
|
public function convertToPHPValue($value, AbstractPlatform $platform) |
31 |
|
{ |