AbstractDB2Driver.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace Doctrine\DBAL\Driver;
  3. use Doctrine\DBAL\Connection;
  4. use Doctrine\DBAL\Driver;
  5. use Doctrine\DBAL\Driver\DriverException as TheDriverException;
  6. use Doctrine\DBAL\Exception\DriverException;
  7. use Doctrine\DBAL\Platforms\DB2Platform;
  8. use Doctrine\DBAL\Schema\DB2SchemaManager;
  9. /**
  10. * Abstract base implementation of the {@link Driver} interface for IBM DB2 based drivers.
  11. */
  12. abstract class AbstractDB2Driver implements Driver
  13. {
  14. /**
  15. * {@inheritdoc}
  16. *
  17. * @deprecated Use Connection::getDatabase() instead.
  18. */
  19. public function getDatabase(Connection $conn)
  20. {
  21. $params = $conn->getParams();
  22. return $params['dbname'];
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function getDatabasePlatform()
  28. {
  29. return new DB2Platform();
  30. }
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function getSchemaManager(Connection $conn)
  35. {
  36. return new DB2SchemaManager($conn);
  37. }
  38. /**
  39. * @param string $message
  40. *
  41. * @return DriverException
  42. */
  43. public function convertException($message, TheDriverException $exception)
  44. {
  45. return new DriverException($message, $exception);
  46. }
  47. }