mailpoet
/
vendor-prefixed
/
doctrine
/
dbal
/
src
/
Driver
/
Middleware
/
AbstractDriverMiddleware.php
AbstractConnectionMiddleware.php
2 years ago
AbstractDriverMiddleware.php
2 years ago
AbstractResultMiddleware.php
2 years ago
AbstractStatementMiddleware.php
2 years ago
index.php
2 years ago
AbstractDriverMiddleware.php
43 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Doctrine\DBAL\Driver\Middleware; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | use MailPoetVendor\Doctrine\DBAL\Connection; |
| 5 | use MailPoetVendor\Doctrine\DBAL\Driver; |
| 6 | use MailPoetVendor\Doctrine\DBAL\Driver\API\ExceptionConverter; |
| 7 | use MailPoetVendor\Doctrine\DBAL\Platforms\AbstractPlatform; |
| 8 | use MailPoetVendor\Doctrine\DBAL\VersionAwarePlatformDriver; |
| 9 | use MailPoetVendor\Doctrine\Deprecations\Deprecation; |
| 10 | use MailPoetVendor\SensitiveParameter; |
| 11 | abstract class AbstractDriverMiddleware implements VersionAwarePlatformDriver |
| 12 | { |
| 13 | private Driver $wrappedDriver; |
| 14 | public function __construct(Driver $wrappedDriver) |
| 15 | { |
| 16 | $this->wrappedDriver = $wrappedDriver; |
| 17 | } |
| 18 | public function connect( array $params) |
| 19 | { |
| 20 | return $this->wrappedDriver->connect($params); |
| 21 | } |
| 22 | public function getDatabasePlatform() |
| 23 | { |
| 24 | return $this->wrappedDriver->getDatabasePlatform(); |
| 25 | } |
| 26 | public function getSchemaManager(Connection $conn, AbstractPlatform $platform) |
| 27 | { |
| 28 | Deprecation::triggerIfCalledFromOutside('doctrine/dbal', 'https://github.com/doctrine/dbal/pull/5458', 'AbstractDriverMiddleware::getSchemaManager() is deprecated.' . ' Use AbstractPlatform::createSchemaManager() instead.'); |
| 29 | return $this->wrappedDriver->getSchemaManager($conn, $platform); |
| 30 | } |
| 31 | public function getExceptionConverter() : ExceptionConverter |
| 32 | { |
| 33 | return $this->wrappedDriver->getExceptionConverter(); |
| 34 | } |
| 35 | public function createDatabasePlatformForVersion($version) |
| 36 | { |
| 37 | if ($this->wrappedDriver instanceof VersionAwarePlatformDriver) { |
| 38 | return $this->wrappedDriver->createDatabasePlatformForVersion($version); |
| 39 | } |
| 40 | return $this->wrappedDriver->getDatabasePlatform(); |
| 41 | } |
| 42 | } |
| 43 |