1 | <?php |
||
15 | class Location extends BaseType implements TypeInterface |
||
16 | { |
||
17 | /** |
||
18 | * {@inheritdoc} |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | static protected $requiredParams = ['latitude', 'longitude']; |
||
23 | |||
24 | /** |
||
25 | * {@inheritdoc} |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | static protected $map = [ |
||
30 | 'latitude' => true, |
||
31 | 'longitude' => true, |
||
32 | 'horizontal_accuracy' => true, |
||
33 | 'live_period' => true, |
||
34 | 'heading' => true, |
||
35 | 'proximity_alert_radius' => true, |
||
36 | ]; |
||
37 | |||
38 | /** |
||
39 | * Longitude as defined by sender |
||
40 | * |
||
41 | * @var float |
||
42 | */ |
||
43 | protected $longitude; |
||
44 | |||
45 | /** |
||
46 | * Latitude as defined by sender |
||
47 | * |
||
48 | * @var float |
||
49 | */ |
||
50 | protected $latitude; |
||
51 | |||
52 | /** |
||
53 | * Optional. The radius of uncertainty for the location, measured in meters; 0-1500 |
||
54 | * |
||
55 | * @var float |
||
56 | */ |
||
57 | protected $horizontalAccuracy; |
||
58 | |||
59 | /** |
||
60 | * Optional. Time relative to the message sending date, during which the location can be updated, in seconds. For |
||
61 | * active live locations only. |
||
62 | * |
||
63 | * @var int |
||
64 | */ |
||
65 | protected $livePeriod; |
||
66 | |||
67 | /** |
||
68 | * Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only. |
||
69 | * |
||
70 | * @var int |
||
71 | */ |
||
72 | protected $heading; |
||
73 | |||
74 | /** |
||
75 | * Optional. Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live |
||
76 | * locations only. |
||
77 | * |
||
78 | * @var int |
||
79 | */ |
||
80 | protected $proximityAlertRadius; |
||
81 | |||
82 | /** |
||
83 | * @return float |
||
84 | */ |
||
85 | 1 | public function getLatitude() |
|
89 | |||
90 | /** |
||
91 | * @param float $latitude |
||
92 | * |
||
93 | * @throws InvalidArgumentException |
||
94 | */ |
||
95 | 8 | public function setLatitude($latitude) |
|
103 | |||
104 | /** |
||
105 | * @return float |
||
106 | */ |
||
107 | 1 | public function getLongitude() |
|
111 | |||
112 | /** |
||
113 | * @param float $longitude |
||
114 | * |
||
115 | * @throws InvalidArgumentException |
||
116 | */ |
||
117 | 8 | public function setLongitude($longitude) |
|
125 | |||
126 | /** |
||
127 | * @return float |
||
128 | */ |
||
129 | 1 | public function getHorizontalAccuracy() |
|
133 | |||
134 | /** |
||
135 | * @param float $horizontalAccuracy |
||
136 | * |
||
137 | * @throws InvalidArgumentException |
||
138 | */ |
||
139 | 4 | public function setHorizontalAccuracy($horizontalAccuracy) |
|
147 | |||
148 | /** |
||
149 | * @return int |
||
150 | */ |
||
151 | 1 | public function getLivePeriod() |
|
155 | |||
156 | /** |
||
157 | * @param int $livePeriod |
||
158 | */ |
||
159 | 3 | public function setLivePeriod($livePeriod) |
|
163 | |||
164 | /** |
||
165 | * @return int |
||
166 | */ |
||
167 | 1 | public function getHeading() |
|
171 | |||
172 | /** |
||
173 | * @param int $heading |
||
174 | */ |
||
175 | 3 | public function setHeading($heading) |
|
179 | |||
180 | /** |
||
181 | * @return int |
||
182 | */ |
||
183 | 1 | public function getProximityAlertRadius() |
|
187 | |||
188 | /** |
||
189 | * @param int $proximityAlertRadius |
||
190 | */ |
||
191 | 3 | public function setProximityAlertRadius($proximityAlertRadius) |
|
195 | } |
||
196 |