ConnectionEventArgs.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace Doctrine\DBAL\Event;
  3. use Doctrine\Common\EventArgs;
  4. use Doctrine\DBAL\Connection;
  5. use Doctrine\DBAL\Driver;
  6. use Doctrine\DBAL\Platforms\AbstractPlatform;
  7. use Doctrine\DBAL\Schema\AbstractSchemaManager;
  8. /**
  9. * Event Arguments used when a Driver connection is established inside Doctrine\DBAL\Connection.
  10. */
  11. class ConnectionEventArgs extends EventArgs
  12. {
  13. /** @var Connection */
  14. private $connection;
  15. public function __construct(Connection $connection)
  16. {
  17. $this->connection = $connection;
  18. }
  19. /**
  20. * @return Connection
  21. */
  22. public function getConnection()
  23. {
  24. return $this->connection;
  25. }
  26. /**
  27. * @return Driver
  28. */
  29. public function getDriver()
  30. {
  31. return $this->connection->getDriver();
  32. }
  33. /**
  34. * @return AbstractPlatform
  35. */
  36. public function getDatabasePlatform()
  37. {
  38. return $this->connection->getDatabasePlatform();
  39. }
  40. /**
  41. * @return AbstractSchemaManager
  42. */
  43. public function getSchemaManager()
  44. {
  45. return $this->connection->getSchemaManager();
  46. }
  47. }