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]
15 lines
449 B
PHP
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;
|
|
}
|
|
}
|