|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace DJStarCOM\BookingComSDK\Models; |
|
4
|
|
|
|
|
5
|
|
|
class Autocomplete extends Model |
|
6
|
|
|
{ |
|
7
|
|
|
public const TYPE_AIRPORT = 'airport'; |
|
8
|
|
|
public const TYPE_CITY = 'city'; |
|
9
|
|
|
public const TYPE_DISTRICT = 'district'; |
|
10
|
|
|
public const TYPE_HOTEL = 'hotel'; |
|
11
|
|
|
public const TYPE_LANDMARK = 'landmark'; |
|
12
|
|
|
public const TYPE_REGION = 'region'; |
|
13
|
|
|
public const TYPE_THEME = 'theme'; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* @var string |
|
17
|
|
|
*/ |
|
18
|
|
|
protected $name; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* @var int |
|
22
|
|
|
*/ |
|
23
|
|
|
protected $nr_dest; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* @var string |
|
27
|
|
|
*/ |
|
28
|
|
|
protected $latitude; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @var array |
|
32
|
|
|
*/ |
|
33
|
|
|
protected $forecast; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @var string |
|
37
|
|
|
*/ |
|
38
|
|
|
protected $url; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @var string |
|
42
|
|
|
*/ |
|
43
|
|
|
protected $city_name; |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* @var int |
|
47
|
|
|
*/ |
|
48
|
|
|
protected $id; |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* @var array |
|
52
|
|
|
*/ |
|
53
|
|
|
protected $top_destinations; |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @var string |
|
57
|
|
|
*/ |
|
58
|
|
|
protected $country; |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @var string |
|
62
|
|
|
*/ |
|
63
|
|
|
protected $country_name; |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* @var int |
|
67
|
|
|
*/ |
|
68
|
|
|
protected $nr_hotels; |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* @var string |
|
72
|
|
|
*/ |
|
73
|
|
|
protected $timezone; |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* @var string |
|
77
|
|
|
*/ |
|
78
|
|
|
protected $longitude; |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* @var string |
|
82
|
|
|
*/ |
|
83
|
|
|
protected $label; |
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* @var array |
|
87
|
|
|
*/ |
|
88
|
|
|
protected $endorsements; |
|
89
|
|
|
|
|
90
|
|
|
/** |
|
91
|
|
|
* @var string |
|
92
|
|
|
*/ |
|
93
|
|
|
protected $city_ufi; |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* @var string |
|
97
|
|
|
*/ |
|
98
|
|
|
protected $language; |
|
99
|
|
|
|
|
100
|
|
|
/** |
|
101
|
|
|
* @var string |
|
102
|
|
|
*/ |
|
103
|
|
|
protected $type; |
|
104
|
|
|
|
|
105
|
|
|
/** |
|
106
|
|
|
* @var int |
|
107
|
|
|
*/ |
|
108
|
|
|
protected $right_to_left; |
|
109
|
|
|
|
|
110
|
|
|
/** |
|
111
|
|
|
* @var string |
|
112
|
|
|
*/ |
|
113
|
|
|
protected $region; |
|
114
|
|
|
|
|
115
|
|
|
/** |
|
116
|
|
|
* Name of this destination. |
|
117
|
|
|
*/ |
|
118
|
|
|
public function getName(): string |
|
119
|
|
|
{ |
|
120
|
|
|
return $this->name; |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
/** |
|
124
|
|
|
* Number of destinations for this theme. |
|
125
|
|
|
*/ |
|
126
|
|
|
public function getNrDest(): ?int |
|
127
|
|
|
{ |
|
128
|
|
|
return $this->nr_dest; |
|
129
|
|
|
} |
|
130
|
|
|
|
|
131
|
|
|
/** |
|
132
|
|
|
* Latitude of the point considered to be the centre of the destination. E.g. centre of the city. |
|
133
|
|
|
* @return mixed |
|
134
|
|
|
*/ |
|
135
|
|
|
public function getLatitude(): string |
|
136
|
|
|
{ |
|
137
|
|
|
return $this->latitude; |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
/** |
|
141
|
|
|
* Today's forecast for this location. |
|
142
|
|
|
* @return mixed |
|
143
|
|
|
*/ |
|
144
|
|
|
public function getForecast(): ?array |
|
145
|
|
|
{ |
|
146
|
|
|
return $this->forecast; |
|
147
|
|
|
} |
|
148
|
|
|
|
|
149
|
|
|
/** |
|
150
|
|
|
* Booking.com landing page for this destination, with added affiliate id (aid) that you may pass as |
|
151
|
|
|
* the affiliate_id=... param. |
|
152
|
|
|
* @return mixed |
|
153
|
|
|
*/ |
|
154
|
|
|
public function getUrl(): string |
|
155
|
|
|
{ |
|
156
|
|
|
return $this->url; |
|
157
|
|
|
} |
|
158
|
|
|
|
|
159
|
|
|
/** |
|
160
|
|
|
* City name for destination that is located inside a city. |
|
161
|
|
|
* @return mixed |
|
162
|
|
|
*/ |
|
163
|
|
|
public function getCityName(): string |
|
164
|
|
|
{ |
|
165
|
|
|
return $this->city_name; |
|
166
|
|
|
} |
|
167
|
|
|
|
|
168
|
|
|
/** |
|
169
|
|
|
* The id of this destination or theme. Its value is used in searches by the accompanying destination type |
|
170
|
|
|
* (just 'type' in the output). E.g. if the destination type is 'city', then this value can be used |
|
171
|
|
|
* in a city_ids=... param. |
|
172
|
|
|
* @return mixed |
|
173
|
|
|
*/ |
|
174
|
|
|
public function getId(): string |
|
175
|
|
|
{ |
|
176
|
|
|
return $this->id; |
|
177
|
|
|
} |
|
178
|
|
|
|
|
179
|
|
|
/** |
|
180
|
|
|
* Showed for destinations only. An array of destinations and themes that represent search results. |
|
181
|
|
|
*/ |
|
182
|
|
|
public function getTopDestinations(): ?array |
|
183
|
|
|
{ |
|
184
|
|
|
return $this->top_destinations; |
|
185
|
|
|
} |
|
186
|
|
|
|
|
187
|
|
|
/** |
|
188
|
|
|
* Country code of the destination. |
|
189
|
|
|
*/ |
|
190
|
|
|
public function getCountry(): string |
|
191
|
|
|
{ |
|
192
|
|
|
return $this->country; |
|
193
|
|
|
} |
|
194
|
|
|
|
|
195
|
|
|
/** |
|
196
|
|
|
* Country name for this destination. |
|
197
|
|
|
*/ |
|
198
|
|
|
public function getCountryName(): string |
|
199
|
|
|
{ |
|
200
|
|
|
return $this->country_name; |
|
201
|
|
|
} |
|
202
|
|
|
|
|
203
|
|
|
/** |
|
204
|
|
|
* Number of hotels that are open and bookable hotels for this destination. |
|
205
|
|
|
*/ |
|
206
|
|
|
public function getNrHotels(): int |
|
207
|
|
|
{ |
|
208
|
|
|
return $this->nr_hotels; |
|
209
|
|
|
} |
|
210
|
|
|
|
|
211
|
|
|
/** |
|
212
|
|
|
* Timezone of this destination. |
|
213
|
|
|
*/ |
|
214
|
|
|
public function getTimezone(): ?string |
|
215
|
|
|
{ |
|
216
|
|
|
return $this->timezone; |
|
217
|
|
|
} |
|
218
|
|
|
|
|
219
|
|
|
/** |
|
220
|
|
|
* Longitude of the point considered to be the centre of the destination. E.g. centre of the city. |
|
221
|
|
|
*/ |
|
222
|
|
|
public function getLongitude(): string |
|
223
|
|
|
{ |
|
224
|
|
|
return $this->longitude; |
|
225
|
|
|
} |
|
226
|
|
|
|
|
227
|
|
|
/** |
|
228
|
|
|
* Full location information for this destination. For themes, it is the name of this theme. |
|
229
|
|
|
*/ |
|
230
|
|
|
public function getLabel(): string |
|
231
|
|
|
{ |
|
232
|
|
|
return $this->label; |
|
233
|
|
|
} |
|
234
|
|
|
|
|
235
|
|
|
/** |
|
236
|
|
|
* Top 10 tags for which this destination is endorsed. |
|
237
|
|
|
*/ |
|
238
|
|
|
public function getEndorsements(): ?array |
|
239
|
|
|
{ |
|
240
|
|
|
return $this->endorsements; |
|
241
|
|
|
} |
|
242
|
|
|
|
|
243
|
|
|
/** |
|
244
|
|
|
* City ufi for destination that is located inside a city. |
|
245
|
|
|
* It will not be showed if the destination itself is a city. |
|
246
|
|
|
*/ |
|
247
|
|
|
public function getCityUfi(): string |
|
248
|
|
|
{ |
|
249
|
|
|
return $this->city_ufi; |
|
250
|
|
|
} |
|
251
|
|
|
|
|
252
|
|
|
/** |
|
253
|
|
|
* Language code of the returned result. |
|
254
|
|
|
*/ |
|
255
|
|
|
public function getLanguage(): string |
|
256
|
|
|
{ |
|
257
|
|
|
return $this->language; |
|
258
|
|
|
} |
|
259
|
|
|
|
|
260
|
|
|
/** |
|
261
|
|
|
* Destination type of this destination, or else the 'theme' type. |
|
262
|
|
|
* returns only: airport, city, district, hotel, landmark, region, theme |
|
263
|
|
|
*/ |
|
264
|
|
|
public function getType(): string |
|
265
|
|
|
{ |
|
266
|
|
|
return $this->type; |
|
267
|
|
|
} |
|
268
|
|
|
|
|
269
|
|
|
/** |
|
270
|
|
|
* This output fields indicates whether the search result output is right-to-left (rtl) or not. |
|
271
|
|
|
* Value 1 means that the output is right-to-left, value 0 means that it isn't. |
|
272
|
|
|
*/ |
|
273
|
|
|
public function getRightToLeft(): int |
|
274
|
|
|
{ |
|
275
|
|
|
return $this->right_to_left; |
|
276
|
|
|
} |
|
277
|
|
|
|
|
278
|
|
|
/** |
|
279
|
|
|
* Region name for destination that is located inside a region. |
|
280
|
|
|
*/ |
|
281
|
|
|
public function getRegion(): string |
|
282
|
|
|
{ |
|
283
|
|
|
return $this->region; |
|
284
|
|
|
} |
|
285
|
|
|
|
|
286
|
|
|
/** |
|
287
|
|
|
* @return array |
|
288
|
|
|
*/ |
|
289
|
|
|
protected function getAttributeMap(): array |
|
290
|
|
|
{ |
|
291
|
|
|
return [ |
|
292
|
|
|
'name' => 'string', |
|
293
|
|
|
'nr_dest' => 'integer', |
|
294
|
|
|
'latitude' => 'string', |
|
295
|
|
|
'forecast' => 'array', |
|
296
|
|
|
'url' => 'string', |
|
297
|
|
|
'city_name' => 'string', |
|
298
|
|
|
'id' => 'string', |
|
299
|
|
|
'top_destinations' => 'array', |
|
300
|
|
|
'country' => 'string', |
|
301
|
|
|
'country_name' => 'string', |
|
302
|
|
|
'nr_hotels' => 'integer', |
|
303
|
|
|
'timezone' => 'string', |
|
304
|
|
|
'longitude' => 'string', |
|
305
|
|
|
'label' => 'string', |
|
306
|
|
|
'endorsements' => 'array', |
|
307
|
|
|
'city_ufi' => 'string', |
|
308
|
|
|
'language' => 'string', |
|
309
|
|
|
'type' => 'string', |
|
310
|
|
|
'right-to-left' => 'integer', |
|
311
|
|
|
'region' => 'string', |
|
312
|
|
|
]; |
|
313
|
|
|
} |
|
314
|
|
|
} |
|
315
|
|
|
|