ResponseEvent.php 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 response is received on a SMTP connection.
  11. * @package Swift
  12. * @subpackage Events
  13. * @author Chris Corbyn
  14. */
  15. class Swift_Events_ResponseEvent extends Swift_Events_EventObject
  16. {
  17. /**
  18. * The overall result.
  19. * @var boolean
  20. */
  21. private $_valid;
  22. /**
  23. * The response received from the server.
  24. * @var string
  25. */
  26. private $_response;
  27. /**
  28. * Create a new ResponseEvent for $source and $response.
  29. * @param Swift_Transport $source
  30. * @param string $response
  31. * @param boolean $valid
  32. */
  33. public function __construct(Swift_Transport $source, $response, $valid = false)
  34. {
  35. parent::__construct($source);
  36. $this->_response = $response;
  37. $this->_valid = $valid;
  38. }
  39. /**
  40. * Get the response which was received from the server.
  41. * @return string
  42. */
  43. public function getResponse()
  44. {
  45. return $this->_response;
  46. }
  47. /**
  48. * Get the success status of this Event.
  49. * @return boolean
  50. */
  51. public function isValid()
  52. {
  53. return $this->_valid;
  54. }
  55. }