1: <?php
2:
3: /*
4: * This file is part of SwiftMailer.
5: * (c) 2004-2009 Chris Corbyn
6: *
7: * For the full copyright and license information, please view the LICENSE
8: * file that was distributed with this source code.
9: */
10:
11: /**
12: * Generated when a response is received on a SMTP connection.
13: * @package Swift
14: * @subpackage Events
15: * @author Chris Corbyn
16: */
17: class Swift_Events_ResponseEvent extends Swift_Events_EventObject
18: {
19: /**
20: * The overall result.
21: * @var boolean
22: */
23: private $_valid;
24:
25: /**
26: * The response received from the server.
27: * @var string
28: */
29: private $_response;
30:
31: /**
32: * Create a new ResponseEvent for $source and $response.
33: * @param Swift_Transport $source
34: * @param string $response
35: * @param boolean $valid
36: */
37: public function __construct(Swift_Transport $source, $response, $valid = false)
38: {
39: parent::__construct($source);
40: $this->_response = $response;
41: $this->_valid = $valid;
42: }
43:
44: /**
45: * Get the response which was received from the server.
46: * @return string
47: */
48: public function getResponse()
49: {
50: return $this->_response;
51: }
52:
53: /**
54: * Get the success status of this Event.
55: * @return boolean
56: */
57: public function isValid()
58: {
59: return $this->_valid;
60: }
61:
62: }
63: