/framework/vendor/swift/lib/classes/Swift/Events/ResponseEvent.php

http://zoop.googlecode.com/ · PHP · 65 lines · 20 code · 9 blank · 36 comment · 0 complexity · 0bc7229f38bc15ad4490c961d216347c MD5 · raw file

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