TransportExceptionEvent.php 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /*
  3. * This file is part of SwiftMailer.
  4. * (c) 2004-2009 Chris Corbyn
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. /**
  10. * Generated when a TransportException is thrown from the Transport system.
  11. * @package Swift
  12. * @subpackage Events
  13. * @author Chris Corbyn
  14. */
  15. class Swift_Events_TransportExceptionEvent extends Swift_Events_EventObject
  16. {
  17. /**
  18. * The Exception thrown.
  19. * @var Swift_TransportException
  20. */
  21. private $_exception;
  22. /**
  23. * Create a new TransportExceptionEvent for $transport.
  24. * @param Swift_Transport $transport
  25. * @param Swift_TransportException $ex
  26. */
  27. public function __construct(Swift_Transport $transport,
  28. Swift_TransportException $ex)
  29. {
  30. parent::__construct($transport);
  31. $this->_exception = $ex;
  32. }
  33. /**
  34. * Get the TransportException thrown.
  35. * @return Swift_TransportException
  36. */
  37. public function getException()
  38. {
  39. return $this->_exception;
  40. }
  41. }