1 | <?php namespace Arcanedev\GeoLocation\Google\DistanceMatrix; |
||
12 | class DistanceMatrixResponse extends AbstractResponse |
||
13 | { |
||
14 | /* ----------------------------------------------------------------- |
||
15 | | Getters & Setters |
||
16 | | ----------------------------------------------------------------- |
||
17 | */ |
||
18 | |||
19 | /** |
||
20 | * Get the first origin address. |
||
21 | * |
||
22 | * @return string|null |
||
23 | */ |
||
24 | 15 | public function getOriginAddress() |
|
25 | { |
||
26 | 15 | return Arr::first($this->getOriginAddresses(), null, null); |
|
27 | } |
||
28 | |||
29 | /** |
||
30 | * Get the original addresses. |
||
31 | * |
||
32 | * @return array |
||
33 | */ |
||
34 | 15 | public function getOriginAddresses() |
|
38 | |||
39 | /** |
||
40 | * Get the first destination address. |
||
41 | * |
||
42 | * @return string|null |
||
43 | */ |
||
44 | 15 | public function getDestinationAddress() |
|
48 | |||
49 | /** |
||
50 | * Get the destination addresses. |
||
51 | * |
||
52 | * @return array |
||
53 | */ |
||
54 | 15 | public function getDestinationAddresses() |
|
58 | |||
59 | /** |
||
60 | * Get the distance (text or value). |
||
61 | * |
||
62 | * @param bool $text |
||
63 | * |
||
64 | * @return string|int |
||
65 | */ |
||
66 | 18 | public function getDistance($text = true) |
|
70 | |||
71 | /** |
||
72 | * Get the duration (text or value). |
||
73 | * |
||
74 | * @param bool $text |
||
75 | * |
||
76 | * @return string|int |
||
77 | */ |
||
78 | 18 | public function getDuration($text = true) |
|
82 | |||
83 | /* ----------------------------------------------------------------- |
||
84 | | Main Methods |
||
85 | | ----------------------------------------------------------------- |
||
86 | */ |
||
87 | |||
88 | /** |
||
89 | * Convert the object to array. |
||
90 | * |
||
91 | * @return array |
||
92 | */ |
||
93 | 6 | public function toArray() |
|
108 | } |
||
109 |