1 | <?php |
||
26 | final class Response implements InitializationInterface { |
||
27 | /** |
||
28 | * Response status codes |
||
29 | */ |
||
30 | const CODE_OK = 0, // the request was proceed successfully |
||
31 | CODE_INCORRECT_DATA = -1, // incorrect input data |
||
32 | CODE_AUTHENTICATION_ERROR = -2, // authentication error |
||
33 | CODE_REJECTED = -3, // request processing is rejected |
||
34 | CODE_TECHNICAL_ERROR = -4, // temporary technical error |
||
35 | CODE_LIMIT_REACHED = -5; // you have no more sms on your account |
||
36 | |||
37 | /** |
||
38 | * @var int response code |
||
39 | */ |
||
40 | private $code = 0; |
||
41 | |||
42 | /** |
||
43 | * @var string response message |
||
44 | */ |
||
45 | private $message = ''; |
||
46 | |||
47 | /** |
||
48 | * @var array message identifiers for delivery report |
||
49 | */ |
||
50 | private $messageIds = []; |
||
51 | |||
52 | /** |
||
53 | * @return int response code |
||
54 | */ |
||
55 | 1 | public function getCode() { |
|
58 | |||
59 | /** |
||
60 | * @return string message identifiers for delivery report |
||
61 | */ |
||
62 | 1 | public function getMessage() { |
|
65 | |||
66 | /** |
||
67 | * @return array message identifiers for delivery report |
||
68 | */ |
||
69 | 1 | public function getMessageIds() { |
|
72 | |||
73 | /** |
||
74 | * Method to get delivery report message id for phone |
||
75 | * @param string $phone phone number |
||
76 | * @return string message identifier |
||
77 | */ |
||
78 | 1 | public function getMessageId($phone) { |
|
81 | |||
82 | /** |
||
83 | * @inheritdoc |
||
84 | */ |
||
85 | 1 | public static function initializeByString($string) { |
|
97 | |||
98 | /** |
||
99 | * @inheritdoc |
||
100 | */ |
||
101 | 1 | public function __toString() { |
|
117 | } |
||
118 |