Skip to content

Commit

Permalink
chore: Migrate off deprecated way of constructing EntityManager
Browse files Browse the repository at this point in the history
  • Loading branch information
acoulton committed Dec 10, 2024
1 parent d2472a7 commit 45e3834
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Dependency/DoctrineFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


use Doctrine\Common\EventManager;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Types\Type;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\EntityManager;
Expand Down Expand Up @@ -169,11 +170,9 @@ public static function buildEntityManager(
Configuration $config,
EventManager $event_manager
): EntityManager {
return EntityManager::create(
$conn->getConnection(),
$config,
$event_manager
);
$connection = DriverManager::getConnection($conn->getConnection(), $config, $event_manager);

return new EntityManager($connection, $config);
}

/**
Expand Down

0 comments on commit 45e3834

Please sign in to comment.