1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace DJStarCOM\BookingComSDK\Models; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* @package DJStarCOM\BookingComSDK\Models |
7
|
|
|
*/ |
8
|
|
|
class BlockAvailability extends Model |
9
|
|
|
{ |
10
|
|
|
const EXTRA_ALL_PRICES = 'all_prices'; |
11
|
|
|
const EXTRA_GROUP_RECOMMENDATIONS = 'group_recommendations'; |
12
|
|
|
const EXTRA_FACILITIES = 'facilities'; |
13
|
|
|
const EXTRA_NUMBER_OF_ROOMS_LEFT = 'number_of_rooms_left'; |
14
|
|
|
const EXTRA_JUST_BOOKED = 'just_booked'; |
15
|
|
|
const EXTRA_PAYMENT_TERMS = 'payment_terms'; |
16
|
|
|
const EXTRA_INTERNET = 'internet'; |
17
|
|
|
const EXTRA_EXTRA_CHARGES = 'extra_charges'; |
18
|
|
|
const EXTRA_ADDRESS_REQUIRED = 'address_required'; |
19
|
|
|
const EXTRA_ALL_EXTRA_CHARGES = 'all_extra_charges'; |
20
|
|
|
const EXTRA_ADDONS = 'addons'; |
21
|
|
|
const EXTRA_MAX_CHILDREN_FREE_AGE = 'max_children_free_age'; |
22
|
|
|
const EXTRA_POLICIES = 'policies'; |
23
|
|
|
const EXTRA_CANCELLATION_INFO = 'cancellation_info'; |
24
|
|
|
const EXTRA_DEAL_LASTM = 'deal_lastm'; |
25
|
|
|
const EXTRA_ADDITIONAL_ROOM_INFO = 'additional_room_info'; |
26
|
|
|
const EXTRA_MAX_ROOMS_IN_RESERVATION = 'max_rooms_in_reservation'; |
27
|
|
|
const EXTRA_MAX_CHILDREN_FREE = 'max_children_free'; |
28
|
|
|
const EXTRA_MEALPLANS = 'mealplans'; |
29
|
|
|
const EXTRA_IF_DOMESTIC_NO_CC = 'if_domestic_no_cc'; |
30
|
|
|
const EXTRA_CC_REQUIRED = 'cc_required'; |
31
|
|
|
const EXTRA_ADDON_TYPE = 'addon_type'; |
32
|
|
|
const EXTRA_EXTRA_BEDS = 'extra_beds'; |
33
|
|
|
const EXTRA_IF_NO_CC_ALLOWED = 'if_no_cc_allowed'; |
34
|
|
|
const EXTRA_RACK_RATES = 'rack_rates'; |
35
|
|
|
const EXTRA_IMPORTANT_INFORMATION = 'important_information'; |
36
|
|
|
const EXTRA_NET_PRICE = 'net_price'; |
37
|
|
|
const EXTRA_ROOM_TYPE_ID = 'room_type_id'; |
38
|
|
|
const EXTRA_DEAL_FLASH = 'deal_flash'; |
39
|
|
|
const EXTRA_PHOTOS = 'photos'; |
40
|
|
|
const EXTRA_POSTCARD_PHOTO = 'postcard_photo'; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var string |
44
|
|
|
*/ |
45
|
|
|
protected $hotel_id; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var string |
49
|
|
|
*/ |
50
|
|
|
protected $checkin; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @var string |
54
|
|
|
*/ |
55
|
|
|
protected $checkout; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var array |
59
|
|
|
*/ |
60
|
|
|
protected $block; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @var array |
64
|
|
|
*/ |
65
|
|
|
protected $policies; |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @var string |
69
|
|
|
*/ |
70
|
|
|
protected $important_information; |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @var string |
74
|
|
|
*/ |
75
|
|
|
protected $hotel_url; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @var int |
79
|
|
|
*/ |
80
|
|
|
protected $max_rooms_in_reservation; |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @var bool |
84
|
|
|
*/ |
85
|
|
|
protected $address_required; |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @var bool |
89
|
|
|
*/ |
90
|
|
|
protected $qualifies_for_no_cc_reservation; |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @var bool |
94
|
|
|
*/ |
95
|
|
|
protected $domestic_no_cc; |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @var string |
99
|
|
|
*/ |
100
|
|
|
protected $license_number; |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @var bool |
104
|
|
|
*/ |
105
|
|
|
protected $cc_required; |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @var bool |
109
|
|
|
*/ |
110
|
|
|
protected $is_flash_deal; |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @var bool |
114
|
|
|
*/ |
115
|
|
|
protected $cvc_required; |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @var array |
119
|
|
|
*/ |
120
|
|
|
private $incremental_price; |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* Booking.com hotel ID. The unique identifier of this hotel. |
124
|
|
|
* @return int |
125
|
|
|
*/ |
126
|
|
|
public function getHotelId(): int |
127
|
|
|
{ |
128
|
|
|
return $this->hotel_id; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* The date that was searched for as checkin. Format: YYYY-MM-DD |
133
|
|
|
* @return string |
134
|
|
|
*/ |
135
|
|
|
public function getCheckin(): string |
136
|
|
|
{ |
137
|
|
|
return $this->checkin; |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
/** |
141
|
|
|
* The date that was searched for as checkout. Format: YYYY-MM-DD |
142
|
|
|
* @return string |
143
|
|
|
*/ |
144
|
|
|
public function getCheckout(): string |
145
|
|
|
{ |
146
|
|
|
return $this->checkout; |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* The object containing all the relevant information for the combination of room, policy, |
151
|
|
|
* meal and occupancy that determines the price. A block is the unique entity you book with booking.com. |
152
|
|
|
* @return array |
153
|
|
|
*/ |
154
|
|
|
public function getBlock(): array |
155
|
|
|
{ |
156
|
|
|
return $this->block; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* The rules governing the booking and requirements of this block. |
161
|
|
|
* @return array |
162
|
|
|
*/ |
163
|
|
|
public function getPolicies(): array |
164
|
|
|
{ |
165
|
|
|
return $this->policies; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* Additional important hotel information. |
170
|
|
|
* @return string |
171
|
|
|
*/ |
172
|
|
|
public function getImportantInformation(): ?string |
173
|
|
|
{ |
174
|
|
|
return $this->important_information; |
175
|
|
|
} |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* URL of the hotel's page on Booking.com. |
179
|
|
|
* @return string |
180
|
|
|
*/ |
181
|
|
|
public function getHotelUrl(): ?string |
182
|
|
|
{ |
183
|
|
|
return $this->hotel_url; |
184
|
|
|
} |
185
|
|
|
|
186
|
|
|
/** |
187
|
|
|
* Maximum number of rooms this property allows in one booking. Zero means: unlimited. |
188
|
|
|
* @return int |
189
|
|
|
*/ |
190
|
|
|
public function getMaxRoomsInReservation(): ?int |
191
|
|
|
{ |
192
|
|
|
return $this->max_rooms_in_reservation; |
193
|
|
|
} |
194
|
|
|
|
195
|
|
|
/** |
196
|
|
|
* Boolean value set to "true" if address is required or "false" if it is not required. |
197
|
|
|
* @return bool |
198
|
|
|
*/ |
199
|
|
|
public function getAddressRequired(): ?bool |
200
|
|
|
{ |
201
|
|
|
return $this->address_required; |
202
|
|
|
} |
203
|
|
|
|
204
|
|
|
/** |
205
|
|
|
* Boolean value set to "true" if the hotel qualifies for no credit card reservation or "false" if it is not. |
206
|
|
|
* @return bool |
207
|
|
|
*/ |
208
|
|
|
public function getQualifiesForNoCcReservation(): ?bool |
209
|
|
|
{ |
210
|
|
|
return $this->qualifies_for_no_cc_reservation; |
211
|
|
|
} |
212
|
|
|
|
213
|
|
|
/** |
214
|
|
|
* This value tells if the hotel is bookable without credit card details for domestic bookers. |
215
|
|
|
* It is showed when the 'if_domestic_no_cc=1' param is used in your request. |
216
|
|
|
* In order to this value to be accurate, the API call must be aware of the guest's country. |
217
|
|
|
* You can pass the guest's country code via the param 'guest_cc', |
218
|
|
|
* or as well attempt to use 'guest_ip' if you don't have guest country, but you have their IP address. |
219
|
|
|
* Though, the IP address may be unresolvable to a country code, |
220
|
|
|
* or it may as well be that the guest accesses your website through a proxy, |
221
|
|
|
* which originates from a different country than the guest's original IP address. |
222
|
|
|
* @return bool |
223
|
|
|
*/ |
224
|
|
|
public function getDomesticNoCc(): ?bool |
225
|
|
|
{ |
226
|
|
|
return $this->domestic_no_cc; |
227
|
|
|
} |
228
|
|
|
|
229
|
|
|
/** |
230
|
|
|
* Shows licence information of the hotel. |
231
|
|
|
* @return string |
232
|
|
|
*/ |
233
|
|
|
public function getLicenseNumber(): ?string |
234
|
|
|
{ |
235
|
|
|
return $this->license_number; |
236
|
|
|
} |
237
|
|
|
|
238
|
|
|
/** |
239
|
|
|
* Boolean value set to "true" credit card is required for reservation or "false" if it is not required. |
240
|
|
|
* @return bool |
241
|
|
|
*/ |
242
|
|
|
public function getCcRequired(): ?bool |
243
|
|
|
{ |
244
|
|
|
return $this->cc_required; |
245
|
|
|
} |
246
|
|
|
|
247
|
|
|
/** |
248
|
|
|
* Boolean value set to "true" for a flash deal or "false" if not a flash deal. |
249
|
|
|
* @return bool |
250
|
|
|
*/ |
251
|
|
|
public function getIsFlashDeal(): ?bool |
252
|
|
|
{ |
253
|
|
|
return $this->is_flash_deal; |
254
|
|
|
} |
255
|
|
|
|
256
|
|
|
/** |
257
|
|
|
* Boolean value set to "true" CVC of a credit card is required for reservation or "false" if it is not required. |
258
|
|
|
* @return bool |
259
|
|
|
*/ |
260
|
|
|
public function getCvcRequired(): ?bool |
261
|
|
|
{ |
262
|
|
|
return $this->cvc_required; |
263
|
|
|
} |
264
|
|
|
|
265
|
|
|
/** |
266
|
|
|
* |
267
|
|
|
* @return mixed |
268
|
|
|
*/ |
269
|
|
|
public function getIncrementalPrice(): array |
270
|
|
|
{ |
271
|
|
|
return $this->incremental_price; |
272
|
|
|
} |
273
|
|
|
|
274
|
|
|
/** |
275
|
|
|
* @return array |
276
|
|
|
*/ |
277
|
|
|
protected function getAttributeMap(): array |
278
|
|
|
{ |
279
|
|
|
return [ |
280
|
|
|
'hotel_id' => 'string', |
281
|
|
|
'checkin' => 'string', |
282
|
|
|
'checkout' => 'string', |
283
|
|
|
'block' => 'array', |
284
|
|
|
'policies' => 'array', |
285
|
|
|
'important_information' => 'string', |
286
|
|
|
'hotel_url' => 'string', |
287
|
|
|
'max_rooms_in_reservation' => 'integer', |
288
|
|
|
'address_required' => 'boolean', |
289
|
|
|
'qualifies_for_no_cc_reservation' => 'boolean', |
290
|
|
|
'domestic_no_cc' => 'boolean', |
291
|
|
|
'license_number' => 'string', |
292
|
|
|
'cc_required' => 'boolean', |
293
|
|
|
'is_flash_deal' => 'boolean', |
294
|
|
|
'cvc_required' => 'boolean', |
295
|
|
|
'incremental_price' => 'array', |
296
|
|
|
]; |
297
|
|
|
} |
298
|
|
|
} |
299
|
|
|
|