DB2Driver.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace Doctrine\DBAL\Driver\IBMDB2;
  3. use Doctrine\DBAL\Driver\AbstractDB2Driver;
  4. use Doctrine\Deprecations\Deprecation;
  5. /**
  6. * IBM DB2 Driver.
  7. *
  8. * @deprecated Use {@link Driver} instead
  9. */
  10. class DB2Driver extends AbstractDB2Driver
  11. {
  12. /**
  13. * {@inheritdoc}
  14. */
  15. public function connect(array $params, $username = null, $password = null, array $driverOptions = [])
  16. {
  17. $params['user'] = $username;
  18. $params['password'] = $password;
  19. $params['dbname'] = DataSourceName::fromConnectionParameters($params)->toString();
  20. return new Connection(
  21. $params,
  22. (string) $username,
  23. (string) $password,
  24. $driverOptions
  25. );
  26. }
  27. /**
  28. * {@inheritdoc}
  29. *
  30. * @deprecated
  31. */
  32. public function getName()
  33. {
  34. Deprecation::trigger(
  35. 'doctrine/dbal',
  36. 'https://github.com/doctrine/dbal/issues/3580',
  37. 'Driver::getName() is deprecated'
  38. );
  39. return 'ibm_db2';
  40. }
  41. }