@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | public static function getTerritory($params) |
| 42 | 42 | { |
| 43 | - $allQueryFields = array('territory_id', 'addresses'); |
|
| 43 | + $allQueryFields = array('territory_id', 'addresses'); |
|
| 44 | 44 | |
| 45 | 45 | $territory = Route4Me::makeRequst(array( |
| 46 | 46 | 'url' => Endpoint::TERRITORY_V4, |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | public static function getTerritories($params) |
| 55 | 55 | { |
| 56 | - $allQueryFields = array('offset', 'limit', 'addresses'); |
|
| 56 | + $allQueryFields = array('offset', 'limit', 'addresses'); |
|
| 57 | 57 | |
| 58 | 58 | $response = Route4Me::makeRequst(array( |
| 59 | 59 | 'url' => Endpoint::TERRITORY_V4, |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public static function addTerritory($params) |
| 68 | 68 | { |
| 69 | - $allBodyFields = array('territory_name', 'member_id', 'territory_color', 'territory'); |
|
| 69 | + $allBodyFields = array('territory_name', 'member_id', 'territory_color', 'territory'); |
|
| 70 | 70 | |
| 71 | 71 | $response = Route4Me::makeRequst(array( |
| 72 | 72 | 'url' => Endpoint::TERRITORY_V4, |
@@ -92,14 +92,14 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | public function updateTerritory($params) |
| 94 | 94 | { |
| 95 | - $allQueryFields = array('territory_id'); |
|
| 96 | - $allBodyFields = array('territory_name', 'member_id', 'territory_color', 'territory'); |
|
| 95 | + $allQueryFields = array('territory_id'); |
|
| 96 | + $allBodyFields = array('territory_name', 'member_id', 'territory_color', 'territory'); |
|
| 97 | 97 | |
| 98 | 98 | $response = Route4Me::makeRequst(array( |
| 99 | 99 | 'url' => Endpoint::TERRITORY_V4, |
| 100 | 100 | 'method' => 'PUT', |
| 101 | 101 | 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
| 102 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
| 102 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
| 103 | 103 | )); |
| 104 | 104 | |
| 105 | 105 | return $response; |
@@ -8,283 +8,283 @@ |
||
| 8 | 8 | |
| 9 | 9 | class Address extends Common |
| 10 | 10 | { |
| 11 | - public $route_destination_id; |
|
| 12 | - public $alias; |
|
| 13 | - public $member_id; |
|
| 14 | - public $address; |
|
| 15 | - public $addressUpdate; |
|
| 16 | - public $is_depot = false; |
|
| 17 | - public $lat; |
|
| 18 | - public $lng; |
|
| 19 | - public $route_id; |
|
| 20 | - public $original_route_id; |
|
| 21 | - public $optimization_problem_id; |
|
| 22 | - public $sequence_no; |
|
| 23 | - public $geocoded; |
|
| 24 | - public $preferred_geocoding; |
|
| 25 | - public $failed_geocoding; |
|
| 26 | - public $geocodings = array(); |
|
| 27 | - public $contact_id; |
|
| 28 | - public $is_visited; |
|
| 29 | - public $customer_po; |
|
| 30 | - public $invoice_no; |
|
| 31 | - public $reference_no; |
|
| 32 | - public $order_no; |
|
| 33 | - public $weight; |
|
| 34 | - public $cost; |
|
| 35 | - public $revenue; |
|
| 36 | - public $cube; |
|
| 37 | - public $pieces; |
|
| 38 | - public $email; |
|
| 39 | - public $phone; |
|
| 40 | - public $tracking_number; |
|
| 41 | - public $destination_note_count; |
|
| 42 | - public $drive_time_to_next_destination; |
|
| 43 | - public $distance_to_next_destination; |
|
| 44 | - public $generated_time_window_start; |
|
| 45 | - public $generated_time_window_end; |
|
| 46 | - public $time_window_start; |
|
| 47 | - public $time_window_end; |
|
| 48 | - public $time; |
|
| 49 | - public $notes; |
|
| 50 | - public $timestamp_last_visited; |
|
| 51 | - public $custom_fields = array(); |
|
| 52 | - public $manifest = array(); |
|
| 11 | + public $route_destination_id; |
|
| 12 | + public $alias; |
|
| 13 | + public $member_id; |
|
| 14 | + public $address; |
|
| 15 | + public $addressUpdate; |
|
| 16 | + public $is_depot = false; |
|
| 17 | + public $lat; |
|
| 18 | + public $lng; |
|
| 19 | + public $route_id; |
|
| 20 | + public $original_route_id; |
|
| 21 | + public $optimization_problem_id; |
|
| 22 | + public $sequence_no; |
|
| 23 | + public $geocoded; |
|
| 24 | + public $preferred_geocoding; |
|
| 25 | + public $failed_geocoding; |
|
| 26 | + public $geocodings = array(); |
|
| 27 | + public $contact_id; |
|
| 28 | + public $is_visited; |
|
| 29 | + public $customer_po; |
|
| 30 | + public $invoice_no; |
|
| 31 | + public $reference_no; |
|
| 32 | + public $order_no; |
|
| 33 | + public $weight; |
|
| 34 | + public $cost; |
|
| 35 | + public $revenue; |
|
| 36 | + public $cube; |
|
| 37 | + public $pieces; |
|
| 38 | + public $email; |
|
| 39 | + public $phone; |
|
| 40 | + public $tracking_number; |
|
| 41 | + public $destination_note_count; |
|
| 42 | + public $drive_time_to_next_destination; |
|
| 43 | + public $distance_to_next_destination; |
|
| 44 | + public $generated_time_window_start; |
|
| 45 | + public $generated_time_window_end; |
|
| 46 | + public $time_window_start; |
|
| 47 | + public $time_window_end; |
|
| 48 | + public $time; |
|
| 49 | + public $notes; |
|
| 50 | + public $timestamp_last_visited; |
|
| 51 | + public $custom_fields = array(); |
|
| 52 | + public $manifest = array(); |
|
| 53 | 53 | |
| 54 | - public $first_name; |
|
| 55 | - public $last_name; |
|
| 56 | - public $is_departed; |
|
| 57 | - public $timestamp_last_departed; |
|
| 58 | - public $order_id; |
|
| 59 | - public $priority; |
|
| 60 | - public $curbside_lat; |
|
| 61 | - public $curbside_lng; |
|
| 62 | - public $time_window_start_2; |
|
| 63 | - public $time_window_end_2; |
|
| 54 | + public $first_name; |
|
| 55 | + public $last_name; |
|
| 56 | + public $is_departed; |
|
| 57 | + public $timestamp_last_departed; |
|
| 58 | + public $order_id; |
|
| 59 | + public $priority; |
|
| 60 | + public $curbside_lat; |
|
| 61 | + public $curbside_lng; |
|
| 62 | + public $time_window_start_2; |
|
| 63 | + public $time_window_end_2; |
|
| 64 | 64 | |
| 65 | - public static function fromArray(array $params) |
|
| 66 | - { |
|
| 67 | - $address = new Address(); |
|
| 68 | - foreach ($params as $key => $value) { |
|
| 69 | - if (property_exists($address, $key)) { |
|
| 70 | - $address->{$key} = $value; |
|
| 71 | - } |
|
| 72 | - } |
|
| 65 | + public static function fromArray(array $params) |
|
| 66 | + { |
|
| 67 | + $address = new Address(); |
|
| 68 | + foreach ($params as $key => $value) { |
|
| 69 | + if (property_exists($address, $key)) { |
|
| 70 | + $address->{$key} = $value; |
|
| 71 | + } |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - return $address; |
|
| 75 | - } |
|
| 74 | + return $address; |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | - public static function getAddress($routeId, $addressId) |
|
| 78 | - { |
|
| 79 | - $address = Route4Me::makeRequst(array( |
|
| 80 | - 'url' => Endpoint::ADDRESS_V4, |
|
| 81 | - 'method' => 'GET', |
|
| 82 | - 'query' => array( |
|
| 83 | - 'route_id' => $routeId, |
|
| 84 | - 'route_destination_id' => $addressId, |
|
| 85 | - ) |
|
| 86 | - )); |
|
| 77 | + public static function getAddress($routeId, $addressId) |
|
| 78 | + { |
|
| 79 | + $address = Route4Me::makeRequst(array( |
|
| 80 | + 'url' => Endpoint::ADDRESS_V4, |
|
| 81 | + 'method' => 'GET', |
|
| 82 | + 'query' => array( |
|
| 83 | + 'route_id' => $routeId, |
|
| 84 | + 'route_destination_id' => $addressId, |
|
| 85 | + ) |
|
| 86 | + )); |
|
| 87 | 87 | |
| 88 | - return Address::fromArray($address); |
|
| 89 | - } |
|
| 88 | + return Address::fromArray($address); |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - /*Get notes from the specified route destination |
|
| 91 | + /*Get notes from the specified route destination |
|
| 92 | 92 | * Returns an address object with notes, if an address exists, otherwise - return null. |
| 93 | 93 | */ |
| 94 | - public static function GetAddressesNotes($noteParams) |
|
| 95 | - { |
|
| 96 | - $address = Route4Me::makeRequst(array( |
|
| 97 | - 'url' => Endpoint::ADDRESS_V4, |
|
| 98 | - 'method' => 'GET', |
|
| 99 | - 'query' => array( |
|
| 100 | - 'route_id' => isset($noteParams['route_id']) ? $noteParams['route_id'] : null, |
|
| 101 | - 'route_destination_id' => isset($noteParams['route_destination_id']) |
|
| 102 | - ? $noteParams['route_destination_id'] : null, |
|
| 103 | - 'notes' => 1, |
|
| 104 | - ) |
|
| 105 | - )); |
|
| 94 | + public static function GetAddressesNotes($noteParams) |
|
| 95 | + { |
|
| 96 | + $address = Route4Me::makeRequst(array( |
|
| 97 | + 'url' => Endpoint::ADDRESS_V4, |
|
| 98 | + 'method' => 'GET', |
|
| 99 | + 'query' => array( |
|
| 100 | + 'route_id' => isset($noteParams['route_id']) ? $noteParams['route_id'] : null, |
|
| 101 | + 'route_destination_id' => isset($noteParams['route_destination_id']) |
|
| 102 | + ? $noteParams['route_destination_id'] : null, |
|
| 103 | + 'notes' => 1, |
|
| 104 | + ) |
|
| 105 | + )); |
|
| 106 | 106 | |
| 107 | - return $address; |
|
| 108 | - } |
|
| 107 | + return $address; |
|
| 108 | + } |
|
| 109 | 109 | |
| 110 | - public function update() |
|
| 111 | - { |
|
| 112 | - $addressUpdate = Route4Me::makeRequst(array( |
|
| 113 | - 'url' => Endpoint::ADDRESS_V4, |
|
| 114 | - 'method' => 'PUT', |
|
| 115 | - 'body' => $this->toArray(), |
|
| 116 | - 'query' => array( |
|
| 117 | - 'route_id' => $this->route_id, |
|
| 118 | - 'route_destination_id' => $this->route_destination_id, |
|
| 119 | - ), |
|
| 120 | - )); |
|
| 110 | + public function update() |
|
| 111 | + { |
|
| 112 | + $addressUpdate = Route4Me::makeRequst(array( |
|
| 113 | + 'url' => Endpoint::ADDRESS_V4, |
|
| 114 | + 'method' => 'PUT', |
|
| 115 | + 'body' => $this->toArray(), |
|
| 116 | + 'query' => array( |
|
| 117 | + 'route_id' => $this->route_id, |
|
| 118 | + 'route_destination_id' => $this->route_destination_id, |
|
| 119 | + ), |
|
| 120 | + )); |
|
| 121 | 121 | |
| 122 | - return Address::fromArray($addressUpdate); |
|
| 123 | - } |
|
| 122 | + return Address::fromArray($addressUpdate); |
|
| 123 | + } |
|
| 124 | 124 | |
| 125 | - public function markAddress($params) |
|
| 126 | - { |
|
| 127 | - $allQueryFields = array('route_id', 'route_destination_id'); |
|
| 128 | - $allBodyFields = array('is_visited', 'is_departed'); |
|
| 125 | + public function markAddress($params) |
|
| 126 | + { |
|
| 127 | + $allQueryFields = array('route_id', 'route_destination_id'); |
|
| 128 | + $allBodyFields = array('is_visited', 'is_departed'); |
|
| 129 | 129 | |
| 130 | - $result = Route4Me::makeRequst(array( |
|
| 131 | - 'url' => Endpoint::ADDRESS_V4, |
|
| 132 | - 'method' => 'PUT', |
|
| 133 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
| 134 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
| 135 | - )); |
|
| 130 | + $result = Route4Me::makeRequst(array( |
|
| 131 | + 'url' => Endpoint::ADDRESS_V4, |
|
| 132 | + 'method' => 'PUT', |
|
| 133 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
| 134 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
| 135 | + )); |
|
| 136 | 136 | |
| 137 | - return $result; |
|
| 138 | - } |
|
| 137 | + return $result; |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | - public function markAsDeparted($params) |
|
| 141 | - { |
|
| 142 | - $allQueryFields = array('route_id', 'address_id', 'is_departed', 'member_id'); |
|
| 140 | + public function markAsDeparted($params) |
|
| 141 | + { |
|
| 142 | + $allQueryFields = array('route_id', 'address_id', 'is_departed', 'member_id'); |
|
| 143 | 143 | |
| 144 | - $address = Route4Me::makeRequst(array( |
|
| 145 | - 'url' => Endpoint::MARK_ADDRESS_DEPARTED, |
|
| 146 | - 'method' => 'PUT', |
|
| 147 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
| 148 | - )); |
|
| 144 | + $address = Route4Me::makeRequst(array( |
|
| 145 | + 'url' => Endpoint::MARK_ADDRESS_DEPARTED, |
|
| 146 | + 'method' => 'PUT', |
|
| 147 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
| 148 | + )); |
|
| 149 | 149 | |
| 150 | - return $address; |
|
| 151 | - } |
|
| 150 | + return $address; |
|
| 151 | + } |
|
| 152 | 152 | |
| 153 | - public function markAsVisited($params) |
|
| 154 | - { |
|
| 155 | - $allQueryFields = array('route_id', 'address_id', 'is_visited', 'member_id'); |
|
| 153 | + public function markAsVisited($params) |
|
| 154 | + { |
|
| 155 | + $allQueryFields = array('route_id', 'address_id', 'is_visited', 'member_id'); |
|
| 156 | 156 | |
| 157 | - $address = Route4Me::makeRequst(array( |
|
| 158 | - 'url' => Endpoint::UPDATE_ADDRESS_VISITED, |
|
| 159 | - 'method' => 'PUT', |
|
| 160 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
| 161 | - )); |
|
| 157 | + $address = Route4Me::makeRequst(array( |
|
| 158 | + 'url' => Endpoint::UPDATE_ADDRESS_VISITED, |
|
| 159 | + 'method' => 'PUT', |
|
| 160 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
| 161 | + )); |
|
| 162 | 162 | |
| 163 | - return $address; |
|
| 164 | - } |
|
| 163 | + return $address; |
|
| 164 | + } |
|
| 165 | 165 | |
| 166 | - public function deleteAddress() |
|
| 167 | - { |
|
| 168 | - $address = Route4Me::makeRequst(array( |
|
| 169 | - 'url' => Endpoint::ADDRESS_V4, |
|
| 170 | - 'method' => 'DELETE', |
|
| 171 | - 'query' => array( |
|
| 172 | - 'route_id' => $this->route_id, |
|
| 173 | - 'route_destination_id' => $this->route_destination_id, |
|
| 174 | - ) |
|
| 175 | - )); |
|
| 166 | + public function deleteAddress() |
|
| 167 | + { |
|
| 168 | + $address = Route4Me::makeRequst(array( |
|
| 169 | + 'url' => Endpoint::ADDRESS_V4, |
|
| 170 | + 'method' => 'DELETE', |
|
| 171 | + 'query' => array( |
|
| 172 | + 'route_id' => $this->route_id, |
|
| 173 | + 'route_destination_id' => $this->route_destination_id, |
|
| 174 | + ) |
|
| 175 | + )); |
|
| 176 | 176 | |
| 177 | - return (bool)$address['deleted']; |
|
| 178 | - } |
|
| 177 | + return (bool)$address['deleted']; |
|
| 178 | + } |
|
| 179 | 179 | |
| 180 | - public function moveDestinationToRoute($params) |
|
| 181 | - { |
|
| 182 | - $allBodyFields = array('to_route_id', 'route_destination_id', 'after_destination_id'); |
|
| 180 | + public function moveDestinationToRoute($params) |
|
| 181 | + { |
|
| 182 | + $allBodyFields = array('to_route_id', 'route_destination_id', 'after_destination_id'); |
|
| 183 | 183 | |
| 184 | - $result = Route4Me::makeRequst(array( |
|
| 185 | - 'url' => Endpoint::MOVE_ROUTE_DESTINATION, |
|
| 186 | - 'method' => 'POST', |
|
| 187 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 188 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
| 189 | - )); |
|
| 184 | + $result = Route4Me::makeRequst(array( |
|
| 185 | + 'url' => Endpoint::MOVE_ROUTE_DESTINATION, |
|
| 186 | + 'method' => 'POST', |
|
| 187 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 188 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
| 189 | + )); |
|
| 190 | 190 | |
| 191 | - return $result; |
|
| 192 | - } |
|
| 191 | + return $result; |
|
| 192 | + } |
|
| 193 | 193 | |
| 194 | - public function AddAddressNote($params) |
|
| 195 | - { |
|
| 196 | - $allQueryFields = array('route_id', 'address_id', 'dev_lat', 'dev_lng', 'device_type'); |
|
| 197 | - $allBodyFields = array('strNoteContents', 'strUpdateType'); |
|
| 194 | + public function AddAddressNote($params) |
|
| 195 | + { |
|
| 196 | + $allQueryFields = array('route_id', 'address_id', 'dev_lat', 'dev_lng', 'device_type'); |
|
| 197 | + $allBodyFields = array('strNoteContents', 'strUpdateType'); |
|
| 198 | 198 | |
| 199 | - $result = Route4Me::makeRequst(array( |
|
| 200 | - 'url' => Endpoint::ROUTE_NOTES_ADD, |
|
| 201 | - 'method' => 'POST', |
|
| 202 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
| 203 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 204 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
| 205 | - )); |
|
| 199 | + $result = Route4Me::makeRequst(array( |
|
| 200 | + 'url' => Endpoint::ROUTE_NOTES_ADD, |
|
| 201 | + 'method' => 'POST', |
|
| 202 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
| 203 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 204 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
| 205 | + )); |
|
| 206 | 206 | |
| 207 | - return $result; |
|
| 208 | - } |
|
| 207 | + return $result; |
|
| 208 | + } |
|
| 209 | 209 | |
| 210 | - public function AddNoteFile($params) |
|
| 211 | - { |
|
| 212 | - $allQueryFields = array('route_id', 'address_id', 'dev_lat', 'dev_lng', 'device_type', 'strUpdateType'); |
|
| 213 | - $allBodyFields = array('strFilename'); |
|
| 210 | + public function AddNoteFile($params) |
|
| 211 | + { |
|
| 212 | + $allQueryFields = array('route_id', 'address_id', 'dev_lat', 'dev_lng', 'device_type', 'strUpdateType'); |
|
| 213 | + $allBodyFields = array('strFilename'); |
|
| 214 | 214 | |
| 215 | - $result = Route4Me::fileUploadRequest(array( |
|
| 216 | - 'url' => Endpoint::ROUTE_NOTES_ADD, |
|
| 217 | - 'method' => 'POST', |
|
| 218 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
| 219 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 220 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
| 221 | - )); |
|
| 215 | + $result = Route4Me::fileUploadRequest(array( |
|
| 216 | + 'url' => Endpoint::ROUTE_NOTES_ADD, |
|
| 217 | + 'method' => 'POST', |
|
| 218 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
| 219 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 220 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
| 221 | + )); |
|
| 222 | 222 | |
| 223 | - return $result; |
|
| 224 | - } |
|
| 223 | + return $result; |
|
| 224 | + } |
|
| 225 | 225 | |
| 226 | - public function createCustomNoteType($params) |
|
| 227 | - { |
|
| 228 | - $allBodyFields = array('type', 'values'); |
|
| 226 | + public function createCustomNoteType($params) |
|
| 227 | + { |
|
| 228 | + $allBodyFields = array('type', 'values'); |
|
| 229 | 229 | |
| 230 | - $result = Route4Me::makeRequst(array( |
|
| 231 | - 'url' => Endpoint::NOTE_CUSTOM_TYPES_V4, |
|
| 232 | - 'method' => 'POST', |
|
| 233 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
| 234 | - )); |
|
| 230 | + $result = Route4Me::makeRequst(array( |
|
| 231 | + 'url' => Endpoint::NOTE_CUSTOM_TYPES_V4, |
|
| 232 | + 'method' => 'POST', |
|
| 233 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
| 234 | + )); |
|
| 235 | 235 | |
| 236 | - return $result; |
|
| 237 | - } |
|
| 236 | + return $result; |
|
| 237 | + } |
|
| 238 | 238 | |
| 239 | - public function removeCustomNoteType($params) |
|
| 240 | - { |
|
| 241 | - $result = Route4Me::makeRequst(array( |
|
| 242 | - 'url' => Endpoint::NOTE_CUSTOM_TYPES_V4, |
|
| 243 | - 'method' => 'DELETE', |
|
| 244 | - 'body' => array( |
|
| 245 | - 'id' => isset($params['id']) ? $params['id'] : null |
|
| 246 | - ) |
|
| 247 | - )); |
|
| 239 | + public function removeCustomNoteType($params) |
|
| 240 | + { |
|
| 241 | + $result = Route4Me::makeRequst(array( |
|
| 242 | + 'url' => Endpoint::NOTE_CUSTOM_TYPES_V4, |
|
| 243 | + 'method' => 'DELETE', |
|
| 244 | + 'body' => array( |
|
| 245 | + 'id' => isset($params['id']) ? $params['id'] : null |
|
| 246 | + ) |
|
| 247 | + )); |
|
| 248 | 248 | |
| 249 | - return $result; |
|
| 250 | - } |
|
| 249 | + return $result; |
|
| 250 | + } |
|
| 251 | 251 | |
| 252 | - public function getAllCustomNoteTypes() |
|
| 253 | - { |
|
| 254 | - $result = Route4Me::makeRequst(array( |
|
| 255 | - 'url' => Endpoint::NOTE_CUSTOM_TYPES_V4, |
|
| 256 | - 'method' => 'GET' |
|
| 257 | - )); |
|
| 252 | + public function getAllCustomNoteTypes() |
|
| 253 | + { |
|
| 254 | + $result = Route4Me::makeRequst(array( |
|
| 255 | + 'url' => Endpoint::NOTE_CUSTOM_TYPES_V4, |
|
| 256 | + 'method' => 'GET' |
|
| 257 | + )); |
|
| 258 | 258 | |
| 259 | - return $result; |
|
| 260 | - } |
|
| 259 | + return $result; |
|
| 260 | + } |
|
| 261 | 261 | |
| 262 | - public function addCustomNoteToRoute($params) |
|
| 263 | - { |
|
| 264 | - $customArray = array(); |
|
| 262 | + public function addCustomNoteToRoute($params) |
|
| 263 | + { |
|
| 264 | + $customArray = array(); |
|
| 265 | 265 | |
| 266 | - foreach ($params as $key => $value) { |
|
| 267 | - if (strpos($key, "custom_note_type")!==false) { |
|
| 268 | - $customArray[$key] = $value; |
|
| 269 | - } |
|
| 270 | - } |
|
| 266 | + foreach ($params as $key => $value) { |
|
| 267 | + if (strpos($key, "custom_note_type")!==false) { |
|
| 268 | + $customArray[$key] = $value; |
|
| 269 | + } |
|
| 270 | + } |
|
| 271 | 271 | |
| 272 | - $allQueryFields = array('route_id', 'address_id', 'format', 'dev_lat', 'dev_lng'); |
|
| 273 | - $allBodyFields = array('strUpdateType', 'strUpdateType', 'strNoteContents'); |
|
| 272 | + $allQueryFields = array('route_id', 'address_id', 'format', 'dev_lat', 'dev_lng'); |
|
| 273 | + $allBodyFields = array('strUpdateType', 'strUpdateType', 'strNoteContents'); |
|
| 274 | 274 | |
| 275 | - $result = Route4Me::makeRequst(array( |
|
| 276 | - 'url' => Endpoint::ROUTE_NOTES_ADD, |
|
| 277 | - 'method' => 'POST', |
|
| 278 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
| 279 | - 'body' => array_merge(Route4Me::generateRequestParameters($allBodyFields, $params), $customArray), |
|
| 280 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
| 281 | - )); |
|
| 275 | + $result = Route4Me::makeRequst(array( |
|
| 276 | + 'url' => Endpoint::ROUTE_NOTES_ADD, |
|
| 277 | + 'method' => 'POST', |
|
| 278 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
| 279 | + 'body' => array_merge(Route4Me::generateRequestParameters($allBodyFields, $params), $customArray), |
|
| 280 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
| 281 | + )); |
|
| 282 | 282 | |
| 283 | - return $result; |
|
| 284 | - } |
|
| 283 | + return $result; |
|
| 284 | + } |
|
| 285 | 285 | |
| 286 | - function getAddressId() |
|
| 287 | - { |
|
| 288 | - return $this->route_destination_id; |
|
| 289 | - } |
|
| 286 | + function getAddressId() |
|
| 287 | + { |
|
| 288 | + return $this->route_destination_id; |
|
| 289 | + } |
|
| 290 | 290 | } |
@@ -6,79 +6,79 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ActivityParameters extends Common |
| 8 | 8 | { |
| 9 | - public $route_id; |
|
| 10 | - public $device_id; |
|
| 11 | - public $member_id; |
|
| 12 | - public $team; |
|
| 13 | - public $limit; |
|
| 14 | - public $offset; |
|
| 15 | - public $start; |
|
| 16 | - public $end; |
|
| 17 | - public $activity_type; |
|
| 18 | - public $activity_message; |
|
| 9 | + public $route_id; |
|
| 10 | + public $device_id; |
|
| 11 | + public $member_id; |
|
| 12 | + public $team; |
|
| 13 | + public $limit; |
|
| 14 | + public $offset; |
|
| 15 | + public $start; |
|
| 16 | + public $end; |
|
| 17 | + public $activity_type; |
|
| 18 | + public $activity_message; |
|
| 19 | 19 | |
| 20 | - public $activity_id; |
|
| 21 | - public $activity_timestamp; |
|
| 22 | - public $route_destination_id; |
|
| 23 | - public $note_id; |
|
| 24 | - public $member; |
|
| 25 | - public $note_type; |
|
| 26 | - public $note_contents; |
|
| 27 | - public $route_name; |
|
| 28 | - public $note_file; |
|
| 29 | - public $destination_name; |
|
| 30 | - public $destination_alias; |
|
| 20 | + public $activity_id; |
|
| 21 | + public $activity_timestamp; |
|
| 22 | + public $route_destination_id; |
|
| 23 | + public $note_id; |
|
| 24 | + public $member; |
|
| 25 | + public $note_type; |
|
| 26 | + public $note_contents; |
|
| 27 | + public $route_name; |
|
| 28 | + public $note_file; |
|
| 29 | + public $destination_name; |
|
| 30 | + public $destination_alias; |
|
| 31 | 31 | |
| 32 | - public static function fromArray(array $params) |
|
| 33 | - { |
|
| 34 | - $activityparameters = new ActivityParameters(); |
|
| 32 | + public static function fromArray(array $params) |
|
| 33 | + { |
|
| 34 | + $activityparameters = new ActivityParameters(); |
|
| 35 | 35 | |
| 36 | - foreach($params as $key => $value) { |
|
| 37 | - if (property_exists($activityparameters, $key)) { |
|
| 38 | - $activityparameters->{$key} = $value; |
|
| 39 | - } |
|
| 40 | - } |
|
| 36 | + foreach($params as $key => $value) { |
|
| 37 | + if (property_exists($activityparameters, $key)) { |
|
| 38 | + $activityparameters->{$key} = $value; |
|
| 39 | + } |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - return $activityparameters; |
|
| 43 | - } |
|
| 42 | + return $activityparameters; |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - public static function getActivities($params) |
|
| 46 | - { |
|
| 47 | - $allQueryFields = array('route_id', 'team', 'limit', 'offset', 'start'); |
|
| 45 | + public static function getActivities($params) |
|
| 46 | + { |
|
| 47 | + $allQueryFields = array('route_id', 'team', 'limit', 'offset', 'start'); |
|
| 48 | 48 | |
| 49 | - $activity = Route4Me::makeRequst(array( |
|
| 50 | - 'url' => Endpoint::GET_ACTIVITIES, |
|
| 51 | - 'method' => 'GET', |
|
| 52 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
| 53 | - )); |
|
| 49 | + $activity = Route4Me::makeRequst(array( |
|
| 50 | + 'url' => Endpoint::GET_ACTIVITIES, |
|
| 51 | + 'method' => 'GET', |
|
| 52 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
| 53 | + )); |
|
| 54 | 54 | |
| 55 | - return $activity; |
|
| 56 | - } |
|
| 55 | + return $activity; |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - public static function searcActivities($params) |
|
| 59 | - { |
|
| 60 | - $allQueryFields = array('route_id', 'limit', 'offset', 'activity_type'); |
|
| 58 | + public static function searcActivities($params) |
|
| 59 | + { |
|
| 60 | + $allQueryFields = array('route_id', 'limit', 'offset', 'activity_type'); |
|
| 61 | 61 | |
| 62 | - $activity = Route4Me::makeRequst(array( |
|
| 63 | - 'url' => Endpoint::GET_ACTIVITIES, |
|
| 64 | - 'method' => 'GET', |
|
| 65 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
| 66 | - )); |
|
| 62 | + $activity = Route4Me::makeRequst(array( |
|
| 63 | + 'url' => Endpoint::GET_ACTIVITIES, |
|
| 64 | + 'method' => 'GET', |
|
| 65 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
| 66 | + )); |
|
| 67 | 67 | |
| 68 | - return $activity; |
|
| 69 | - } |
|
| 68 | + return $activity; |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - public static function sendUserMessage($params) |
|
| 72 | - { |
|
| 73 | - $allBodyFields = array('activity_type', 'activity_message', 'route_id'); |
|
| 71 | + public static function sendUserMessage($params) |
|
| 72 | + { |
|
| 73 | + $allBodyFields = array('activity_type', 'activity_message', 'route_id'); |
|
| 74 | 74 | |
| 75 | - $result = Route4Me::makeRequst(array( |
|
| 76 | - 'url' => Endpoint::ACTIVITY_FEED, |
|
| 77 | - 'method' => 'POST', |
|
| 78 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
| 79 | - )); |
|
| 75 | + $result = Route4Me::makeRequst(array( |
|
| 76 | + 'url' => Endpoint::ACTIVITY_FEED, |
|
| 77 | + 'method' => 'POST', |
|
| 78 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
| 79 | + )); |
|
| 80 | 80 | |
| 81 | - return $result; |
|
| 82 | - } |
|
| 81 | + return $result; |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | 84 | } |
@@ -13,13 +13,13 @@ |
||
| 13 | 13 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 14 | 14 | |
| 15 | 15 | $recordParameters = Member::fromArray(array( |
| 16 | - 'email_address' => '[email protected]', |
|
| 17 | - 'first_name' => 'Mmmmm', |
|
| 18 | - 'last_name' => 'Ccccc', |
|
| 19 | - 'phone_number' => '454-454544', |
|
| 20 | - 'company_name' => 'c_name', |
|
| 21 | - 'member_id' => '123456', |
|
| 22 | - 'webinar_date' => '2016-06-05 10:00:00' |
|
| 16 | + 'email_address' => '[email protected]', |
|
| 17 | + 'first_name' => 'Mmmmm', |
|
| 18 | + 'last_name' => 'Ccccc', |
|
| 19 | + 'phone_number' => '454-454544', |
|
| 20 | + 'company_name' => 'c_name', |
|
| 21 | + 'member_id' => '123456', |
|
| 22 | + 'webinar_date' => '2016-06-05 10:00:00' |
|
| 23 | 23 | )); |
| 24 | 24 | |
| 25 | 25 | $member = new Member(); |
@@ -17,10 +17,10 @@ |
||
| 17 | 17 | // Example refers to the process of searching for text and specifing returned fields. |
| 18 | 18 | |
| 19 | 19 | $params = array( |
| 20 | - 'query' => 'David', |
|
| 21 | - 'fields' => 'first_name,address_email', |
|
| 22 | - 'offset' => 0, |
|
| 23 | - 'limit' => 5 |
|
| 20 | + 'query' => 'David', |
|
| 21 | + 'fields' => 'first_name,address_email', |
|
| 22 | + 'offset' => 0, |
|
| 23 | + 'limit' => 5 |
|
| 24 | 24 | ); |
| 25 | 25 | |
| 26 | 26 | $abcResult = $ablocation->searchAddressBookLocations($params); |
@@ -13,8 +13,8 @@ discard block |
||
| 13 | 13 | // Get two random locations IDs |
| 14 | 14 | |
| 15 | 15 | $adressBookLocationParameters = array( |
| 16 | - "limit" => 30, |
|
| 17 | - "offset" => 0 |
|
| 16 | + "limit" => 30, |
|
| 17 | + "offset" => 0 |
|
| 18 | 18 | ); |
| 19 | 19 | |
| 20 | 20 | $abContacts = new AddressBookLocation(); |
@@ -38,6 +38,6 @@ discard block |
||
| 38 | 38 | $results = $ablocation->getValue($abcResult, "results"); |
| 39 | 39 | |
| 40 | 40 | foreach ($results as $result) { |
| 41 | - Route4Me::simplePrint($result); |
|
| 42 | - echo "<br>"; |
|
| 41 | + Route4Me::simplePrint($result); |
|
| 42 | + echo "<br>"; |
|
| 43 | 43 | } |
@@ -12,24 +12,24 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | #region // Add a location, scheduled daily with custom data. |
| 14 | 14 | $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
| 15 | - "address_1" => "1604 PARKRIDGE PKWY, Louisville, KY, 40214", |
|
| 16 | - "address_alias" => "1604 PARKRIDGE PKWY 40214", |
|
| 17 | - "address_group" => "Scheduled daily", |
|
| 18 | - "first_name" => "Peter", |
|
| 19 | - "last_name" => "Newman", |
|
| 20 | - "address_email" => "[email protected]", |
|
| 21 | - "address_phone_number" => "65432178", |
|
| 22 | - "cached_lat" => 38.141598, |
|
| 23 | - "cached_lng" => -85.793846, |
|
| 24 | - "address_city" => "Louisville", |
|
| 25 | - "address_custom_data" => array("scheduled" => "yes", |
|
| 26 | - "serice type" => "publishing"), |
|
| 27 | - "schedule" => array(array( |
|
| 28 | - "enabled" => true, |
|
| 29 | - "mode" => "daily", |
|
| 30 | - "daily" => array("every" => 1) |
|
| 31 | - )), |
|
| 32 | - "service_time" => 900 |
|
| 15 | + "address_1" => "1604 PARKRIDGE PKWY, Louisville, KY, 40214", |
|
| 16 | + "address_alias" => "1604 PARKRIDGE PKWY 40214", |
|
| 17 | + "address_group" => "Scheduled daily", |
|
| 18 | + "first_name" => "Peter", |
|
| 19 | + "last_name" => "Newman", |
|
| 20 | + "address_email" => "[email protected]", |
|
| 21 | + "address_phone_number" => "65432178", |
|
| 22 | + "cached_lat" => 38.141598, |
|
| 23 | + "cached_lng" => -85.793846, |
|
| 24 | + "address_city" => "Louisville", |
|
| 25 | + "address_custom_data" => array("scheduled" => "yes", |
|
| 26 | + "serice type" => "publishing"), |
|
| 27 | + "schedule" => array(array( |
|
| 28 | + "enabled" => true, |
|
| 29 | + "mode" => "daily", |
|
| 30 | + "daily" => array("every" => 1) |
|
| 31 | + )), |
|
| 32 | + "service_time" => 900 |
|
| 33 | 33 | )); |
| 34 | 34 | |
| 35 | 35 | $abContacts1 = new AddressBookLocation(); |
@@ -44,27 +44,27 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | #region // Add a location, scheduled weekly. |
| 46 | 46 | $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
| 47 | - "address_1" => "1407 MCCOY, Louisville, KY, 40215", |
|
| 48 | - "address_alias" => "1407 MCCOY 40215", |
|
| 49 | - "address_group" => "Scheduled weekly", |
|
| 50 | - "first_name" => "Bart", |
|
| 51 | - "last_name" => "Douglas", |
|
| 52 | - "address_email" => "[email protected]", |
|
| 53 | - "address_phone_number" => "95487454", |
|
| 54 | - "cached_lat" => 38.202496, |
|
| 55 | - "cached_lng" => -85.786514, |
|
| 56 | - "curbside_lat" => 38.202496, |
|
| 57 | - "curbside_lng" => -85.786514, |
|
| 58 | - "address_city" => "Louisville", |
|
| 59 | - "schedule" => array(array( |
|
| 60 | - "enabled" => true, |
|
| 61 | - "mode" => "weekly", |
|
| 62 | - "weekly" => array( |
|
| 63 | - "every" => 1, |
|
| 64 | - "weekdays" => array(1, 2, 3, 4, 5) |
|
| 65 | - ) |
|
| 66 | - )), |
|
| 67 | - "service_time" => 600 |
|
| 47 | + "address_1" => "1407 MCCOY, Louisville, KY, 40215", |
|
| 48 | + "address_alias" => "1407 MCCOY 40215", |
|
| 49 | + "address_group" => "Scheduled weekly", |
|
| 50 | + "first_name" => "Bart", |
|
| 51 | + "last_name" => "Douglas", |
|
| 52 | + "address_email" => "[email protected]", |
|
| 53 | + "address_phone_number" => "95487454", |
|
| 54 | + "cached_lat" => 38.202496, |
|
| 55 | + "cached_lng" => -85.786514, |
|
| 56 | + "curbside_lat" => 38.202496, |
|
| 57 | + "curbside_lng" => -85.786514, |
|
| 58 | + "address_city" => "Louisville", |
|
| 59 | + "schedule" => array(array( |
|
| 60 | + "enabled" => true, |
|
| 61 | + "mode" => "weekly", |
|
| 62 | + "weekly" => array( |
|
| 63 | + "every" => 1, |
|
| 64 | + "weekdays" => array(1, 2, 3, 4, 5) |
|
| 65 | + ) |
|
| 66 | + )), |
|
| 67 | + "service_time" => 600 |
|
| 68 | 68 | )); |
| 69 | 69 | |
| 70 | 70 | $abContacts2 = new AddressBookLocation(); |
@@ -79,33 +79,33 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | #region // Add a location, scheduled monthly (dates mode). |
| 81 | 81 | $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
| 82 | - "address_1" => "4805 BELLEVUE AVE, Louisville, KY, 40215", |
|
| 83 | - "address_2" => "4806 BELLEVUE AVE, Louisville, KY, 40215", |
|
| 84 | - "address_alias" => "4805 BELLEVUE AVE 40215", |
|
| 85 | - "address_group" => "Scheduled monthly", |
|
| 86 | - "first_name" => "Bart", |
|
| 87 | - "last_name" => "Douglas", |
|
| 88 | - "address_email" => "[email protected]", |
|
| 89 | - "address_phone_number" => "95487454", |
|
| 90 | - "cached_lat" => 38.178844, |
|
| 91 | - "cached_lng" => -85.774864, |
|
| 92 | - "curbside_lat" => 38.178844, |
|
| 93 | - "curbside_lng" => -85.774864, |
|
| 94 | - "address_city" => "Louisville", |
|
| 95 | - "address_country_id" => "US", |
|
| 96 | - "address_state_id" => "KY", |
|
| 97 | - "address_zip" => "40215", |
|
| 98 | - "schedule" => array(array( |
|
| 99 | - "enabled" => true, |
|
| 100 | - "mode" => "monthly", |
|
| 101 | - "monthly" => array( |
|
| 102 | - "every" => 1, |
|
| 103 | - "mode" => "dates", |
|
| 104 | - "dates" => array(20, 22, 23, 24, 25) |
|
| 105 | - ) |
|
| 106 | - )), |
|
| 107 | - "service_time" => 750, |
|
| 108 | - "color" => "red" |
|
| 82 | + "address_1" => "4805 BELLEVUE AVE, Louisville, KY, 40215", |
|
| 83 | + "address_2" => "4806 BELLEVUE AVE, Louisville, KY, 40215", |
|
| 84 | + "address_alias" => "4805 BELLEVUE AVE 40215", |
|
| 85 | + "address_group" => "Scheduled monthly", |
|
| 86 | + "first_name" => "Bart", |
|
| 87 | + "last_name" => "Douglas", |
|
| 88 | + "address_email" => "[email protected]", |
|
| 89 | + "address_phone_number" => "95487454", |
|
| 90 | + "cached_lat" => 38.178844, |
|
| 91 | + "cached_lng" => -85.774864, |
|
| 92 | + "curbside_lat" => 38.178844, |
|
| 93 | + "curbside_lng" => -85.774864, |
|
| 94 | + "address_city" => "Louisville", |
|
| 95 | + "address_country_id" => "US", |
|
| 96 | + "address_state_id" => "KY", |
|
| 97 | + "address_zip" => "40215", |
|
| 98 | + "schedule" => array(array( |
|
| 99 | + "enabled" => true, |
|
| 100 | + "mode" => "monthly", |
|
| 101 | + "monthly" => array( |
|
| 102 | + "every" => 1, |
|
| 103 | + "mode" => "dates", |
|
| 104 | + "dates" => array(20, 22, 23, 24, 25) |
|
| 105 | + ) |
|
| 106 | + )), |
|
| 107 | + "service_time" => 750, |
|
| 108 | + "color" => "red" |
|
| 109 | 109 | )); |
| 110 | 110 | |
| 111 | 111 | $abContacts3 = new AddressBookLocation(); |
@@ -120,36 +120,36 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | #region // AAdd a location, scheduled monthly (nth mode). |
| 122 | 122 | $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
| 123 | - "address_1" => "730 CECIL AVENUE, Louisville, KY, 40211", |
|
| 124 | - "address_alias" => "730 CECIL AVENUE 40211", |
|
| 125 | - "address_group" => "Scheduled monthly", |
|
| 126 | - "first_name" => "David", |
|
| 127 | - "last_name" => "Silvester", |
|
| 128 | - "address_email" => "[email protected]", |
|
| 129 | - "address_phone_number" => "36985214", |
|
| 130 | - "cached_lat" => 38.248684, |
|
| 131 | - "cached_lng" => -85.821121, |
|
| 132 | - "curbside_lat" => 38.248684, |
|
| 133 | - "curbside_lng" => -85.821121, |
|
| 134 | - "address_city" => "Louisville", |
|
| 135 | - "address_custom_data" => array( |
|
| 136 | - "scheduled" => "yes", |
|
| 137 | - "service type" => "library" |
|
| 138 | - ), |
|
| 139 | - "schedule" => array(array( |
|
| 140 | - "enabled" => true, |
|
| 141 | - "mode" => "monthly", |
|
| 142 | - "monthly" => array( |
|
| 143 | - "every" => 1, |
|
| 144 | - "mode" => "nth", |
|
| 145 | - "nth" => array( |
|
| 146 | - "n" => 1, |
|
| 147 | - "what" => 4 |
|
| 148 | - ) |
|
| 149 | - ) |
|
| 150 | - )), |
|
| 151 | - "service_time" => 450, |
|
| 152 | - "address_icon" => "emoji/emoji-bus" |
|
| 123 | + "address_1" => "730 CECIL AVENUE, Louisville, KY, 40211", |
|
| 124 | + "address_alias" => "730 CECIL AVENUE 40211", |
|
| 125 | + "address_group" => "Scheduled monthly", |
|
| 126 | + "first_name" => "David", |
|
| 127 | + "last_name" => "Silvester", |
|
| 128 | + "address_email" => "[email protected]", |
|
| 129 | + "address_phone_number" => "36985214", |
|
| 130 | + "cached_lat" => 38.248684, |
|
| 131 | + "cached_lng" => -85.821121, |
|
| 132 | + "curbside_lat" => 38.248684, |
|
| 133 | + "curbside_lng" => -85.821121, |
|
| 134 | + "address_city" => "Louisville", |
|
| 135 | + "address_custom_data" => array( |
|
| 136 | + "scheduled" => "yes", |
|
| 137 | + "service type" => "library" |
|
| 138 | + ), |
|
| 139 | + "schedule" => array(array( |
|
| 140 | + "enabled" => true, |
|
| 141 | + "mode" => "monthly", |
|
| 142 | + "monthly" => array( |
|
| 143 | + "every" => 1, |
|
| 144 | + "mode" => "nth", |
|
| 145 | + "nth" => array( |
|
| 146 | + "n" => 1, |
|
| 147 | + "what" => 4 |
|
| 148 | + ) |
|
| 149 | + ) |
|
| 150 | + )), |
|
| 151 | + "service_time" => 450, |
|
| 152 | + "address_icon" => "emoji/emoji-bus" |
|
| 153 | 153 | )); |
| 154 | 154 | |
| 155 | 155 | $abContacts4 = new AddressBookLocation(); |
@@ -165,29 +165,29 @@ discard block |
||
| 165 | 165 | #region // Add a location with the daily scheduling and blacklist. |
| 166 | 166 | $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
| 167 | 167 | |
| 168 | - "address_1" => "4629 HILLSIDE DRIVE, Louisville, KY, 40216", |
|
| 169 | - "address_alias" => "4629 HILLSIDE DRIVE 40216", |
|
| 170 | - "address_group" => "Scheduled daily", |
|
| 171 | - "first_name" => "Kim", |
|
| 172 | - "last_name" => "Shandor", |
|
| 173 | - "address_email" => "[email protected]", |
|
| 174 | - "address_phone_number" => "9874152", |
|
| 175 | - "cached_lat" => 38.176067, |
|
| 176 | - "cached_lng" => -85.824638, |
|
| 177 | - "curbside_lat" => 38.176067, |
|
| 178 | - "curbside_lng" => -85.824638, |
|
| 179 | - "address_city" => "Louisville", |
|
| 180 | - "address_custom_data" => array( |
|
| 181 | - "scheduled" => "yes", |
|
| 182 | - "serice type" => "appliance" |
|
| 183 | - ), |
|
| 184 | - "schedule" => array( |
|
| 185 | - "enabled" => true, |
|
| 186 | - "mode" => "daily", |
|
| 187 | - "daily" => array("every" => 1) |
|
| 188 | - ), |
|
| 189 | - "schedule_blacklist" => array("2017-02-24", "2017-02-25"), |
|
| 190 | - "service_time" => 300 |
|
| 168 | + "address_1" => "4629 HILLSIDE DRIVE, Louisville, KY, 40216", |
|
| 169 | + "address_alias" => "4629 HILLSIDE DRIVE 40216", |
|
| 170 | + "address_group" => "Scheduled daily", |
|
| 171 | + "first_name" => "Kim", |
|
| 172 | + "last_name" => "Shandor", |
|
| 173 | + "address_email" => "[email protected]", |
|
| 174 | + "address_phone_number" => "9874152", |
|
| 175 | + "cached_lat" => 38.176067, |
|
| 176 | + "cached_lng" => -85.824638, |
|
| 177 | + "curbside_lat" => 38.176067, |
|
| 178 | + "curbside_lng" => -85.824638, |
|
| 179 | + "address_city" => "Louisville", |
|
| 180 | + "address_custom_data" => array( |
|
| 181 | + "scheduled" => "yes", |
|
| 182 | + "serice type" => "appliance" |
|
| 183 | + ), |
|
| 184 | + "schedule" => array( |
|
| 185 | + "enabled" => true, |
|
| 186 | + "mode" => "daily", |
|
| 187 | + "daily" => array("every" => 1) |
|
| 188 | + ), |
|
| 189 | + "schedule_blacklist" => array("2017-02-24", "2017-02-25"), |
|
| 190 | + "service_time" => 300 |
|
| 191 | 191 | )); |
| 192 | 192 | |
| 193 | 193 | $abContacts5 = new AddressBookLocation(); |
@@ -11,10 +11,10 @@ |
||
| 11 | 11 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 12 | 12 | |
| 13 | 13 | $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
| 14 | - "first_name" => "Test FirstName ".strval(rand(10000, 99999)), |
|
| 15 | - "address_1" => "Test Address1 ".strval(rand(10000, 99999)), |
|
| 16 | - "cached_lat" => 38.024654, |
|
| 17 | - "cached_lng" => -77.338814 |
|
| 14 | + "first_name" => "Test FirstName ".strval(rand(10000, 99999)), |
|
| 15 | + "address_1" => "Test Address1 ".strval(rand(10000, 99999)), |
|
| 16 | + "cached_lat" => 38.024654, |
|
| 17 | + "cached_lng" => -77.338814 |
|
| 18 | 18 | )); |
| 19 | 19 | |
| 20 | 20 | $abContacts = new AddressBookLocation(); |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | assert(!is_null($routeId), "Can't retrieve random route_id"); |
| 21 | 21 | |
| 22 | 22 | $activityParameters = ActivityParameters::fromArray(array( |
| 23 | - "route_id" => $routeId, |
|
| 24 | - "team" => "true" |
|
| 23 | + "route_id" => $routeId, |
|
| 24 | + "team" => "true" |
|
| 25 | 25 | )); |
| 26 | 26 | |
| 27 | 27 | $activities = new ActivityParameters(); |
@@ -30,5 +30,5 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | foreach ($results as $result) { |
| 32 | 32 | Route4Me::simplePrint($result); |
| 33 | - echo "<br>"; |
|
| 33 | + echo "<br>"; |
|
| 34 | 34 | } |