1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Copyright (c) 2019 - present |
4
|
|
|
* Google Maps PHP - PlacesResultt.php |
5
|
|
|
* author: Roberto Belotti - [email protected] |
6
|
|
|
* web : robertobelotti.com, github.com/biscolab |
7
|
|
|
* Initial version created on: 1/8/2019 |
8
|
|
|
* MIT license: https://github.com/biscolab/google-maps-php/blob/master/LICENSE |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace Biscolab\GoogleMaps\Http\Result; |
12
|
|
|
|
13
|
|
|
use Biscolab\GoogleMaps\Fields\GoogleMapsResultFields; |
14
|
|
|
use Biscolab\GoogleMaps\Http\GoogleMapsResult; |
15
|
|
|
use Biscolab\GoogleMaps\Object\Geometry; |
16
|
|
|
use Biscolab\GoogleMaps\Object\PhotoCollection; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Class PlacesResult |
20
|
|
|
* |
21
|
|
|
* @method PhotoCollection getPhotos() |
22
|
|
|
* @method Geometry getGeometry() |
23
|
|
|
* @method string getFormattedAddress() |
24
|
|
|
* @method string getName() |
25
|
|
|
* @method string getIcon() |
26
|
|
|
* @method string getId() |
27
|
|
|
* @method string getPlaceId() |
28
|
|
|
* @method string getReference() |
29
|
|
|
* @method string getVicinity() |
30
|
|
|
* @method array getTypes() |
31
|
|
|
* @method array getOpeningHours() |
32
|
|
|
* @method int getPriceLevel() |
33
|
|
|
* @method float getRating() |
34
|
|
|
* @method array getPlusCode() |
35
|
|
|
* @since 0.5.0 |
36
|
|
|
*/ |
37
|
|
|
class PlacesResult extends GoogleMapsResult |
38
|
|
|
{ |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var null|string |
42
|
|
|
*/ |
43
|
|
|
protected $formatted_address = null; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* @var string |
47
|
|
|
*/ |
48
|
|
|
protected $name = ''; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @var Geometry |
52
|
|
|
*/ |
53
|
|
|
protected $geometry = null; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @var string |
57
|
|
|
*/ |
58
|
|
|
protected $icon = ''; |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @var string |
62
|
|
|
*/ |
63
|
|
|
protected $id = ''; |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @var PhotoCollection |
67
|
|
|
*/ |
68
|
|
|
protected $photos = null; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @var string |
72
|
|
|
*/ |
73
|
|
|
protected $place_id = ''; |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @var string |
77
|
|
|
*/ |
78
|
|
|
protected $reference = ''; |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @var string |
82
|
|
|
*/ |
83
|
|
|
protected $vicinity = ''; |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* @var array |
87
|
|
|
*/ |
88
|
|
|
protected $types = []; |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @var array |
92
|
|
|
*/ |
93
|
|
|
protected $opening_hours = []; |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* @var int |
97
|
|
|
*/ |
98
|
|
|
protected $price_level = 0; |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* @var bool |
102
|
|
|
*/ |
103
|
|
|
protected $permanently_closed = false; |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* @var array |
107
|
|
|
*/ |
108
|
|
|
protected $typeCheck = [ |
109
|
|
|
GoogleMapsResultFields::FORMATTED_ADDRESS => 'string', |
110
|
|
|
GoogleMapsResultFields::NAME => 'string', |
111
|
|
|
GoogleMapsResultFields::GEOMETRY => Geometry::class, |
112
|
|
|
GoogleMapsResultFields::ICON => 'string', |
113
|
|
|
GoogleMapsResultFields::ID => 'string', |
114
|
|
|
GoogleMapsResultFields::PHOTOS => PhotoCollection::class, |
115
|
|
|
GoogleMapsResultFields::PLACE_ID => 'string', |
116
|
|
|
GoogleMapsResultFields::REFERENCE => 'string', |
117
|
|
|
GoogleMapsResultFields::VICINITY => 'string', |
118
|
|
|
GoogleMapsResultFields::TYPES => 'array', |
119
|
|
|
GoogleMapsResultFields::OPENING_HOURS => 'json', |
120
|
|
|
GoogleMapsResultFields::PRICE_LEVEL => 'int', |
121
|
|
|
GoogleMapsResultFields::RATING => 'float', |
122
|
|
|
GoogleMapsResultFields::PERMANENTLY_CLOSED => 'bool', |
123
|
|
|
GoogleMapsResultFields::PLUS_CODE => 'array', |
124
|
|
|
]; |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* @return bool|null |
128
|
|
|
*/ |
129
|
|
|
public function getPermanentlyClose(): bool |
130
|
|
|
{ |
131
|
|
|
|
132
|
|
|
return $this->permanently_closed ?? false; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
} |