TransportExceptionEvent.php 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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, Swift_TransportException $ex)
  28. {
  29. parent::__construct($transport);
  30. $this->_exception = $ex;
  31. }
  32. /**
  33. * Get the TransportException thrown.
  34. * @return Swift_TransportException
  35. */
  36. public function getException()
  37. {
  38. return $this->_exception;
  39. }
  40. }