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