1: <?php
2:
3: namespace SMSApi\Api\Response;
4:
5: /**
6: * Class ContactResponse
7: * @package SMSApi\Api\Response
8: */
9: class ContactResponse extends AbstractResponse {
10:
11: const GENDER_FEMALE = "female";
12: const GENDER_MALE = "male";
13:
14: /**
15: * @var int
16: */
17: private $number;
18:
19: /**
20: * @var string
21: */
22: private $firstName;
23:
24: /**
25: * @var string
26: */
27: private $lastName;
28:
29: /**
30: * @var string
31: */
32: private $info;
33:
34: /**
35: * @var string
36: */
37: private $email;
38:
39: /**
40: * @var string
41: */
42: private $birthday;
43:
44: /**
45: * @var string
46: */
47: private $city;
48:
49: /**
50: * @var string
51: */
52: private $gender;
53:
54: /**
55: * @var int
56: */
57: private $dateAdd;
58:
59: /**
60: * @var int
61: */
62: private $dateMod;
63:
64: public function __construct( $data ) {
65:
66: if ( is_object( $data ) ) {
67: $this->obj = $data;
68: } else if ( is_string( $data ) ) {
69: parent::__construct( $data );
70: }
71:
72: if ( isset( $this->obj->number ) ) {
73: $this->number = $this->obj->number;
74: }
75:
76: if ( isset( $this->obj->first_name ) ) {
77: $this->firstName = $this->obj->first_name;
78: }
79:
80: if ( isset( $this->obj->last_name ) ) {
81: $this->lastName = $this->obj->last_name;
82: }
83:
84: if ( isset( $this->obj->info ) ) {
85: $this->info = $this->obj->info;
86: }
87:
88: if ( isset( $this->obj->birthday ) ) {
89: $this->birthday = $this->obj->birthday;
90: }
91:
92: if ( isset( $this->obj->city ) ) {
93: $this->city = $this->obj->city;
94: }
95:
96: if ( isset( $this->obj->gender ) ) {
97: $this->gender = $this->obj->gender;
98: }
99:
100: if ( isset( $this->obj->date_add ) ) {
101: $this->dateAdd = $this->obj->date_add;
102: }
103:
104: if ( isset( $this->obj->date_mod ) ) {
105: $this->dateMod = $this->obj->date_mod;
106: }
107: }
108:
109: /**
110: * Returns phone number
111: *
112: * @return int
113: */
114: public function getNumber() {
115: return $this->number;
116: }
117:
118: /**
119: * Returns contact first name
120: *
121: * @return string
122: */
123: public function getFirstName() {
124: return $this->firstName;
125: }
126:
127: /**
128: * Returns contact last name
129: *
130: * @return string
131: */
132: public function getLastName() {
133: return $this->lastName;
134: }
135:
136: /**
137: * Returns contact information text
138: *
139: * @return string
140: */
141: public function getInfo() {
142: return $this->info;
143: }
144:
145: /**
146: * Returns contact e-mail address
147: *
148: * @return string Example: example@smsapi.pl
149: */
150: public function getEmail() {
151: return $this->email;
152: }
153:
154: /**
155: * Returns contact birthday date
156: *
157: * @return string Example: 1974-1-14
158: */
159: public function getBirthday() {
160: return $this->birthday;
161: }
162:
163: /**
164: * Returns contact city name
165: *
166: * @return string
167: */
168: public function getCity() {
169: return $this->city;
170: }
171:
172: /**
173: * Returns contact gender
174: *
175: * @see \SMSApi\Api\Response\ContactResponse::GENDER_FEMALE
176: * @see \SMSApi\Api\Response\ContactResponse::GENDER_MALE
177: * @return string Example male or female
178: */
179: public function getGender() {
180: return $this->gender;
181: }
182:
183: /**
184: * Returns create date in timestamp
185: *
186: * @return int date in timestamp
187: */
188: public function getDateAdd() {
189: return $this->dateAdd;
190: }
191:
192: /**
193: * Returns modification date in timestamp
194: *
195: * @return int date in timestamp
196: */
197: public function getDateMod() {
198: return $this->dateMod;
199: }
200:
201: }
202: