Skip to content

Commit 6a77717

Browse files
committed
Add automatic enum type registration
1 parent c730293 commit 6a77717

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/DBAL/DriverWrapper/PostgreSQLDriverWrapper.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
use Doctrine\DBAL\Driver\Connection as DriverConnection;
1111
use Doctrine\DBAL\Platforms\AbstractPlatform;
1212
use Doctrine\DBAL\Schema\AbstractSchemaManager;
13+
use Doctrine\DBAL\Types\Type;
1314
use Doctrine\DBAL\VersionAwarePlatformDriver;
1415
use Pfilsx\PostgreSQLDoctrine\DBAL\Platform\PostgreSQLPlatform;
1516
use Pfilsx\PostgreSQLDoctrine\DBAL\Schema\PostgreSQLSchemaManager;
17+
use Pfilsx\PostgreSQLDoctrine\DBAL\Type\EnumType;
1618

1719
final class PostgreSQLDriverWrapper implements VersionAwarePlatformDriver
1820
{
@@ -21,6 +23,9 @@ final class PostgreSQLDriverWrapper implements VersionAwarePlatformDriver
2123
public function __construct(Driver $innerDriver)
2224
{
2325
$this->innerDriver = $innerDriver;
26+
if (!Type::hasType(EnumType::NAME)) {
27+
Type::addType(EnumType::NAME, EnumType::class);
28+
}
2429
}
2530

2631

0 commit comments

Comments
 (0)