fix(db): Remove usage of dropped doctrine event manager

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2024-06-28 15:55:36 +02:00
parent 6d0e8e4606
commit 76ef7dd71e
No known key found for this signature in database
GPG key ID: 74434EFE0D2E2205

View file

@ -103,8 +103,8 @@ class ConnectionFactory {
*/
public function getConnection($type, $additionalConnectionParams) {
$normalizedType = $this->normalizeType($type);
$eventManager = new EventManager();
$eventManager->addEventSubscriber(new SetTransactionIsolationLevel());
// FIXME $eventManager = new EventManager();
// FIXME $eventManager->addEventSubscriber(new SetTransactionIsolationLevel());
$additionalConnectionParams = array_merge($this->createConnectionParams(), $additionalConnectionParams);
switch ($normalizedType) {
case 'pgsql':
@ -117,7 +117,7 @@ class ConnectionFactory {
break;
case 'oci':
$eventManager->addEventSubscriber(new OracleSessionInit);
// FIXME $eventManager->addEventSubscriber(new OracleSessionInit);
// the driverOptions are unused in dbal and need to be mapped to the parameters
if (isset($additionalConnectionParams['driverOptions'])) {
$additionalConnectionParams = array_merge($additionalConnectionParams, $additionalConnectionParams['driverOptions']);
@ -138,14 +138,14 @@ class ConnectionFactory {
case 'sqlite3':
$journalMode = $additionalConnectionParams['sqlite.journal_mode'];
$additionalConnectionParams['platform'] = new OCSqlitePlatform();
$eventManager->addEventSubscriber(new SQLiteSessionInit(true, $journalMode));
// FIXME $eventManager->addEventSubscriber(new SQLiteSessionInit(true, $journalMode));
break;
}
/** @var Connection $connection */
$connection = DriverManager::getConnection(
$additionalConnectionParams,
new Configuration(),
$eventManager
// FIXME $eventManager
);
return $connection;
}