1 | <?php |
||
17 | final class Response |
||
18 | { |
||
19 | private $_isValid; |
||
20 | private $_error; |
||
21 | |||
22 | /** |
||
23 | * Construct a new Response with a valid flag and error message. |
||
24 | * |
||
25 | * @param boolean $isValid represents if the response received was valid |
||
26 | * @param string $error the error message if the response is not valid |
||
27 | */ |
||
28 | public function __construct($isValid = false, $error = null) |
||
33 | |||
34 | /** |
||
35 | * Return if the request was valid. |
||
36 | * |
||
37 | * @return boolean |
||
38 | */ |
||
39 | public function valid() |
||
43 | |||
44 | /** |
||
45 | * Return the error message, if one is set. |
||
46 | * |
||
47 | * @return string|null |
||
48 | */ |
||
49 | public function getMessage() |
||
53 | } |
||
54 |