1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of EmailChecker. |
5
|
|
|
* |
6
|
|
|
* (c) Corrado Ronci <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace sorciulus\EmailChecker; |
13
|
|
|
|
14
|
|
|
use sorciulus\EmailChecker\MxInterface; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* This class rapresents the response object from EmailChecker |
18
|
|
|
*/ |
19
|
|
|
class ResponseChecker |
20
|
|
|
{ |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Code response from SMTP Server |
24
|
|
|
* @var integer |
25
|
|
|
*/ |
26
|
|
|
private $code; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Check if email is valid |
30
|
|
|
* @var boolean |
31
|
|
|
*/ |
32
|
|
|
private $isValid; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* Check if email is disponsable |
36
|
|
|
* @var boolean |
37
|
|
|
*/ |
38
|
|
|
private $isDisponsable; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Message response from SMTP Server |
42
|
|
|
* @var string |
43
|
|
|
*/ |
44
|
|
|
private $message; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* instance of MxInterface |
48
|
|
|
* @var object |
49
|
|
|
*/ |
50
|
|
|
private $recordMx; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* List SMTP Action of Library |
54
|
|
|
* @var array |
55
|
|
|
*/ |
56
|
|
|
private $debug; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Gets the value of code. |
60
|
|
|
* |
61
|
|
|
* @return integer |
62
|
|
|
*/ |
63
|
|
|
public function getCode() |
64
|
|
|
{ |
65
|
|
|
return $this->code; |
66
|
|
|
} |
67
|
|
|
/** |
68
|
|
|
* Sets the value of code. |
69
|
|
|
* |
70
|
|
|
* @param mixed $code the code |
71
|
|
|
* |
72
|
|
|
* @return self |
73
|
|
|
*/ |
74
|
|
|
public function setCode($code) |
75
|
|
|
{ |
76
|
|
|
$this->code = $code; |
77
|
|
|
|
78
|
|
|
return $this; |
79
|
|
|
} |
80
|
|
|
/** |
81
|
|
|
* Gets the value of isValid. |
82
|
|
|
* |
83
|
|
|
* @return boolean |
84
|
|
|
*/ |
85
|
|
|
public function isValid() |
86
|
|
|
{ |
87
|
|
|
return $this->isValid; |
88
|
|
|
} |
89
|
|
|
/** |
90
|
|
|
* Sets the value of isValid. |
91
|
|
|
* |
92
|
|
|
* @param mixed $isValid the is valid |
93
|
|
|
* |
94
|
|
|
* @return self |
95
|
|
|
*/ |
96
|
|
|
public function setIsValid($isValid) |
97
|
|
|
{ |
98
|
|
|
$this->isValid = $isValid; |
99
|
|
|
|
100
|
|
|
return $this; |
101
|
|
|
} |
102
|
|
|
/** |
103
|
|
|
* Gets the Check if email is disponsable. |
104
|
|
|
* |
105
|
|
|
* @return boolean |
106
|
|
|
*/ |
107
|
|
|
public function getIsDisponsable() |
108
|
|
|
{ |
109
|
|
|
return $this->isDisponsable; |
110
|
|
|
} |
111
|
|
|
/** |
112
|
|
|
* Sets the Check if email is disponsable. |
113
|
|
|
* |
114
|
|
|
* @param boolean $isDisponsable the is disponsable |
115
|
|
|
* |
116
|
|
|
* @return self |
117
|
|
|
*/ |
118
|
|
|
public function setIsDisponsable($isDisponsable) |
119
|
|
|
{ |
120
|
|
|
$this->isDisponsable = $isDisponsable; |
121
|
|
|
|
122
|
|
|
return $this; |
123
|
|
|
} |
124
|
|
|
/** |
125
|
|
|
* Gets the value of message. |
126
|
|
|
* |
127
|
|
|
* @return string |
128
|
|
|
*/ |
129
|
|
|
public function getMessage() |
130
|
|
|
{ |
131
|
|
|
return $this->message; |
132
|
|
|
} |
133
|
|
|
/** |
134
|
|
|
* Sets the value of message. |
135
|
|
|
* |
136
|
|
|
* @param mixed $message the message |
137
|
|
|
* |
138
|
|
|
* @return self |
139
|
|
|
*/ |
140
|
|
|
public function setMessage($message) |
141
|
|
|
{ |
142
|
|
|
$this->message = $message; |
143
|
|
|
|
144
|
|
|
return $this; |
145
|
|
|
} |
146
|
|
|
/** |
147
|
|
|
* Gets the value of recordMx. |
148
|
|
|
* |
149
|
|
|
* @return MxInterface |
150
|
|
|
*/ |
151
|
|
|
public function getRecordMx() |
152
|
|
|
{ |
153
|
|
|
return $this->recordMx; |
154
|
|
|
} |
155
|
|
|
/** |
156
|
|
|
* Sets the value of recordMx. |
157
|
|
|
* |
158
|
|
|
* @param MxInterface |
159
|
|
|
* |
160
|
|
|
* @return self |
161
|
|
|
*/ |
162
|
|
|
public function setRecordMx(MxInterface $recordMx) |
163
|
|
|
{ |
164
|
|
|
$this->recordMx = $recordMx; |
165
|
|
|
|
166
|
|
|
return $this; |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
/** |
170
|
|
|
* Gets the value of debug. |
171
|
|
|
* |
172
|
|
|
* @return mixed |
173
|
|
|
*/ |
174
|
|
|
public function getDebug() |
175
|
|
|
{ |
176
|
|
|
return $this->debug; |
177
|
|
|
} |
178
|
|
|
/** |
179
|
|
|
* Sets the value of debug. |
180
|
|
|
* |
181
|
|
|
* @param mixed $debug the debug |
182
|
|
|
* |
183
|
|
|
* @return self |
184
|
|
|
*/ |
185
|
|
|
public function setDebug($debug) |
186
|
|
|
{ |
187
|
|
|
$this->debug = $debug; |
188
|
|
|
|
189
|
|
|
return $this; |
190
|
|
|
} |
191
|
|
|
} |