Skip to content

Commit

Permalink
Leverage DBAL's getNativeConnection() method
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Nov 27, 2021
1 parent c236dfe commit cde5ec7
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ public function get(): ?array
$this->listening = true;
}

$wrappedConnection = $this->driverConnection->getWrappedConnection();
if (!$wrappedConnection instanceof \PDO && $wrappedConnection instanceof DoctrinePdoConnection) {
$wrappedConnection = $wrappedConnection->getWrappedConnection();
if (method_exists($this->driverConnection, 'getNativeConnection')) {
$wrappedConnection = $this->driverConnection->getNativeConnection();
} else {
$wrappedConnection = $this->driverConnection->getWrappedConnection();
if (!$wrappedConnection instanceof \PDO && $wrappedConnection instanceof DoctrinePdoConnection) {
$wrappedConnection = $wrappedConnection->getWrappedConnection();
}
}

$notification = $wrappedConnection->pgsqlGetNotify(\PDO::FETCH_ASSOC, $this->configuration['get_notify_timeout']);
Expand Down

0 comments on commit cde5ec7

Please sign in to comment.