|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the geo-api-library package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) 2020 WEBEWEB |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace WBW\Library\GeoAPI\Model\Adresse; |
|
13
|
|
|
|
|
14
|
|
|
use WBW\Library\Core\Model\Attribute\StringLabelTrait; |
|
15
|
|
|
use WBW\Library\Core\Model\Attribute\StringNameTrait; |
|
16
|
|
|
use WBW\Library\Core\Model\Attribute\StringTypeTrait; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* Adresse. |
|
20
|
|
|
* |
|
21
|
|
|
* @author webeweb <https://github.com/webeweb/> |
|
22
|
|
|
* @package WBW\Library\GeoAPI\Model\Adresse |
|
23
|
|
|
*/ |
|
24
|
|
|
class Adresse { |
|
25
|
|
|
|
|
26
|
|
|
use StringLabelTrait; |
|
27
|
|
|
use StringNameTrait; |
|
28
|
|
|
use StringTypeTrait; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* City. |
|
32
|
|
|
* |
|
33
|
|
|
* @var string |
|
34
|
|
|
*/ |
|
35
|
|
|
private $city; |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* City code. |
|
39
|
|
|
* |
|
40
|
|
|
* @var string |
|
41
|
|
|
*/ |
|
42
|
|
|
private $cityCode; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Columns. |
|
46
|
|
|
* |
|
47
|
|
|
* @var array |
|
48
|
|
|
*/ |
|
49
|
|
|
private $columns; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* Context. |
|
53
|
|
|
* |
|
54
|
|
|
* @var string |
|
55
|
|
|
*/ |
|
56
|
|
|
private $context; |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* Distance. |
|
60
|
|
|
* |
|
61
|
|
|
* @var string |
|
62
|
|
|
*/ |
|
63
|
|
|
private $distance; |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* District. |
|
67
|
|
|
* |
|
68
|
|
|
* @var string |
|
69
|
|
|
*/ |
|
70
|
|
|
private $district; |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* House number. |
|
74
|
|
|
* |
|
75
|
|
|
* @var string |
|
76
|
|
|
*/ |
|
77
|
|
|
private $houseNumber; |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* Id. |
|
81
|
|
|
* |
|
82
|
|
|
* @var string. |
|
83
|
|
|
*/ |
|
84
|
|
|
private $id; |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* Latitude. |
|
88
|
|
|
* |
|
89
|
|
|
* @var string |
|
90
|
|
|
*/ |
|
91
|
|
|
private $latitude; |
|
92
|
|
|
|
|
93
|
|
|
/** |
|
94
|
|
|
* Longitude. |
|
95
|
|
|
* |
|
96
|
|
|
* @var string |
|
97
|
|
|
*/ |
|
98
|
|
|
private $longitude; |
|
99
|
|
|
|
|
100
|
|
|
/** |
|
101
|
|
|
* Old city. |
|
102
|
|
|
* |
|
103
|
|
|
* @var string |
|
104
|
|
|
*/ |
|
105
|
|
|
private $oldCity; |
|
106
|
|
|
|
|
107
|
|
|
/** |
|
108
|
|
|
* Old city code. |
|
109
|
|
|
* |
|
110
|
|
|
* @var string |
|
111
|
|
|
*/ |
|
112
|
|
|
private $oldCityCode; |
|
113
|
|
|
|
|
114
|
|
|
/** |
|
115
|
|
|
* Postcode. |
|
116
|
|
|
* |
|
117
|
|
|
* @var string |
|
118
|
|
|
*/ |
|
119
|
|
|
private $postcode; |
|
120
|
|
|
|
|
121
|
|
|
/** |
|
122
|
|
|
* Score. |
|
123
|
|
|
* |
|
124
|
|
|
* @var string |
|
125
|
|
|
*/ |
|
126
|
|
|
private $score; |
|
127
|
|
|
|
|
128
|
|
|
/** |
|
129
|
|
|
* Street. |
|
130
|
|
|
* |
|
131
|
|
|
* @var string |
|
132
|
|
|
*/ |
|
133
|
|
|
private $street; |
|
134
|
|
|
|
|
135
|
|
|
/** |
|
136
|
|
|
* Constructor. |
|
137
|
|
|
*/ |
|
138
|
|
|
public function __construct() { |
|
139
|
|
|
$this->setColumns([]); |
|
140
|
|
|
} |
|
141
|
|
|
|
|
142
|
|
|
/** |
|
143
|
|
|
* Add a column. |
|
144
|
|
|
* |
|
145
|
|
|
* @param string $k The key. |
|
146
|
|
|
* @param string $v The value. |
|
147
|
|
|
* @return Adresse Returns this adresse. |
|
148
|
|
|
*/ |
|
149
|
|
|
public function addColumn($k, $v) { |
|
150
|
|
|
$this->columns[$k] = $v; |
|
151
|
|
|
return $this; |
|
152
|
|
|
} |
|
153
|
|
|
|
|
154
|
|
|
/** |
|
155
|
|
|
* Get the city. |
|
156
|
|
|
* |
|
157
|
|
|
* @return string Returns the city. |
|
158
|
|
|
*/ |
|
159
|
|
|
public function getCity() { |
|
160
|
|
|
return $this->city; |
|
161
|
|
|
} |
|
162
|
|
|
|
|
163
|
|
|
/** |
|
164
|
|
|
* Get the city code. |
|
165
|
|
|
* |
|
166
|
|
|
* @return string Returns the city. |
|
167
|
|
|
*/ |
|
168
|
|
|
public function getCityCode() { |
|
169
|
|
|
return $this->cityCode; |
|
170
|
|
|
} |
|
171
|
|
|
|
|
172
|
|
|
/** |
|
173
|
|
|
* Get the columns. |
|
174
|
|
|
* |
|
175
|
|
|
* @return array Returns the columns. |
|
176
|
|
|
*/ |
|
177
|
|
|
public function getColumns() { |
|
178
|
|
|
return $this->columns; |
|
179
|
|
|
} |
|
180
|
|
|
|
|
181
|
|
|
/** |
|
182
|
|
|
* Get the context. |
|
183
|
|
|
* |
|
184
|
|
|
* @return string Returns the context. |
|
185
|
|
|
*/ |
|
186
|
|
|
public function getContext() { |
|
187
|
|
|
return $this->context; |
|
188
|
|
|
} |
|
189
|
|
|
|
|
190
|
|
|
/** |
|
191
|
|
|
* Get the distance. |
|
192
|
|
|
* |
|
193
|
|
|
* @return string Returns the distance. |
|
194
|
|
|
*/ |
|
195
|
|
|
public function getDistance() { |
|
196
|
|
|
return $this->distance; |
|
197
|
|
|
} |
|
198
|
|
|
|
|
199
|
|
|
/** |
|
200
|
|
|
* Get the district. |
|
201
|
|
|
* |
|
202
|
|
|
* @return string Returns the district. |
|
203
|
|
|
*/ |
|
204
|
|
|
public function getDistrict() { |
|
205
|
|
|
return $this->district; |
|
206
|
|
|
} |
|
207
|
|
|
|
|
208
|
|
|
/** |
|
209
|
|
|
* Get the house number. |
|
210
|
|
|
* |
|
211
|
|
|
* @return string Returns the house number. |
|
212
|
|
|
*/ |
|
213
|
|
|
public function getHouseNumber() { |
|
214
|
|
|
return $this->houseNumber; |
|
215
|
|
|
} |
|
216
|
|
|
|
|
217
|
|
|
/** |
|
218
|
|
|
* Get the id. |
|
219
|
|
|
* |
|
220
|
|
|
* @return string Returns the id. |
|
221
|
|
|
*/ |
|
222
|
|
|
public function getId() { |
|
223
|
|
|
return $this->id; |
|
224
|
|
|
} |
|
225
|
|
|
|
|
226
|
|
|
/** |
|
227
|
|
|
* Set the latitude. |
|
228
|
|
|
* |
|
229
|
|
|
* @return string Returns the latitude. |
|
230
|
|
|
*/ |
|
231
|
|
|
public function getLatitude() { |
|
232
|
|
|
return $this->latitude; |
|
233
|
|
|
} |
|
234
|
|
|
|
|
235
|
|
|
/** |
|
236
|
|
|
* Get the longitude. |
|
237
|
|
|
* |
|
238
|
|
|
* @return string Returns the longitude. |
|
239
|
|
|
*/ |
|
240
|
|
|
public function getLongitude() { |
|
241
|
|
|
return $this->longitude; |
|
242
|
|
|
} |
|
243
|
|
|
|
|
244
|
|
|
/** |
|
245
|
|
|
* Get the old city. |
|
246
|
|
|
* |
|
247
|
|
|
* @return string Returns the old city. |
|
248
|
|
|
*/ |
|
249
|
|
|
public function getOldCity() { |
|
250
|
|
|
return $this->oldCity; |
|
251
|
|
|
} |
|
252
|
|
|
|
|
253
|
|
|
/** |
|
254
|
|
|
* Get the old city code. |
|
255
|
|
|
* |
|
256
|
|
|
* @return string Returns the old city code. |
|
257
|
|
|
*/ |
|
258
|
|
|
public function getOldCityCode() { |
|
259
|
|
|
return $this->oldCityCode; |
|
260
|
|
|
} |
|
261
|
|
|
|
|
262
|
|
|
/** |
|
263
|
|
|
* Get the postcode. |
|
264
|
|
|
* |
|
265
|
|
|
* @return string Returns the postcode. |
|
266
|
|
|
*/ |
|
267
|
|
|
public function getPostcode() { |
|
268
|
|
|
return $this->postcode; |
|
269
|
|
|
} |
|
270
|
|
|
|
|
271
|
|
|
/** |
|
272
|
|
|
* Get the score. |
|
273
|
|
|
* |
|
274
|
|
|
* @return string Returns the score. |
|
275
|
|
|
*/ |
|
276
|
|
|
public function getScore() { |
|
277
|
|
|
return $this->score; |
|
278
|
|
|
} |
|
279
|
|
|
|
|
280
|
|
|
/** |
|
281
|
|
|
* Get the street. |
|
282
|
|
|
* |
|
283
|
|
|
* @return string Returns the street. |
|
284
|
|
|
*/ |
|
285
|
|
|
public function getStreet() { |
|
286
|
|
|
return $this->street; |
|
287
|
|
|
} |
|
288
|
|
|
|
|
289
|
|
|
/** |
|
290
|
|
|
* Set the city. |
|
291
|
|
|
* |
|
292
|
|
|
* @param string $city The city. |
|
293
|
|
|
* @return Adresse Returns this adresse. |
|
294
|
|
|
*/ |
|
295
|
|
|
public function setCity($city) { |
|
296
|
|
|
$this->city = $city; |
|
297
|
|
|
return $this; |
|
298
|
|
|
} |
|
299
|
|
|
|
|
300
|
|
|
/** |
|
301
|
|
|
* Set the city code. |
|
302
|
|
|
* |
|
303
|
|
|
* @param string $cityCode The city code. |
|
304
|
|
|
* @return Adresse Returns this adresse. |
|
305
|
|
|
*/ |
|
306
|
|
|
public function setCityCode($cityCode) { |
|
307
|
|
|
$this->cityCode = $cityCode; |
|
308
|
|
|
return $this; |
|
309
|
|
|
} |
|
310
|
|
|
|
|
311
|
|
|
/** |
|
312
|
|
|
* Set the columns. |
|
313
|
|
|
* |
|
314
|
|
|
* @param array $columns The columns. |
|
315
|
|
|
* @return Adresse Returns this adresse. |
|
316
|
|
|
*/ |
|
317
|
|
|
protected function setColumns(array $columns) { |
|
318
|
|
|
$this->columns = $columns; |
|
319
|
|
|
return $this; |
|
320
|
|
|
} |
|
321
|
|
|
|
|
322
|
|
|
/** |
|
323
|
|
|
* Set the context. |
|
324
|
|
|
* |
|
325
|
|
|
* @param string $context The context. |
|
326
|
|
|
* @return Adresse Returns this adresse. |
|
327
|
|
|
*/ |
|
328
|
|
|
public function setContext($context) { |
|
329
|
|
|
$this->context = $context; |
|
330
|
|
|
return $this; |
|
331
|
|
|
} |
|
332
|
|
|
|
|
333
|
|
|
/** |
|
334
|
|
|
* The distance. |
|
335
|
|
|
* |
|
336
|
|
|
* @param string $distance The distance. |
|
337
|
|
|
* @return Adresse Returns this adresse. |
|
338
|
|
|
*/ |
|
339
|
|
|
public function setDistance($distance) { |
|
340
|
|
|
$this->distance = $distance; |
|
341
|
|
|
return $this; |
|
342
|
|
|
} |
|
343
|
|
|
|
|
344
|
|
|
/** |
|
345
|
|
|
* Set the district. |
|
346
|
|
|
* |
|
347
|
|
|
* @param string $district The district. |
|
348
|
|
|
* @return Adresse Returns this adresse. |
|
349
|
|
|
*/ |
|
350
|
|
|
public function setDistrict($district) { |
|
351
|
|
|
$this->district = $district; |
|
352
|
|
|
return $this; |
|
353
|
|
|
} |
|
354
|
|
|
|
|
355
|
|
|
/** |
|
356
|
|
|
* Set the house number. |
|
357
|
|
|
* |
|
358
|
|
|
* @param string $houseNumber The house number. |
|
359
|
|
|
* @return Adresse Returns this adresse. |
|
360
|
|
|
*/ |
|
361
|
|
|
public function setHouseNumber($houseNumber) { |
|
362
|
|
|
$this->houseNumber = $houseNumber; |
|
363
|
|
|
return $this; |
|
364
|
|
|
} |
|
365
|
|
|
|
|
366
|
|
|
/** |
|
367
|
|
|
* Set the id. |
|
368
|
|
|
* |
|
369
|
|
|
* @param string $id The id. |
|
370
|
|
|
* @return Adresse Returns this adresse. |
|
371
|
|
|
*/ |
|
372
|
|
|
public function setId($id) { |
|
373
|
|
|
$this->id = $id; |
|
374
|
|
|
return $this; |
|
375
|
|
|
} |
|
376
|
|
|
|
|
377
|
|
|
/** |
|
378
|
|
|
* Set the latitude. |
|
379
|
|
|
* |
|
380
|
|
|
* @param string $latitude The latitude. |
|
381
|
|
|
* @return Adresse Returns this adresse. |
|
382
|
|
|
*/ |
|
383
|
|
|
public function setLatitude($latitude) { |
|
384
|
|
|
$this->latitude = $latitude; |
|
385
|
|
|
return $this; |
|
386
|
|
|
} |
|
387
|
|
|
|
|
388
|
|
|
/** |
|
389
|
|
|
* Set the longitude. |
|
390
|
|
|
* |
|
391
|
|
|
* @param string $longitude The longitude. |
|
392
|
|
|
* @return Adresse Returns this adresse. |
|
393
|
|
|
*/ |
|
394
|
|
|
public function setLongitude($longitude) { |
|
395
|
|
|
$this->longitude = $longitude; |
|
396
|
|
|
return $this; |
|
397
|
|
|
} |
|
398
|
|
|
|
|
399
|
|
|
/** |
|
400
|
|
|
* Set the old city. |
|
401
|
|
|
* |
|
402
|
|
|
* @param string $oldCity The old city. |
|
403
|
|
|
* @return Adresse Returns this adresse. |
|
404
|
|
|
*/ |
|
405
|
|
|
public function setOldCity($oldCity) { |
|
406
|
|
|
$this->oldCity = $oldCity; |
|
407
|
|
|
return $this; |
|
408
|
|
|
} |
|
409
|
|
|
|
|
410
|
|
|
/** |
|
411
|
|
|
* Set the old city code. |
|
412
|
|
|
* |
|
413
|
|
|
* @param string $oldCityCode The old city code. |
|
414
|
|
|
* @return Adresse Returns this adresse. |
|
415
|
|
|
*/ |
|
416
|
|
|
public function setOldCityCode($oldCityCode) { |
|
417
|
|
|
$this->oldCityCode = $oldCityCode; |
|
418
|
|
|
return $this; |
|
419
|
|
|
} |
|
420
|
|
|
|
|
421
|
|
|
/** |
|
422
|
|
|
* Set the postcode. |
|
423
|
|
|
* |
|
424
|
|
|
* @param string $postcode The postcode. |
|
425
|
|
|
* @return Adresse Returns this adresse. |
|
426
|
|
|
*/ |
|
427
|
|
|
public function setPostcode($postcode) { |
|
428
|
|
|
$this->postcode = $postcode; |
|
429
|
|
|
return $this; |
|
430
|
|
|
} |
|
431
|
|
|
|
|
432
|
|
|
/** |
|
433
|
|
|
* Set the score. |
|
434
|
|
|
* |
|
435
|
|
|
* @param string $score Teh score. |
|
436
|
|
|
* @return Adresse Returns this adresse. |
|
437
|
|
|
*/ |
|
438
|
|
|
public function setScore($score) { |
|
439
|
|
|
$this->score = $score; |
|
440
|
|
|
return $this; |
|
441
|
|
|
} |
|
442
|
|
|
|
|
443
|
|
|
/** |
|
444
|
|
|
* Set the street. |
|
445
|
|
|
* |
|
446
|
|
|
* @param string $street Teh street. |
|
447
|
|
|
* @return Adresse Returns this adresse. |
|
448
|
|
|
*/ |
|
449
|
|
|
public function setStreet($street) { |
|
450
|
|
|
$this->street = $street; |
|
451
|
|
|
return $this; |
|
452
|
|
|
} |
|
453
|
|
|
} |