Files
piratepoet/mailpoet/lib/Doctrine/Middlewares/PostConnectMiddleware.php
Rostislav Wolny 9f32c59e49 Use DBAL Driver middleware to handle the correct connection timezone
I looked into using DBAL events for this but found that DBAL events
are deprecated so I went with middleware as they are recommended
as a replacement for the DBAL events.
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00

15 lines
449 B
PHP

<?php declare(strict_types = 1);
namespace MailPoet\Doctrine\Middlewares;
use MailPoetVendor\Doctrine\DBAL\Driver\Connection;
use MailPoetVendor\Doctrine\DBAL\Driver\Middleware\AbstractDriverMiddleware;
class PostConnectMiddleware extends AbstractDriverMiddleware {
public function connect(array $params): Connection {
$connection = parent::connect($params);
$connection->exec('SET time_zone = "+00:00"');
return $connection;
}
}