1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Ivory Google Map package. |
5
|
|
|
* |
6
|
|
|
* (c) Eric GELOEN <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please read the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Ivory\GoogleMap\Service\DistanceMatrix; |
13
|
|
|
|
14
|
|
|
use Ivory\GoogleMap\Service\Base\Distance; |
15
|
|
|
use Ivory\GoogleMap\Service\Base\Duration; |
16
|
|
|
use Ivory\GoogleMap\Service\Base\Fare; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @author GeLo <[email protected]> |
20
|
|
|
*/ |
21
|
|
|
class DistanceMatrixElement |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* @var string|null |
25
|
|
|
*/ |
26
|
|
|
private $status; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var Distance|null |
30
|
|
|
*/ |
31
|
|
|
private $distance; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var Duration|null |
35
|
|
|
*/ |
36
|
|
|
private $duration; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var Duration|null |
40
|
|
|
*/ |
41
|
|
|
private $durationInTraffic; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var Fare|null |
45
|
|
|
*/ |
46
|
|
|
private $fare; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @return bool |
50
|
|
|
*/ |
51
|
|
|
public function hasStatus() |
52
|
|
|
{ |
53
|
|
|
return $this->status !== null; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @return string|null |
58
|
|
|
*/ |
59
|
|
|
public function getStatus() |
60
|
|
|
{ |
61
|
|
|
return $this->status; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @param string|null $status |
66
|
|
|
*/ |
67
|
|
|
public function setStatus($status) |
68
|
|
|
{ |
69
|
|
|
$this->status = $status; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @return bool |
74
|
|
|
*/ |
75
|
|
|
public function hasDistance() |
76
|
|
|
{ |
77
|
|
|
return $this->distance !== null; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @return Distance|null |
82
|
|
|
*/ |
83
|
|
|
public function getDistance() |
84
|
|
|
{ |
85
|
|
|
return $this->distance; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @param Distance|null $distance |
90
|
|
|
*/ |
91
|
|
|
public function setDistance(Distance $distance = null) |
92
|
|
|
{ |
93
|
|
|
$this->distance = $distance; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @return bool |
98
|
|
|
*/ |
99
|
|
|
public function hasDuration() |
100
|
|
|
{ |
101
|
|
|
return $this->duration !== null; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @return Duration|null |
106
|
|
|
*/ |
107
|
|
|
public function getDuration() |
108
|
|
|
{ |
109
|
|
|
return $this->duration; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @param Duration|null $duration |
114
|
|
|
*/ |
115
|
|
|
public function setDuration(Duration $duration = null) |
116
|
|
|
{ |
117
|
|
|
$this->duration = $duration; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* @return bool |
122
|
|
|
*/ |
123
|
|
|
public function hasDurationInTraffic() |
124
|
|
|
{ |
125
|
|
|
return $this->durationInTraffic !== null; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* @return Duration|null |
130
|
|
|
*/ |
131
|
|
|
public function getDurationInTraffic() |
132
|
|
|
{ |
133
|
|
|
return $this->durationInTraffic; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @param Duration|null $durationInTraffic |
138
|
|
|
*/ |
139
|
|
|
public function setDurationInTraffic(Duration $durationInTraffic = null) |
140
|
|
|
{ |
141
|
|
|
$this->durationInTraffic = $durationInTraffic; |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @return bool |
146
|
|
|
*/ |
147
|
|
|
public function hasFare() |
148
|
|
|
{ |
149
|
|
|
return $this->fare !== null; |
150
|
|
|
} |
151
|
|
|
|
152
|
|
|
/** |
153
|
|
|
* @return Fare|null |
154
|
|
|
*/ |
155
|
|
|
public function getFare() |
156
|
|
|
{ |
157
|
|
|
return $this->fare; |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* @param Fare|null $fare |
162
|
|
|
*/ |
163
|
|
|
public function setFare(Fare $fare = null) |
164
|
|
|
{ |
165
|
|
|
$this->fare = $fare; |
166
|
|
|
} |
167
|
|
|
} |
168
|
|
|
|