vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php line 26

Open in your IDE?
  1. <?php
  2. namespace Doctrine\DBAL\Driver\Middleware;
  3. use Doctrine\DBAL\Connection;
  4. use Doctrine\DBAL\Driver;
  5. use Doctrine\DBAL\Driver\API\ExceptionConverter;
  6. use Doctrine\DBAL\Platforms\AbstractPlatform;
  7. use Doctrine\DBAL\VersionAwarePlatformDriver;
  8. use Doctrine\Deprecations\Deprecation;
  9. abstract class AbstractDriverMiddleware implements VersionAwarePlatformDriver
  10. {
  11.     private Driver $wrappedDriver;
  12.     public function __construct(Driver $wrappedDriver)
  13.     {
  14.         $this->wrappedDriver $wrappedDriver;
  15.     }
  16.     /**
  17.      * {@inheritdoc}
  18.      */
  19.     public function connect(array $params)
  20.     {
  21.         return $this->wrappedDriver->connect($params);
  22.     }
  23.     /**
  24.      * {@inheritdoc}
  25.      */
  26.     public function getDatabasePlatform()
  27.     {
  28.         return $this->wrappedDriver->getDatabasePlatform();
  29.     }
  30.     /**
  31.      * {@inheritdoc}
  32.      *
  33.      * @deprecated Use {@link AbstractPlatform::createSchemaManager()} instead.
  34.      */
  35.     public function getSchemaManager(Connection $connAbstractPlatform $platform)
  36.     {
  37.         Deprecation::triggerIfCalledFromOutside(
  38.             'doctrine/dbal',
  39.             'https://github.com/doctrine/dbal/pull/5458',
  40.             'AbstractDriverMiddleware::getSchemaManager() is deprecated.'
  41.                 ' Use AbstractPlatform::createSchemaManager() instead.',
  42.         );
  43.         return $this->wrappedDriver->getSchemaManager($conn$platform);
  44.     }
  45.     public function getExceptionConverter(): ExceptionConverter
  46.     {
  47.         return $this->wrappedDriver->getExceptionConverter();
  48.     }
  49.     /**
  50.      * {@inheritdoc}
  51.      */
  52.     public function createDatabasePlatformForVersion($version)
  53.     {
  54.         if ($this->wrappedDriver instanceof VersionAwarePlatformDriver) {
  55.             return $this->wrappedDriver->createDatabasePlatformForVersion($version);
  56.         }
  57.         return $this->wrappedDriver->getDatabasePlatform();
  58.     }
  59. }