Skip to content

Commit

Permalink
Fixes reverse entries order when using explicit transactions (see #84
Browse files Browse the repository at this point in the history
…and #86) (#87)
  • Loading branch information
DamienHarper authored Feb 4, 2022
1 parent 3163d19 commit 84f2e42
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ public function onFlush(OnFlushEventArgs $args): void

// Initialize a new LoggerChain with the new AuditLogger + the existing SQLLoggers.
$loggerChain = new LoggerChain();
$loggerChain->addLogger($auditLogger);
if ($this->loggerBackup instanceof LoggerChain) {
foreach ($this->loggerBackup->getLoggers() as $logger) {
$loggerChain->addLogger($logger);
}
} elseif ($this->loggerBackup instanceof SQLLogger) {
$loggerChain->addLogger($this->loggerBackup);
}
$loggerChain->addLogger($auditLogger);
$entityManager->getConnection()->getConfiguration()->setSQLLogger($loggerChain);

// Populate transaction
Expand Down

0 comments on commit 84f2e42

Please sign in to comment.