@@ 146-167 (lines=22) @@ | ||
143 | return null; |
|
144 | } |
|
145 | ||
146 | public static function addAdressBookLocation($params) |
|
147 | { |
|
148 | $body = array(); |
|
149 | $abLocations = new AddressBookLocation(); |
|
150 | ||
151 | foreach($params as $key => $value) { |
|
152 | if ($key == "address_id") continue; |
|
153 | if (property_exists($abLocations, $key)) { |
|
154 | if (isset($params->{$key})) { |
|
155 | $body[$key] = $params->{$key}; |
|
156 | } |
|
157 | } |
|
158 | } |
|
159 | ||
160 | $response = Route4Me::makeRequst(array( |
|
161 | 'url' => Endpoint::ADDRESS_BOOK_V4, |
|
162 | 'method' => 'POST', |
|
163 | 'body' => $body |
|
164 | )); |
|
165 | ||
166 | return $response; |
|
167 | } |
|
168 | ||
169 | public function deleteAdressBookLocation($address_ids) |
|
170 | { |
|
@@ 182-202 (lines=21) @@ | ||
179 | return $result; |
|
180 | } |
|
181 | ||
182 | public function updateAdressBookLocation($params) |
|
183 | { |
|
184 | $body = array(); |
|
185 | $abLocations = new AddressBookLocation(); |
|
186 | ||
187 | foreach($params as $key => $value) { |
|
188 | if (property_exists($abLocations, $key)) { |
|
189 | if (isset($params->{$key})) { |
|
190 | $body[$key] = $params->{$key}; |
|
191 | } |
|
192 | } |
|
193 | } |
|
194 | ||
195 | $response = Route4Me::makeRequst(array( |
|
196 | 'url' => Endpoint::ADDRESS_BOOK_V4, |
|
197 | 'method' => 'PUT', |
|
198 | 'body' => $body, |
|
199 | )); |
|
200 | ||
201 | return $response; |
|
202 | } |
|
203 | ||
204 | public static function get($params) |
|
205 | { |
@@ 147-170 (lines=24) @@ | ||
144 | return $response; |
|
145 | } |
|
146 | ||
147 | public function createVehicle($params) |
|
148 | { |
|
149 | $body = array(); |
|
150 | ||
151 | $vehicle= new Vehicle(); |
|
152 | ||
153 | foreach($params as $key => $value) { |
|
154 | if ($key=="vehicle_id") continue; |
|
155 | if (property_exists($vehicle, $key)) { |
|
156 | if (isset($params->{$key})) { |
|
157 | $body[$key] = $params->{$key}; |
|
158 | } |
|
159 | } |
|
160 | } |
|
161 | ||
162 | $response = Route4Me::makeRequst(array( |
|
163 | 'url' => Endpoint::VEHICLE_V4, |
|
164 | 'method' => 'POST', |
|
165 | 'body' => $body, |
|
166 | 'HTTPHEADER' => 'Content-Type: application/json' |
|
167 | )); |
|
168 | ||
169 | return $response; |
|
170 | } |
|
171 | ||
172 | public function removeVehicle($params) |
|
173 | { |