@@ -10,42 +10,42 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class SearchResponse |
| 12 | 12 | { |
| 13 | - /** |
|
| 14 | - * An array of the AddressBookContact type objects. |
|
| 15 | - * @var AddressBookLocation[] |
|
| 16 | - */ |
|
| 17 | - public $results=[]; |
|
| 18 | - |
|
| 19 | - /** |
|
| 20 | - * Total number of the returned contacts |
|
| 21 | - * @var integer |
|
| 22 | - */ |
|
| 23 | - public $total; |
|
| 24 | - |
|
| 25 | - /** |
|
| 26 | - * An array of the field names to be shown |
|
| 27 | - * @var string[] |
|
| 28 | - */ |
|
| 29 | - public $fields=[]; |
|
| 30 | - |
|
| 31 | - /** |
|
| 32 | - * The contacts query in the JSON format |
|
| 33 | - * @var string |
|
| 34 | - */ |
|
| 35 | - public $index_query; |
|
| 36 | - |
|
| 37 | - public static function fromArray(array $params) |
|
| 38 | - { |
|
| 39 | - $searchResponse = new self(); |
|
| 40 | - |
|
| 41 | - foreach ($params as $key => $value) { |
|
| 42 | - if (property_exists($searchResponse, $key)) { |
|
| 43 | - $searchResponse->{$key} = $value; |
|
| 44 | - } else { |
|
| 45 | - throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key"); |
|
| 46 | - } |
|
| 47 | - } |
|
| 48 | - |
|
| 49 | - return $searchResponse; |
|
| 50 | - } |
|
| 13 | + /** |
|
| 14 | + * An array of the AddressBookContact type objects. |
|
| 15 | + * @var AddressBookLocation[] |
|
| 16 | + */ |
|
| 17 | + public $results=[]; |
|
| 18 | + |
|
| 19 | + /** |
|
| 20 | + * Total number of the returned contacts |
|
| 21 | + * @var integer |
|
| 22 | + */ |
|
| 23 | + public $total; |
|
| 24 | + |
|
| 25 | + /** |
|
| 26 | + * An array of the field names to be shown |
|
| 27 | + * @var string[] |
|
| 28 | + */ |
|
| 29 | + public $fields=[]; |
|
| 30 | + |
|
| 31 | + /** |
|
| 32 | + * The contacts query in the JSON format |
|
| 33 | + * @var string |
|
| 34 | + */ |
|
| 35 | + public $index_query; |
|
| 36 | + |
|
| 37 | + public static function fromArray(array $params) |
|
| 38 | + { |
|
| 39 | + $searchResponse = new self(); |
|
| 40 | + |
|
| 41 | + foreach ($params as $key => $value) { |
|
| 42 | + if (property_exists($searchResponse, $key)) { |
|
| 43 | + $searchResponse->{$key} = $value; |
|
| 44 | + } else { |
|
| 45 | + throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key"); |
|
| 46 | + } |
|
| 47 | + } |
|
| 48 | + |
|
| 49 | + return $searchResponse; |
|
| 50 | + } |
|
| 51 | 51 | } |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | * An array of the AddressBookContact type objects. |
| 15 | 15 | * @var AddressBookLocation[] |
| 16 | 16 | */ |
| 17 | - public $results=[]; |
|
| 17 | + public $results = []; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * Total number of the returned contacts |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * An array of the field names to be shown |
| 27 | 27 | * @var string[] |
| 28 | 28 | */ |
| 29 | - public $fields=[]; |
|
| 29 | + public $fields = []; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * The contacts query in the JSON format |
@@ -6,157 +6,157 @@ |
||
| 6 | 6 | |
| 7 | 7 | class AddressBookGroup extends Common |
| 8 | 8 | { |
| 9 | - public $group_id; |
|
| 10 | - public $group_name; |
|
| 11 | - public $group_color; |
|
| 12 | - public $group_icon; |
|
| 13 | - public $member_id; |
|
| 14 | - public $filter; |
|
| 15 | - |
|
| 16 | - public function __construct() |
|
| 17 | - { |
|
| 18 | - Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
| 19 | - } |
|
| 20 | - |
|
| 21 | - public static function fromArray(array $params) |
|
| 22 | - { |
|
| 23 | - $addressBookGroup = new self(); |
|
| 24 | - |
|
| 25 | - foreach ($params as $key => $value) { |
|
| 26 | - if (property_exists($addressBookGroup, $key)) { |
|
| 27 | - $addressBookGroup->{$key} = $value; |
|
| 28 | - } |
|
| 29 | - } |
|
| 30 | - |
|
| 31 | - return $addressBookGroup; |
|
| 32 | - } |
|
| 33 | - |
|
| 34 | - public static function getAddressBookGroup(array $params) |
|
| 35 | - { |
|
| 36 | - $abGroup = Route4Me::makeRequst([ |
|
| 37 | - 'url' => Endpoint::ADDRESS_BOOK_GROUP, |
|
| 38 | - 'method' => 'GET', |
|
| 39 | - 'query' => [ |
|
| 40 | - 'group_id' => isset($params['group_id']) ? $params['group_id'] : null, |
|
| 41 | - ], |
|
| 42 | - ]); |
|
| 43 | - |
|
| 44 | - return $abGroup; |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - public static function updateAddressBookGroup(array $params) |
|
| 48 | - { |
|
| 49 | - $allBodyFields = ['group_id', 'group_color', 'group_icon', 'filter']; |
|
| 50 | - |
|
| 51 | - $abGroup = Route4Me::makeRequst([ |
|
| 52 | - 'url' => Endpoint::ADDRESS_BOOK_GROUP, |
|
| 53 | - 'method' => 'PUT', |
|
| 54 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 55 | - ]); |
|
| 56 | - |
|
| 57 | - return $abGroup; |
|
| 58 | - } |
|
| 59 | - |
|
| 60 | - public static function removeAddressBookGroup(array $params) |
|
| 61 | - { |
|
| 62 | - $allBodyFields = ['group_id']; |
|
| 63 | - |
|
| 64 | - $abGroup = Route4Me::makeRequst([ |
|
| 65 | - 'url' => Endpoint::ADDRESS_BOOK_GROUP, |
|
| 66 | - 'method' => 'DELETE', |
|
| 67 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 68 | - ]); |
|
| 69 | - |
|
| 70 | - return $abGroup; |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - public static function createAddressBookGroup(array $params) |
|
| 74 | - { |
|
| 75 | - $allBodyFields = ['group_name', 'group_color', 'group_icon', 'filter']; |
|
| 76 | - |
|
| 77 | - $abGroup = Route4Me::makeRequst([ |
|
| 78 | - 'url' => Endpoint::ADDRESS_BOOK_GROUP, |
|
| 79 | - 'method' => 'POST', |
|
| 80 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 81 | - ]); |
|
| 82 | - |
|
| 83 | - return $abGroup; |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - public static function searchAddressBookGroups(array $params) |
|
| 87 | - { |
|
| 88 | - $allBodyFields = ['fields', 'offset', 'limit', 'filter']; |
|
| 89 | - |
|
| 90 | - $abGroups = Route4Me::makeRequst([ |
|
| 91 | - 'url' => Endpoint::ADDRESS_BOOK_V4, |
|
| 92 | - 'method' => 'POST', |
|
| 93 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 94 | - ]); |
|
| 95 | - |
|
| 96 | - return $abGroups; |
|
| 97 | - } |
|
| 98 | - |
|
| 99 | - public static function getAddressBookContactsByGroup(array $params) |
|
| 100 | - { |
|
| 101 | - $allBodyFields = ['fields', 'group_id']; |
|
| 102 | - |
|
| 103 | - $abGroups = Route4Me::makeRequst([ |
|
| 104 | - 'url' => Endpoint::ADDRESS_BOOK_SEARCH, |
|
| 105 | - 'method' => 'POST', |
|
| 106 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 107 | - ]); |
|
| 108 | - |
|
| 109 | - return $abGroups; |
|
| 110 | - } |
|
| 111 | - |
|
| 112 | - public static function getAddressBookGroups(array $params) |
|
| 113 | - { |
|
| 114 | - $abGroup = Route4Me::makeRequst([ |
|
| 115 | - 'url' => Endpoint::ADDRESS_BOOK_GROUP, |
|
| 116 | - 'method' => 'GET', |
|
| 117 | - 'query' => [ |
|
| 118 | - 'offset' => isset($params['offset']) ? $params['offset'] : null, |
|
| 119 | - 'limit' => isset($params['limit']) ? $params['limit'] : null, |
|
| 120 | - ], |
|
| 121 | - ]); |
|
| 122 | - |
|
| 123 | - return $abGroup; |
|
| 124 | - } |
|
| 125 | - |
|
| 126 | - public static function getRandomAddressBookGroup(array $params) |
|
| 127 | - { |
|
| 128 | - $abGroups = self::getAddressBookGroups($params); |
|
| 129 | - |
|
| 130 | - if (isset($abGroups) && sizeof($abGroups>1)) { |
|
| 131 | - $groupsSize = sizeof($abGroups); |
|
| 132 | - |
|
| 133 | - $randomGroupIndex = rand(0, $groupsSize - 1); |
|
| 134 | - |
|
| 135 | - return $abGroups[$randomGroupIndex]; |
|
| 136 | - } |
|
| 137 | - |
|
| 138 | - return null; |
|
| 139 | - } |
|
| 140 | - |
|
| 141 | - /* |
|
| 9 | + public $group_id; |
|
| 10 | + public $group_name; |
|
| 11 | + public $group_color; |
|
| 12 | + public $group_icon; |
|
| 13 | + public $member_id; |
|
| 14 | + public $filter; |
|
| 15 | + |
|
| 16 | + public function __construct() |
|
| 17 | + { |
|
| 18 | + Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
| 19 | + } |
|
| 20 | + |
|
| 21 | + public static function fromArray(array $params) |
|
| 22 | + { |
|
| 23 | + $addressBookGroup = new self(); |
|
| 24 | + |
|
| 25 | + foreach ($params as $key => $value) { |
|
| 26 | + if (property_exists($addressBookGroup, $key)) { |
|
| 27 | + $addressBookGroup->{$key} = $value; |
|
| 28 | + } |
|
| 29 | + } |
|
| 30 | + |
|
| 31 | + return $addressBookGroup; |
|
| 32 | + } |
|
| 33 | + |
|
| 34 | + public static function getAddressBookGroup(array $params) |
|
| 35 | + { |
|
| 36 | + $abGroup = Route4Me::makeRequst([ |
|
| 37 | + 'url' => Endpoint::ADDRESS_BOOK_GROUP, |
|
| 38 | + 'method' => 'GET', |
|
| 39 | + 'query' => [ |
|
| 40 | + 'group_id' => isset($params['group_id']) ? $params['group_id'] : null, |
|
| 41 | + ], |
|
| 42 | + ]); |
|
| 43 | + |
|
| 44 | + return $abGroup; |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + public static function updateAddressBookGroup(array $params) |
|
| 48 | + { |
|
| 49 | + $allBodyFields = ['group_id', 'group_color', 'group_icon', 'filter']; |
|
| 50 | + |
|
| 51 | + $abGroup = Route4Me::makeRequst([ |
|
| 52 | + 'url' => Endpoint::ADDRESS_BOOK_GROUP, |
|
| 53 | + 'method' => 'PUT', |
|
| 54 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 55 | + ]); |
|
| 56 | + |
|
| 57 | + return $abGroup; |
|
| 58 | + } |
|
| 59 | + |
|
| 60 | + public static function removeAddressBookGroup(array $params) |
|
| 61 | + { |
|
| 62 | + $allBodyFields = ['group_id']; |
|
| 63 | + |
|
| 64 | + $abGroup = Route4Me::makeRequst([ |
|
| 65 | + 'url' => Endpoint::ADDRESS_BOOK_GROUP, |
|
| 66 | + 'method' => 'DELETE', |
|
| 67 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 68 | + ]); |
|
| 69 | + |
|
| 70 | + return $abGroup; |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + public static function createAddressBookGroup(array $params) |
|
| 74 | + { |
|
| 75 | + $allBodyFields = ['group_name', 'group_color', 'group_icon', 'filter']; |
|
| 76 | + |
|
| 77 | + $abGroup = Route4Me::makeRequst([ |
|
| 78 | + 'url' => Endpoint::ADDRESS_BOOK_GROUP, |
|
| 79 | + 'method' => 'POST', |
|
| 80 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 81 | + ]); |
|
| 82 | + |
|
| 83 | + return $abGroup; |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + public static function searchAddressBookGroups(array $params) |
|
| 87 | + { |
|
| 88 | + $allBodyFields = ['fields', 'offset', 'limit', 'filter']; |
|
| 89 | + |
|
| 90 | + $abGroups = Route4Me::makeRequst([ |
|
| 91 | + 'url' => Endpoint::ADDRESS_BOOK_V4, |
|
| 92 | + 'method' => 'POST', |
|
| 93 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 94 | + ]); |
|
| 95 | + |
|
| 96 | + return $abGroups; |
|
| 97 | + } |
|
| 98 | + |
|
| 99 | + public static function getAddressBookContactsByGroup(array $params) |
|
| 100 | + { |
|
| 101 | + $allBodyFields = ['fields', 'group_id']; |
|
| 102 | + |
|
| 103 | + $abGroups = Route4Me::makeRequst([ |
|
| 104 | + 'url' => Endpoint::ADDRESS_BOOK_SEARCH, |
|
| 105 | + 'method' => 'POST', |
|
| 106 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
| 107 | + ]); |
|
| 108 | + |
|
| 109 | + return $abGroups; |
|
| 110 | + } |
|
| 111 | + |
|
| 112 | + public static function getAddressBookGroups(array $params) |
|
| 113 | + { |
|
| 114 | + $abGroup = Route4Me::makeRequst([ |
|
| 115 | + 'url' => Endpoint::ADDRESS_BOOK_GROUP, |
|
| 116 | + 'method' => 'GET', |
|
| 117 | + 'query' => [ |
|
| 118 | + 'offset' => isset($params['offset']) ? $params['offset'] : null, |
|
| 119 | + 'limit' => isset($params['limit']) ? $params['limit'] : null, |
|
| 120 | + ], |
|
| 121 | + ]); |
|
| 122 | + |
|
| 123 | + return $abGroup; |
|
| 124 | + } |
|
| 125 | + |
|
| 126 | + public static function getRandomAddressBookGroup(array $params) |
|
| 127 | + { |
|
| 128 | + $abGroups = self::getAddressBookGroups($params); |
|
| 129 | + |
|
| 130 | + if (isset($abGroups) && sizeof($abGroups>1)) { |
|
| 131 | + $groupsSize = sizeof($abGroups); |
|
| 132 | + |
|
| 133 | + $randomGroupIndex = rand(0, $groupsSize - 1); |
|
| 134 | + |
|
| 135 | + return $abGroups[$randomGroupIndex]; |
|
| 136 | + } |
|
| 137 | + |
|
| 138 | + return null; |
|
| 139 | + } |
|
| 140 | + |
|
| 141 | + /* |
|
| 142 | 142 | * Gets an array of the address book contact groups with a specified name. |
| 143 | 143 | * @param string $name |
| 144 | 144 | * Address book contact group name |
| 145 | 145 | */ |
| 146 | - public static function getAddressBookGroupIdByName($name) |
|
| 147 | - { |
|
| 148 | - $abGroups = self::getAddressBookGroups(['offset'=>0,'limit'=>100]); |
|
| 149 | - |
|
| 150 | - $abGroupId = []; |
|
| 151 | - |
|
| 152 | - foreach ($abGroups as $abg) { |
|
| 153 | - if (isset($abg['group_name'])) { |
|
| 154 | - if ($abg['group_name']==$name) { |
|
| 155 | - $abGroupId[] = $abg['group_id']; |
|
| 156 | - } |
|
| 157 | - } |
|
| 158 | - } |
|
| 159 | - |
|
| 160 | - return $abGroupId; |
|
| 161 | - } |
|
| 146 | + public static function getAddressBookGroupIdByName($name) |
|
| 147 | + { |
|
| 148 | + $abGroups = self::getAddressBookGroups(['offset'=>0,'limit'=>100]); |
|
| 149 | + |
|
| 150 | + $abGroupId = []; |
|
| 151 | + |
|
| 152 | + foreach ($abGroups as $abg) { |
|
| 153 | + if (isset($abg['group_name'])) { |
|
| 154 | + if ($abg['group_name']==$name) { |
|
| 155 | + $abGroupId[] = $abg['group_id']; |
|
| 156 | + } |
|
| 157 | + } |
|
| 158 | + } |
|
| 159 | + |
|
| 160 | + return $abGroupId; |
|
| 161 | + } |
|
| 162 | 162 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | 'url' => Endpoint::ADDRESS_BOOK_GROUP, |
| 38 | 38 | 'method' => 'GET', |
| 39 | 39 | 'query' => [ |
| 40 | - 'group_id' => isset($params['group_id']) ? $params['group_id'] : null, |
|
| 40 | + 'group_id' => isset($params['group_id']) ? $params['group_id'] : null, |
|
| 41 | 41 | ], |
| 42 | 42 | ]); |
| 43 | 43 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | 'method' => 'GET', |
| 117 | 117 | 'query' => [ |
| 118 | 118 | 'offset' => isset($params['offset']) ? $params['offset'] : null, |
| 119 | - 'limit' => isset($params['limit']) ? $params['limit'] : null, |
|
| 119 | + 'limit' => isset($params['limit']) ? $params['limit'] : null, |
|
| 120 | 120 | ], |
| 121 | 121 | ]); |
| 122 | 122 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public static function getAddressBookGroupIdByName($name) |
| 147 | 147 | { |
| 148 | - $abGroups = self::getAddressBookGroups(['offset'=>0,'limit'=>100]); |
|
| 148 | + $abGroups = self::getAddressBookGroups(['offset'=>0, 'limit'=>100]); |
|
| 149 | 149 | |
| 150 | 150 | $abGroupId = []; |
| 151 | 151 | |
@@ -9,162 +9,162 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | class RouteParametersQuery extends Common |
| 11 | 11 | { |
| 12 | - /** |
|
| 13 | - * Route unique identifier |
|
| 14 | - * @var string |
|
| 15 | - */ |
|
| 16 | - public $route_id; |
|
| 17 | - |
|
| 18 | - /** |
|
| 19 | - * Pass True to return directions and the route path. |
|
| 20 | - * @var boolean |
|
| 21 | - */ |
|
| 22 | - public $directions; |
|
| 23 | - |
|
| 24 | - /** |
|
| 25 | - * Available values: |
|
| 26 | - * - 'None' - no path output. |
|
| 27 | - * - 'Points' - points path output |
|
| 28 | - * @var string |
|
| 29 | - */ |
|
| 30 | - public $route_path_output; |
|
| 31 | - |
|
| 32 | - /** |
|
| 33 | - * Output route tracking data in response. |
|
| 34 | - * @var boolean |
|
| 35 | - */ |
|
| 36 | - public $device_tracking_history; |
|
| 37 | - |
|
| 38 | - /** |
|
| 39 | - * The number of existing routes that should be returned per response |
|
| 40 | - * when looking at a list of all the routes. |
|
| 41 | - * @var integer |
|
| 42 | - */ |
|
| 43 | - public $limit; |
|
| 44 | - |
|
| 45 | - /** |
|
| 46 | - * The page number for route listing pagination.<br> |
|
| 47 | - * Increment the offset by the limit number to move to the next page. |
|
| 48 | - * @var integer |
|
| 49 | - */ |
|
| 50 | - public $offset; |
|
| 51 | - |
|
| 52 | - /** |
|
| 53 | - * Start date to filter |
|
| 54 | - * @var string |
|
| 55 | - */ |
|
| 56 | - public $start_date; |
|
| 57 | - |
|
| 58 | - /** |
|
| 59 | - * End date to filter |
|
| 60 | - * @var string |
|
| 61 | - */ |
|
| 62 | - public $end_date; |
|
| 63 | - |
|
| 64 | - /** |
|
| 65 | - * Output addresses and directions in the original optimization request sequence.<br> |
|
| 66 | - * This is to allow us to compare routes before & after optimization. |
|
| 67 | - * @var boolean |
|
| 68 | - */ |
|
| 69 | - public $original; |
|
| 70 | - |
|
| 71 | - /** |
|
| 72 | - * Output route and stop-specific notes. The notes will have timestamps, |
|
| 73 | - * note types, and geospatial information if available. |
|
| 74 | - * @var boolean |
|
| 75 | - */ |
|
| 76 | - public $notes; |
|
| 77 | - |
|
| 78 | - /** |
|
| 79 | - * If true, the order inventory info included in the response. |
|
| 80 | - * @var boolean |
|
| 81 | - */ |
|
| 82 | - public $order_inventory; |
|
| 83 | - |
|
| 84 | - /** |
|
| 85 | - * If true, not visited destinations of an active route re-optimized (re-sequenced). |
|
| 86 | - * @var boolean |
|
| 87 | - */ |
|
| 88 | - public $remaining; |
|
| 89 | - |
|
| 90 | - /** |
|
| 91 | - * Search query |
|
| 92 | - * @var string |
|
| 93 | - */ |
|
| 94 | - public $query; |
|
| 95 | - |
|
| 96 | - /** |
|
| 97 | - * Updating a route supports the reoptimize=1 parameter, |
|
| 98 | - * which reoptimizes only that route.<br> |
|
| 99 | - * Also supports the parameters from GET. |
|
| 100 | - * @var boolean |
|
| 101 | - */ |
|
| 102 | - public $reoptimize; |
|
| 103 | - |
|
| 104 | - /** |
|
| 105 | - * Whether disable or not a route optimization.<br> |
|
| 106 | - * Available values: |
|
| 107 | - * - true - disable a route optimization; |
|
| 108 | - * - false - not disable a route optimization. |
|
| 109 | - * @var boolean |
|
| 110 | - */ |
|
| 111 | - public $disable_optimization; |
|
| 112 | - |
|
| 113 | - /** |
|
| 114 | - * The driving directions will be generated biased for this selection. |
|
| 115 | - * This has no impact on route sequencing.<br> |
|
| 116 | - * Available values: |
|
| 117 | - * - 'Distance'; |
|
| 118 | - * - 'Time'; |
|
| 119 | - * - 'timeWithTraffic'. |
|
| 120 | - * @var boolean |
|
| 121 | - */ |
|
| 122 | - public $optimize; |
|
| 123 | - |
|
| 124 | - /** |
|
| 125 | - * By sending recompute_directions=1 we request that the route directions |
|
| 126 | - * be recomputed (note that this does happen automatically if certain properties |
|
| 127 | - * of the route are updated, such as stop sequence_no changes or round-tripness) |
|
| 128 | - * @var boolean |
|
| 129 | - */ |
|
| 130 | - public $recompute_directions; |
|
| 131 | - |
|
| 132 | - /** |
|
| 133 | - * Response format('json', 'csv', 'xml') |
|
| 134 | - * @var string |
|
| 135 | - */ |
|
| 136 | - public $response_format; |
|
| 137 | - |
|
| 138 | - /** |
|
| 139 | - * Identifier of a route destination. |
|
| 140 | - * @var integer |
|
| 141 | - */ |
|
| 142 | - public $route_destination_id; |
|
| 143 | - |
|
| 144 | - /** |
|
| 145 | - * If true, will be redirected |
|
| 146 | - * @var boolean |
|
| 147 | - */ |
|
| 148 | - public $redirect; |
|
| 149 | - |
|
| 150 | - /** |
|
| 151 | - * If true, the address bundling info is included into route response. |
|
| 152 | - * @var boolean |
|
| 153 | - */ |
|
| 154 | - public $bundling_items; |
|
| 155 | - |
|
| 156 | - public $device_type; |
|
| 157 | - |
|
| 158 | - public static function fromArray(array $params) |
|
| 159 | - { |
|
| 160 | - $routeQueryParams = new self(); |
|
| 161 | - foreach ($params as $key => $value) { |
|
| 162 | - if (property_exists($routeQueryParams, $key)) { |
|
| 163 | - $routeQueryParams->{$key} = $value; |
|
| 164 | - } |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - return $routeQueryParams; |
|
| 168 | - } |
|
| 12 | + /** |
|
| 13 | + * Route unique identifier |
|
| 14 | + * @var string |
|
| 15 | + */ |
|
| 16 | + public $route_id; |
|
| 17 | + |
|
| 18 | + /** |
|
| 19 | + * Pass True to return directions and the route path. |
|
| 20 | + * @var boolean |
|
| 21 | + */ |
|
| 22 | + public $directions; |
|
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * Available values: |
|
| 26 | + * - 'None' - no path output. |
|
| 27 | + * - 'Points' - points path output |
|
| 28 | + * @var string |
|
| 29 | + */ |
|
| 30 | + public $route_path_output; |
|
| 31 | + |
|
| 32 | + /** |
|
| 33 | + * Output route tracking data in response. |
|
| 34 | + * @var boolean |
|
| 35 | + */ |
|
| 36 | + public $device_tracking_history; |
|
| 37 | + |
|
| 38 | + /** |
|
| 39 | + * The number of existing routes that should be returned per response |
|
| 40 | + * when looking at a list of all the routes. |
|
| 41 | + * @var integer |
|
| 42 | + */ |
|
| 43 | + public $limit; |
|
| 44 | + |
|
| 45 | + /** |
|
| 46 | + * The page number for route listing pagination.<br> |
|
| 47 | + * Increment the offset by the limit number to move to the next page. |
|
| 48 | + * @var integer |
|
| 49 | + */ |
|
| 50 | + public $offset; |
|
| 51 | + |
|
| 52 | + /** |
|
| 53 | + * Start date to filter |
|
| 54 | + * @var string |
|
| 55 | + */ |
|
| 56 | + public $start_date; |
|
| 57 | + |
|
| 58 | + /** |
|
| 59 | + * End date to filter |
|
| 60 | + * @var string |
|
| 61 | + */ |
|
| 62 | + public $end_date; |
|
| 63 | + |
|
| 64 | + /** |
|
| 65 | + * Output addresses and directions in the original optimization request sequence.<br> |
|
| 66 | + * This is to allow us to compare routes before & after optimization. |
|
| 67 | + * @var boolean |
|
| 68 | + */ |
|
| 69 | + public $original; |
|
| 70 | + |
|
| 71 | + /** |
|
| 72 | + * Output route and stop-specific notes. The notes will have timestamps, |
|
| 73 | + * note types, and geospatial information if available. |
|
| 74 | + * @var boolean |
|
| 75 | + */ |
|
| 76 | + public $notes; |
|
| 77 | + |
|
| 78 | + /** |
|
| 79 | + * If true, the order inventory info included in the response. |
|
| 80 | + * @var boolean |
|
| 81 | + */ |
|
| 82 | + public $order_inventory; |
|
| 83 | + |
|
| 84 | + /** |
|
| 85 | + * If true, not visited destinations of an active route re-optimized (re-sequenced). |
|
| 86 | + * @var boolean |
|
| 87 | + */ |
|
| 88 | + public $remaining; |
|
| 89 | + |
|
| 90 | + /** |
|
| 91 | + * Search query |
|
| 92 | + * @var string |
|
| 93 | + */ |
|
| 94 | + public $query; |
|
| 95 | + |
|
| 96 | + /** |
|
| 97 | + * Updating a route supports the reoptimize=1 parameter, |
|
| 98 | + * which reoptimizes only that route.<br> |
|
| 99 | + * Also supports the parameters from GET. |
|
| 100 | + * @var boolean |
|
| 101 | + */ |
|
| 102 | + public $reoptimize; |
|
| 103 | + |
|
| 104 | + /** |
|
| 105 | + * Whether disable or not a route optimization.<br> |
|
| 106 | + * Available values: |
|
| 107 | + * - true - disable a route optimization; |
|
| 108 | + * - false - not disable a route optimization. |
|
| 109 | + * @var boolean |
|
| 110 | + */ |
|
| 111 | + public $disable_optimization; |
|
| 112 | + |
|
| 113 | + /** |
|
| 114 | + * The driving directions will be generated biased for this selection. |
|
| 115 | + * This has no impact on route sequencing.<br> |
|
| 116 | + * Available values: |
|
| 117 | + * - 'Distance'; |
|
| 118 | + * - 'Time'; |
|
| 119 | + * - 'timeWithTraffic'. |
|
| 120 | + * @var boolean |
|
| 121 | + */ |
|
| 122 | + public $optimize; |
|
| 123 | + |
|
| 124 | + /** |
|
| 125 | + * By sending recompute_directions=1 we request that the route directions |
|
| 126 | + * be recomputed (note that this does happen automatically if certain properties |
|
| 127 | + * of the route are updated, such as stop sequence_no changes or round-tripness) |
|
| 128 | + * @var boolean |
|
| 129 | + */ |
|
| 130 | + public $recompute_directions; |
|
| 131 | + |
|
| 132 | + /** |
|
| 133 | + * Response format('json', 'csv', 'xml') |
|
| 134 | + * @var string |
|
| 135 | + */ |
|
| 136 | + public $response_format; |
|
| 137 | + |
|
| 138 | + /** |
|
| 139 | + * Identifier of a route destination. |
|
| 140 | + * @var integer |
|
| 141 | + */ |
|
| 142 | + public $route_destination_id; |
|
| 143 | + |
|
| 144 | + /** |
|
| 145 | + * If true, will be redirected |
|
| 146 | + * @var boolean |
|
| 147 | + */ |
|
| 148 | + public $redirect; |
|
| 149 | + |
|
| 150 | + /** |
|
| 151 | + * If true, the address bundling info is included into route response. |
|
| 152 | + * @var boolean |
|
| 153 | + */ |
|
| 154 | + public $bundling_items; |
|
| 155 | + |
|
| 156 | + public $device_type; |
|
| 157 | + |
|
| 158 | + public static function fromArray(array $params) |
|
| 159 | + { |
|
| 160 | + $routeQueryParams = new self(); |
|
| 161 | + foreach ($params as $key => $value) { |
|
| 162 | + if (property_exists($routeQueryParams, $key)) { |
|
| 163 | + $routeQueryParams->{$key} = $value; |
|
| 164 | + } |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + return $routeQueryParams; |
|
| 168 | + } |
|
| 169 | 169 | |
| 170 | 170 | } |
| 171 | 171 | \ No newline at end of file |
@@ -7,15 +7,15 @@ |
||
| 7 | 7 | */ |
| 8 | 8 | class TelematicsVendorsTypes |
| 9 | 9 | { |
| 10 | - const TOMTOM = 'tomtom'; |
|
| 10 | + const TOMTOM = 'tomtom'; |
|
| 11 | 11 | |
| 12 | - const TELETRAC = 'teletrac'; |
|
| 12 | + const TELETRAC = 'teletrac'; |
|
| 13 | 13 | |
| 14 | - const AZUGA = 'azuga'; |
|
| 14 | + const AZUGA = 'azuga'; |
|
| 15 | 15 | |
| 16 | - const GEOTAB = 'geotab'; |
|
| 16 | + const GEOTAB = 'geotab'; |
|
| 17 | 17 | |
| 18 | - const SILENT_PASSENGER = 'silentpassenger'; |
|
| 18 | + const SILENT_PASSENGER = 'silentpassenger'; |
|
| 19 | 19 | |
| 20 | - const NEW_TELETRAC = 'new_teletrac'; |
|
| 20 | + const NEW_TELETRAC = 'new_teletrac'; |
|
| 21 | 21 | } |
@@ -4,13 +4,13 @@ |
||
| 4 | 4 | |
| 5 | 5 | class AdditionalItemsMode |
| 6 | 6 | { |
| 7 | - /* |
|
| 7 | + /* |
|
| 8 | 8 | * Enumeration of the service time additional items mode: |
| 9 | 9 | * KEEP_ORIGINAL = 1, preserve original address service time (default); |
| 10 | 10 | * CUSTOM_TIME = 2, set custom times; |
| 11 | 11 | * INHERIT_FROM_PRIMARY = 3, don't add service times. |
| 12 | 12 | */ |
| 13 | - const KEEP_ORIGINAL = 1; |
|
| 14 | - const CUSTOM_TIME = 2; |
|
| 15 | - const INHERIT_FROM_PRIMARY = 3; |
|
| 13 | + const KEEP_ORIGINAL = 1; |
|
| 14 | + const CUSTOM_TIME = 2; |
|
| 15 | + const INHERIT_FROM_PRIMARY = 3; |
|
| 16 | 16 | } |
| 17 | 17 | \ No newline at end of file |
@@ -9,6 +9,6 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | class FirstItemMode |
| 11 | 11 | { |
| 12 | - const KEEP_ORIGINAL = 1; |
|
| 13 | - const CUSTOM_TIME = 2; |
|
| 12 | + const KEEP_ORIGINAL = 1; |
|
| 13 | + const CUSTOM_TIME = 2; |
|
| 14 | 14 | } |
@@ -9,6 +9,6 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | class MergeMode |
| 11 | 11 | { |
| 12 | - const KEEP_AS_SEPARATE_DESTINATIONS = 1; |
|
| 13 | - const MERGE_INTO_SINGLE_DESTINATION = 2; |
|
| 12 | + const KEEP_AS_SEPARATE_DESTINATIONS = 1; |
|
| 13 | + const MERGE_INTO_SINGLE_DESTINATION = 2; |
|
| 14 | 14 | } |
@@ -11,8 +11,8 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class Mode |
| 13 | 13 | { |
| 14 | - const ADDRESS = 1; |
|
| 15 | - const COORDINATES = 2; |
|
| 16 | - const ADDRESS_ID = 3; |
|
| 17 | - const ADDRESS_CUSTOM_FIELD = 4; |
|
| 14 | + const ADDRESS = 1; |
|
| 15 | + const COORDINATES = 2; |
|
| 16 | + const ADDRESS_ID = 3; |
|
| 17 | + const ADDRESS_CUSTOM_FIELD = 4; |
|
| 18 | 18 | } |
@@ -4,15 +4,15 @@ |
||
| 4 | 4 | |
| 5 | 5 | class AlgorithmType |
| 6 | 6 | { |
| 7 | - const STATE_NEW = 0; |
|
| 8 | - const TSP = 1; |
|
| 9 | - const VRP = 2; |
|
| 10 | - const CVRP_TW_SD = 3; |
|
| 11 | - const CVRP_TW_MD = 4; |
|
| 12 | - const TSP_TW = 5; |
|
| 13 | - const TSP_TW_CR = 6; |
|
| 14 | - const OPTIMIZATION_STATE_IN_QUEUE = 7; |
|
| 15 | - const ADVANCED_CVRP_TW = 9; |
|
| 16 | - const ALG_NONE = 100; |
|
| 17 | - const ALG_LEGACY_DISTRIBUTED = 101; |
|
| 7 | + const STATE_NEW = 0; |
|
| 8 | + const TSP = 1; |
|
| 9 | + const VRP = 2; |
|
| 10 | + const CVRP_TW_SD = 3; |
|
| 11 | + const CVRP_TW_MD = 4; |
|
| 12 | + const TSP_TW = 5; |
|
| 13 | + const TSP_TW_CR = 6; |
|
| 14 | + const OPTIMIZATION_STATE_IN_QUEUE = 7; |
|
| 15 | + const ADVANCED_CVRP_TW = 9; |
|
| 16 | + const ALG_NONE = 100; |
|
| 17 | + const ALG_LEGACY_DISTRIBUTED = 101; |
|
| 18 | 18 | } |