1 | <?php namespace Arcanedev\GeoLocation\Google\Directions\Entities; |
||
17 | class Route implements Arrayable, Jsonable, JsonSerializable |
||
18 | { |
||
19 | /* ----------------------------------------------------------------- |
||
20 | | Traits |
||
21 | | ----------------------------------------------------------------- |
||
22 | */ |
||
23 | |||
24 | use CanBeJsonable; |
||
25 | |||
26 | /* ----------------------------------------------------------------- |
||
27 | | Properties |
||
28 | | ----------------------------------------------------------------- |
||
29 | */ |
||
30 | |||
31 | /** |
||
32 | * The summary. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $summary; |
||
37 | |||
38 | /** |
||
39 | * The legs. |
||
40 | * |
||
41 | * @var \Arcanedev\GeoLocation\Google\Directions\Entities\LegCollection |
||
42 | */ |
||
43 | protected $legs; |
||
44 | |||
45 | /** |
||
46 | * The copyrights. |
||
47 | * |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $copyrights; |
||
51 | |||
52 | /** |
||
53 | * The bounds. |
||
54 | * |
||
55 | * @var \Arcanedev\GeoLocation\Entities\Coordinates\Viewport |
||
56 | */ |
||
57 | protected $bounds; |
||
58 | |||
59 | /* ----------------------------------------------------------------- |
||
60 | | Constructor |
||
61 | | ----------------------------------------------------------------- |
||
62 | */ |
||
63 | |||
64 | /** |
||
65 | * Route constructor. |
||
66 | * |
||
67 | * @param array $data |
||
68 | */ |
||
69 | 21 | public function __construct(array $data) |
|
76 | |||
77 | /* ----------------------------------------------------------------- |
||
78 | | Getters & Setters |
||
79 | | ----------------------------------------------------------------- |
||
80 | */ |
||
81 | |||
82 | /** |
||
83 | * Get the route summary. |
||
84 | * |
||
85 | * @return string |
||
86 | */ |
||
87 | 9 | public function summary() |
|
91 | |||
92 | /** |
||
93 | * @param array $bounds |
||
94 | * |
||
95 | * @return self |
||
96 | */ |
||
97 | 21 | private function setBounds(array $bounds) |
|
106 | |||
107 | /** |
||
108 | * Get the leg collection. |
||
109 | * |
||
110 | * @return \Arcanedev\GeoLocation\Google\Directions\Entities\LegCollection |
||
111 | */ |
||
112 | 9 | public function legs() |
|
116 | |||
117 | /** |
||
118 | * Get the copyrights. |
||
119 | * |
||
120 | * @return string |
||
121 | */ |
||
122 | 9 | public function copyrights() |
|
126 | |||
127 | /** |
||
128 | * Get the bounds. |
||
129 | * |
||
130 | * @return \Arcanedev\GeoLocation\Entities\Coordinates\Viewport |
||
131 | */ |
||
132 | 9 | public function bounds() |
|
136 | |||
137 | /* ----------------------------------------------------------------- |
||
138 | | Main Methods |
||
139 | | ----------------------------------------------------------------- |
||
140 | */ |
||
141 | |||
142 | /** |
||
143 | * Get the instance as an array. |
||
144 | * |
||
145 | * @return array |
||
146 | */ |
||
147 | 6 | public function toArray() |
|
156 | } |
||
157 |