@@ -11,31 +11,31 @@ |
||
11 | 11 | */ |
12 | 12 | class AddressBundling extends Common |
13 | 13 | { |
14 | - /** |
|
15 | - * Address bundling mode |
|
16 | - * @see Enum\AddressBundlingModes\Mode |
|
17 | - * @var integer |
|
18 | - */ |
|
19 | - public $mode; |
|
14 | + /** |
|
15 | + * Address bundling mode |
|
16 | + * @see Enum\AddressBundlingModes\Mode |
|
17 | + * @var integer |
|
18 | + */ |
|
19 | + public $mode; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Address bundling mode parameters: |
|
23 | - * - If Mode=3, contains an array of the field names of the Address object; |
|
24 | - * - If Mode=4, contains an array of the custom fields of the Address object. |
|
25 | - * @var string[] |
|
26 | - */ |
|
27 | - public $mode_params; |
|
21 | + /** |
|
22 | + * Address bundling mode parameters: |
|
23 | + * - If Mode=3, contains an array of the field names of the Address object; |
|
24 | + * - If Mode=4, contains an array of the custom fields of the Address object. |
|
25 | + * @var string[] |
|
26 | + */ |
|
27 | + public $mode_params; |
|
28 | 28 | |
29 | - /** |
|
30 | - * Address bundling merge mode |
|
31 | - * @see Enum\AddressBundlingModes\MergeMode |
|
32 | - * @var integer |
|
33 | - */ |
|
34 | - public $merge_mode; |
|
29 | + /** |
|
30 | + * Address bundling merge mode |
|
31 | + * @see Enum\AddressBundlingModes\MergeMode |
|
32 | + * @var integer |
|
33 | + */ |
|
34 | + public $merge_mode; |
|
35 | 35 | |
36 | - /** |
|
37 | - * Service time rules of the address bundling |
|
38 | - * @var ServiceTimeRulesClass |
|
39 | - */ |
|
40 | - public $service_time_rules; |
|
36 | + /** |
|
37 | + * Service time rules of the address bundling |
|
38 | + * @var ServiceTimeRulesClass |
|
39 | + */ |
|
40 | + public $service_time_rules; |
|
41 | 41 | } |
42 | 42 | \ No newline at end of file |
@@ -12,223 +12,223 @@ |
||
12 | 12 | */ |
13 | 13 | class AddressNote extends Common |
14 | 14 | { |
15 | - /** An unique ID of a note |
|
16 | - * @var integer $note_id |
|
17 | - */ |
|
18 | - public $note_id; |
|
19 | - |
|
20 | - /** The route ID |
|
21 | - * @var string $route_id |
|
22 | - */ |
|
23 | - public $route_id; |
|
24 | - |
|
25 | - /** The route destination ID |
|
26 | - * @var integer $route_destination_id |
|
27 | - */ |
|
28 | - public $route_destination_id; |
|
29 | - |
|
30 | - /** An unique ID of an uploaded file |
|
31 | - * @var string $upload_id |
|
32 | - */ |
|
33 | - public $upload_id; |
|
34 | - |
|
35 | - /** When the note was added |
|
36 | - * @var integer $ts_added |
|
37 | - */ |
|
38 | - public $ts_added; |
|
39 | - |
|
40 | - /** The position latitude where the address note was added |
|
41 | - * @var double $lat |
|
42 | - */ |
|
43 | - public $lat; |
|
44 | - |
|
45 | - /** The position longitude where the address note was added |
|
46 | - * @var double $lng |
|
47 | - */ |
|
48 | - public $lng; |
|
49 | - |
|
50 | - /** The activity type |
|
51 | - * @var string $activity_type |
|
52 | - */ |
|
53 | - public $activity_type; |
|
54 | - |
|
55 | - /** The note text contents |
|
56 | - * @var string $contents |
|
57 | - */ |
|
58 | - public $contents; |
|
59 | - |
|
60 | - /** An upload type of the note |
|
61 | - * @var string $upload_type |
|
62 | - */ |
|
63 | - public $upload_type; |
|
64 | - |
|
65 | - /** An upload url - where a file-note was uploaded. |
|
66 | - * @var string $upload_url |
|
67 | - */ |
|
68 | - public $upload_url; |
|
69 | - |
|
70 | - /** An extension of the uploaded file. |
|
71 | - * @var string $upload_extension |
|
72 | - */ |
|
73 | - public $upload_extension; |
|
74 | - |
|
75 | - /** The device a note was uploaded from |
|
76 | - * @var string $device_type |
|
77 | - */ |
|
78 | - public $device_type; |
|
79 | - |
|
80 | - /** Array of the custom type notes |
|
81 | - * @var AddressCustomNote[] $custom_types |
|
82 | - */ |
|
83 | - public $custom_types = []; |
|
84 | - |
|
85 | - public function __construct() |
|
86 | - { |
|
87 | - |
|
88 | - } |
|
89 | - |
|
90 | - public static function fromArray(array $params) |
|
91 | - { |
|
92 | - $addressNote = new self(); |
|
93 | - |
|
94 | - foreach ($params as $key => $value) { |
|
95 | - if (property_exists($addressNote, $key)) { |
|
96 | - $addressNote->{$key} = $value; |
|
97 | - } else { |
|
98 | - throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key"); |
|
99 | - } |
|
100 | - } |
|
101 | - |
|
102 | - return $addressNote; |
|
103 | - } |
|
104 | - |
|
105 | - /*Get notes from the specified route destination |
|
15 | + /** An unique ID of a note |
|
16 | + * @var integer $note_id |
|
17 | + */ |
|
18 | + public $note_id; |
|
19 | + |
|
20 | + /** The route ID |
|
21 | + * @var string $route_id |
|
22 | + */ |
|
23 | + public $route_id; |
|
24 | + |
|
25 | + /** The route destination ID |
|
26 | + * @var integer $route_destination_id |
|
27 | + */ |
|
28 | + public $route_destination_id; |
|
29 | + |
|
30 | + /** An unique ID of an uploaded file |
|
31 | + * @var string $upload_id |
|
32 | + */ |
|
33 | + public $upload_id; |
|
34 | + |
|
35 | + /** When the note was added |
|
36 | + * @var integer $ts_added |
|
37 | + */ |
|
38 | + public $ts_added; |
|
39 | + |
|
40 | + /** The position latitude where the address note was added |
|
41 | + * @var double $lat |
|
42 | + */ |
|
43 | + public $lat; |
|
44 | + |
|
45 | + /** The position longitude where the address note was added |
|
46 | + * @var double $lng |
|
47 | + */ |
|
48 | + public $lng; |
|
49 | + |
|
50 | + /** The activity type |
|
51 | + * @var string $activity_type |
|
52 | + */ |
|
53 | + public $activity_type; |
|
54 | + |
|
55 | + /** The note text contents |
|
56 | + * @var string $contents |
|
57 | + */ |
|
58 | + public $contents; |
|
59 | + |
|
60 | + /** An upload type of the note |
|
61 | + * @var string $upload_type |
|
62 | + */ |
|
63 | + public $upload_type; |
|
64 | + |
|
65 | + /** An upload url - where a file-note was uploaded. |
|
66 | + * @var string $upload_url |
|
67 | + */ |
|
68 | + public $upload_url; |
|
69 | + |
|
70 | + /** An extension of the uploaded file. |
|
71 | + * @var string $upload_extension |
|
72 | + */ |
|
73 | + public $upload_extension; |
|
74 | + |
|
75 | + /** The device a note was uploaded from |
|
76 | + * @var string $device_type |
|
77 | + */ |
|
78 | + public $device_type; |
|
79 | + |
|
80 | + /** Array of the custom type notes |
|
81 | + * @var AddressCustomNote[] $custom_types |
|
82 | + */ |
|
83 | + public $custom_types = []; |
|
84 | + |
|
85 | + public function __construct() |
|
86 | + { |
|
87 | + |
|
88 | + } |
|
89 | + |
|
90 | + public static function fromArray(array $params) |
|
91 | + { |
|
92 | + $addressNote = new self(); |
|
93 | + |
|
94 | + foreach ($params as $key => $value) { |
|
95 | + if (property_exists($addressNote, $key)) { |
|
96 | + $addressNote->{$key} = $value; |
|
97 | + } else { |
|
98 | + throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key"); |
|
99 | + } |
|
100 | + } |
|
101 | + |
|
102 | + return $addressNote; |
|
103 | + } |
|
104 | + |
|
105 | + /*Get notes from the specified route destination |
|
106 | 106 | * Returns an address object with notes, if an address exists, otherwise - return null. |
107 | 107 | */ |
108 | - public static function GetAddressesNotes($noteParams) |
|
109 | - { |
|
110 | - $address = Route4Me::makeRequst([ |
|
111 | - 'url' => Endpoint::ADDRESS_V4, |
|
112 | - 'method' => 'GET', |
|
113 | - 'query' => [ |
|
114 | - 'route_id' => isset($noteParams['route_id']) ? $noteParams['route_id'] : null, |
|
115 | - 'route_destination_id' => isset($noteParams['route_destination_id']) |
|
116 | - ? $noteParams['route_destination_id'] : null, |
|
117 | - 'notes' => 1, |
|
118 | - ], |
|
119 | - ]); |
|
120 | - |
|
121 | - return $address; |
|
122 | - } |
|
123 | - |
|
124 | - public function createCustomNoteType($params) |
|
125 | - { |
|
126 | - $allBodyFields = ['type', 'values']; |
|
127 | - |
|
128 | - $result = Route4Me::makeRequst([ |
|
129 | - 'url' => Endpoint::NOTE_CUSTOM_TYPES_V4, |
|
130 | - 'method' => 'POST', |
|
131 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
132 | - ]); |
|
133 | - |
|
134 | - return $result; |
|
135 | - } |
|
136 | - |
|
137 | - public function removeCustomNoteType($params) |
|
138 | - { |
|
139 | - $result = Route4Me::makeRequst([ |
|
140 | - 'url' => Endpoint::NOTE_CUSTOM_TYPES_V4, |
|
141 | - 'method' => 'DELETE', |
|
142 | - 'body' => [ |
|
143 | - 'id' => isset($params['id']) ? $params['id'] : null, |
|
144 | - ], |
|
145 | - ]); |
|
146 | - |
|
147 | - return $result; |
|
148 | - } |
|
149 | - |
|
150 | - public function getAllCustomNoteTypes() |
|
151 | - { |
|
152 | - $result = Route4Me::makeRequst([ |
|
153 | - 'url' => Endpoint::NOTE_CUSTOM_TYPES_V4, |
|
154 | - 'method' => 'GET', |
|
155 | - ]); |
|
156 | - |
|
157 | - return $result; |
|
158 | - } |
|
159 | - |
|
160 | - public function getCustomNoteTypeByKey($params) |
|
161 | - { |
|
162 | - $result = Route4Me::makeRequst([ |
|
163 | - 'url' => Endpoint::NOTE_CUSTOM_TYPES_V4, |
|
164 | - 'method' => 'GET', |
|
165 | - ]); |
|
166 | - |
|
167 | - if (is_null($result) || !is_array($result)) return null; |
|
168 | - |
|
169 | - foreach ($result as $custNoteType) { |
|
170 | - if (isset($custNoteType["note_custom_type"]) && $custNoteType["note_custom_type"] == $params) { |
|
171 | - return $custNoteType; |
|
172 | - } |
|
173 | - } |
|
174 | - } |
|
175 | - |
|
176 | - public function AddAddressNote($params) |
|
177 | - { |
|
178 | - $allQueryFields = ['route_id', 'address_id', 'dev_lat', 'dev_lng', 'device_type']; |
|
179 | - $allBodyFields = ['strNoteContents', 'strUpdateType']; |
|
180 | - |
|
181 | - $result = Route4Me::makeRequst([ |
|
182 | - 'url' => Endpoint::ROUTE_NOTES_ADD, |
|
183 | - 'method' => 'POST', |
|
184 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
185 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
186 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data', |
|
187 | - ]); |
|
188 | - |
|
189 | - return $result; |
|
190 | - } |
|
191 | - |
|
192 | - public function AddNoteFile($params) |
|
193 | - { |
|
194 | - $fname = isset($params['strFilename']) ? $params['strFilename'] : null; |
|
195 | - |
|
196 | - $allQueryFields = ['route_id', 'address_id', 'dev_lat', 'dev_lng', 'device_type']; |
|
197 | - $allBodyFields = ['strFilename', 'strUpdateType', 'strNoteContents']; |
|
198 | - |
|
199 | - $result = Route4Me::makeRequst([ |
|
200 | - 'url' => Endpoint::ROUTE_NOTES_ADD, |
|
201 | - 'method' => 'POST', |
|
202 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
203 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
204 | - 'FILE' => $fname, |
|
205 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
206 | - ]); |
|
207 | - |
|
208 | - return $result; |
|
209 | - } |
|
210 | - |
|
211 | - public function addCustomNoteToRoute($params) |
|
212 | - { |
|
213 | - $customArray = []; |
|
214 | - |
|
215 | - foreach ($params as $key => $value) { |
|
216 | - if (false !== strpos($key, 'custom_note_type')) { |
|
217 | - $customArray[$key] = $value; |
|
218 | - } |
|
219 | - } |
|
220 | - |
|
221 | - $allQueryFields = ['route_id', 'address_id', 'format', 'dev_lat', 'dev_lng']; |
|
222 | - $allBodyFields = ['strUpdateType', 'strUpdateType', 'strNoteContents']; |
|
223 | - |
|
224 | - $result = Route4Me::makeRequst([ |
|
225 | - 'url' => Endpoint::ROUTE_NOTES_ADD, |
|
226 | - 'method' => 'POST', |
|
227 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
228 | - 'body' => array_merge(Route4Me::generateRequestParameters($allBodyFields, $params), $customArray), |
|
229 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data', |
|
230 | - ]); |
|
231 | - |
|
232 | - return $result; |
|
233 | - } |
|
108 | + public static function GetAddressesNotes($noteParams) |
|
109 | + { |
|
110 | + $address = Route4Me::makeRequst([ |
|
111 | + 'url' => Endpoint::ADDRESS_V4, |
|
112 | + 'method' => 'GET', |
|
113 | + 'query' => [ |
|
114 | + 'route_id' => isset($noteParams['route_id']) ? $noteParams['route_id'] : null, |
|
115 | + 'route_destination_id' => isset($noteParams['route_destination_id']) |
|
116 | + ? $noteParams['route_destination_id'] : null, |
|
117 | + 'notes' => 1, |
|
118 | + ], |
|
119 | + ]); |
|
120 | + |
|
121 | + return $address; |
|
122 | + } |
|
123 | + |
|
124 | + public function createCustomNoteType($params) |
|
125 | + { |
|
126 | + $allBodyFields = ['type', 'values']; |
|
127 | + |
|
128 | + $result = Route4Me::makeRequst([ |
|
129 | + 'url' => Endpoint::NOTE_CUSTOM_TYPES_V4, |
|
130 | + 'method' => 'POST', |
|
131 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
132 | + ]); |
|
133 | + |
|
134 | + return $result; |
|
135 | + } |
|
136 | + |
|
137 | + public function removeCustomNoteType($params) |
|
138 | + { |
|
139 | + $result = Route4Me::makeRequst([ |
|
140 | + 'url' => Endpoint::NOTE_CUSTOM_TYPES_V4, |
|
141 | + 'method' => 'DELETE', |
|
142 | + 'body' => [ |
|
143 | + 'id' => isset($params['id']) ? $params['id'] : null, |
|
144 | + ], |
|
145 | + ]); |
|
146 | + |
|
147 | + return $result; |
|
148 | + } |
|
149 | + |
|
150 | + public function getAllCustomNoteTypes() |
|
151 | + { |
|
152 | + $result = Route4Me::makeRequst([ |
|
153 | + 'url' => Endpoint::NOTE_CUSTOM_TYPES_V4, |
|
154 | + 'method' => 'GET', |
|
155 | + ]); |
|
156 | + |
|
157 | + return $result; |
|
158 | + } |
|
159 | + |
|
160 | + public function getCustomNoteTypeByKey($params) |
|
161 | + { |
|
162 | + $result = Route4Me::makeRequst([ |
|
163 | + 'url' => Endpoint::NOTE_CUSTOM_TYPES_V4, |
|
164 | + 'method' => 'GET', |
|
165 | + ]); |
|
166 | + |
|
167 | + if (is_null($result) || !is_array($result)) return null; |
|
168 | + |
|
169 | + foreach ($result as $custNoteType) { |
|
170 | + if (isset($custNoteType["note_custom_type"]) && $custNoteType["note_custom_type"] == $params) { |
|
171 | + return $custNoteType; |
|
172 | + } |
|
173 | + } |
|
174 | + } |
|
175 | + |
|
176 | + public function AddAddressNote($params) |
|
177 | + { |
|
178 | + $allQueryFields = ['route_id', 'address_id', 'dev_lat', 'dev_lng', 'device_type']; |
|
179 | + $allBodyFields = ['strNoteContents', 'strUpdateType']; |
|
180 | + |
|
181 | + $result = Route4Me::makeRequst([ |
|
182 | + 'url' => Endpoint::ROUTE_NOTES_ADD, |
|
183 | + 'method' => 'POST', |
|
184 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
185 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
186 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data', |
|
187 | + ]); |
|
188 | + |
|
189 | + return $result; |
|
190 | + } |
|
191 | + |
|
192 | + public function AddNoteFile($params) |
|
193 | + { |
|
194 | + $fname = isset($params['strFilename']) ? $params['strFilename'] : null; |
|
195 | + |
|
196 | + $allQueryFields = ['route_id', 'address_id', 'dev_lat', 'dev_lng', 'device_type']; |
|
197 | + $allBodyFields = ['strFilename', 'strUpdateType', 'strNoteContents']; |
|
198 | + |
|
199 | + $result = Route4Me::makeRequst([ |
|
200 | + 'url' => Endpoint::ROUTE_NOTES_ADD, |
|
201 | + 'method' => 'POST', |
|
202 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
203 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
204 | + 'FILE' => $fname, |
|
205 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
206 | + ]); |
|
207 | + |
|
208 | + return $result; |
|
209 | + } |
|
210 | + |
|
211 | + public function addCustomNoteToRoute($params) |
|
212 | + { |
|
213 | + $customArray = []; |
|
214 | + |
|
215 | + foreach ($params as $key => $value) { |
|
216 | + if (false !== strpos($key, 'custom_note_type')) { |
|
217 | + $customArray[$key] = $value; |
|
218 | + } |
|
219 | + } |
|
220 | + |
|
221 | + $allQueryFields = ['route_id', 'address_id', 'format', 'dev_lat', 'dev_lng']; |
|
222 | + $allBodyFields = ['strUpdateType', 'strUpdateType', 'strNoteContents']; |
|
223 | + |
|
224 | + $result = Route4Me::makeRequst([ |
|
225 | + 'url' => Endpoint::ROUTE_NOTES_ADD, |
|
226 | + 'method' => 'POST', |
|
227 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
228 | + 'body' => array_merge(Route4Me::generateRequestParameters($allBodyFields, $params), $customArray), |
|
229 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data', |
|
230 | + ]); |
|
231 | + |
|
232 | + return $result; |
|
233 | + } |
|
234 | 234 | } |
@@ -11,72 +11,72 @@ |
||
11 | 11 | */ |
12 | 12 | class RouteAdvancedConstraints extends Common |
13 | 13 | { |
14 | - /** |
|
15 | - * Maximum cargo volume per route. |
|
16 | - * @var double |
|
17 | - */ |
|
18 | - public $max_cargo_volume; |
|
14 | + /** |
|
15 | + * Maximum cargo volume per route. |
|
16 | + * @var double |
|
17 | + */ |
|
18 | + public $max_cargo_volume; |
|
19 | 19 | |
20 | - /** |
|
21 | - * Vehicle capacity.<br> |
|
22 | - * How much total cargo can be transported per route (units, e.g. cubic meters) |
|
23 | - * @var integer |
|
24 | - */ |
|
25 | - public $max_capacity; |
|
20 | + /** |
|
21 | + * Vehicle capacity.<br> |
|
22 | + * How much total cargo can be transported per route (units, e.g. cubic meters) |
|
23 | + * @var integer |
|
24 | + */ |
|
25 | + public $max_capacity; |
|
26 | 26 | |
27 | - /** |
|
28 | - * Legacy feature which permits a user to request an example number of optimized routes. |
|
29 | - * @var integer |
|
30 | - */ |
|
31 | - public $members_count; |
|
27 | + /** |
|
28 | + * Legacy feature which permits a user to request an example number of optimized routes. |
|
29 | + * @var integer |
|
30 | + */ |
|
31 | + public $members_count; |
|
32 | 32 | |
33 | - /** |
|
34 | - * An array of the available time windows (e.g. [ [25200, 75000 ] ) |
|
35 | - * @var integer[] |
|
36 | - */ |
|
37 | - public $available_time_windows; |
|
33 | + /** |
|
34 | + * An array of the available time windows (e.g. [ [25200, 75000 ] ) |
|
35 | + * @var integer[] |
|
36 | + */ |
|
37 | + public $available_time_windows; |
|
38 | 38 | |
39 | - /** |
|
40 | - * The driver tags specified in a team member's custom data.<br> |
|
41 | - * e.g. "driver skills":<br> |
|
42 | - * ["Class A CDL", "Class B CDL", "Forklift", "Skid Steer Loader", "Independent Contractor"] |
|
43 | - * @var string[] |
|
44 | - */ |
|
45 | - public $tags; |
|
39 | + /** |
|
40 | + * The driver tags specified in a team member's custom data.<br> |
|
41 | + * e.g. "driver skills":<br> |
|
42 | + * ["Class A CDL", "Class B CDL", "Forklift", "Skid Steer Loader", "Independent Contractor"] |
|
43 | + * @var string[] |
|
44 | + */ |
|
45 | + public $tags; |
|
46 | 46 | |
47 | - /** |
|
48 | - * An array of the skilled driver IDs. |
|
49 | - * @var integer[] |
|
50 | - */ |
|
51 | - public $route4me_members_id; |
|
47 | + /** |
|
48 | + * An array of the skilled driver IDs. |
|
49 | + * @var integer[] |
|
50 | + */ |
|
51 | + public $route4me_members_id; |
|
52 | 52 | |
53 | - /** |
|
54 | - * An array containing Address objects. |
|
55 | - * @var Address |
|
56 | - */ |
|
57 | - public $depot_address; |
|
53 | + /** |
|
54 | + * An array containing Address objects. |
|
55 | + * @var Address |
|
56 | + */ |
|
57 | + public $depot_address; |
|
58 | 58 | |
59 | - /** |
|
60 | - * An array of locations. |
|
61 | - * @var object[] |
|
62 | - */ |
|
63 | - public $location_sequence_pattern; |
|
59 | + /** |
|
60 | + * An array of locations. |
|
61 | + * @var object[] |
|
62 | + */ |
|
63 | + public $location_sequence_pattern; |
|
64 | 64 | |
65 | - /** |
|
66 | - * Group. |
|
67 | - * @var string |
|
68 | - */ |
|
69 | - public $group; |
|
65 | + /** |
|
66 | + * Group. |
|
67 | + * @var string |
|
68 | + */ |
|
69 | + public $group; |
|
70 | 70 | |
71 | - public static function fromArray(array $params) |
|
72 | - { |
|
73 | - $routeParams = new self(); |
|
74 | - foreach ($params as $key => $value) { |
|
75 | - if (property_exists($routeParams, $key)) { |
|
76 | - $routeParams->{$key} = $value; |
|
77 | - } |
|
78 | - } |
|
71 | + public static function fromArray(array $params) |
|
72 | + { |
|
73 | + $routeParams = new self(); |
|
74 | + foreach ($params as $key => $value) { |
|
75 | + if (property_exists($routeParams, $key)) { |
|
76 | + $routeParams->{$key} = $value; |
|
77 | + } |
|
78 | + } |
|
79 | 79 | |
80 | - return $routeParams; |
|
81 | - } |
|
80 | + return $routeParams; |
|
81 | + } |
|
82 | 82 | } |
83 | 83 | \ No newline at end of file |
@@ -12,69 +12,69 @@ |
||
12 | 12 | */ |
13 | 13 | class BundledItemResponse extends \Route4Me\Common |
14 | 14 | { |
15 | - /** Summary cube value of the bundled addresses |
|
16 | - * @var double $cube |
|
17 | - */ |
|
18 | - public $cube; |
|
19 | - |
|
20 | - /** Summary revenue value of the bundled addresses |
|
21 | - * @var double $revenue |
|
22 | - */ |
|
23 | - public $revenue; |
|
24 | - |
|
25 | - /** Summary pieces value of the bundled addresses |
|
26 | - * @var integer $pieces |
|
27 | - */ |
|
28 | - public $pieces; |
|
29 | - |
|
30 | - /** Summary weight value of the bundled addresses |
|
31 | - * @var double $weight |
|
32 | - */ |
|
33 | - public $weight; |
|
34 | - |
|
35 | - /** Summary cost value of the bundled addresses |
|
36 | - * @var double $cost |
|
37 | - */ |
|
38 | - public $cost; |
|
39 | - |
|
40 | - /** Service time of the bundled addresses |
|
41 | - * @var integer $service_time |
|
42 | - */ |
|
43 | - public $service_time; |
|
44 | - |
|
45 | - /** Time window start of the bundled addresses |
|
46 | - * @var integer $time_window_start |
|
47 | - */ |
|
48 | - public $time_window_start; |
|
49 | - |
|
50 | - /** Time window emd of the bundled addresses |
|
51 | - * @var integer $time_window_end |
|
52 | - */ |
|
53 | - public $time_window_end; |
|
54 | - |
|
55 | - /** TO DO: Adjust description |
|
56 | - * @var array $custom_data |
|
57 | - */ |
|
58 | - public $custom_data = []; |
|
59 | - |
|
60 | - /** Array of the IDs of the bundeld addresses. |
|
61 | - * @var integer[] $addresses_id |
|
62 | - */ |
|
63 | - public $addresses_id = []; |
|
64 | - |
|
65 | - public static function fromArray(array $params) |
|
66 | - { |
|
67 | - $boundedItemResp = new self(); |
|
68 | - |
|
69 | - foreach ($params as $key => $value) { |
|
70 | - if (property_exists($boundedItemResp, $key)) { |
|
71 | - $boundedItemResp->{$key} = $value; |
|
72 | - } else { |
|
73 | - throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key"); |
|
74 | - } |
|
75 | - } |
|
76 | - |
|
77 | - return $boundedItemResp; |
|
78 | - } |
|
15 | + /** Summary cube value of the bundled addresses |
|
16 | + * @var double $cube |
|
17 | + */ |
|
18 | + public $cube; |
|
19 | + |
|
20 | + /** Summary revenue value of the bundled addresses |
|
21 | + * @var double $revenue |
|
22 | + */ |
|
23 | + public $revenue; |
|
24 | + |
|
25 | + /** Summary pieces value of the bundled addresses |
|
26 | + * @var integer $pieces |
|
27 | + */ |
|
28 | + public $pieces; |
|
29 | + |
|
30 | + /** Summary weight value of the bundled addresses |
|
31 | + * @var double $weight |
|
32 | + */ |
|
33 | + public $weight; |
|
34 | + |
|
35 | + /** Summary cost value of the bundled addresses |
|
36 | + * @var double $cost |
|
37 | + */ |
|
38 | + public $cost; |
|
39 | + |
|
40 | + /** Service time of the bundled addresses |
|
41 | + * @var integer $service_time |
|
42 | + */ |
|
43 | + public $service_time; |
|
44 | + |
|
45 | + /** Time window start of the bundled addresses |
|
46 | + * @var integer $time_window_start |
|
47 | + */ |
|
48 | + public $time_window_start; |
|
49 | + |
|
50 | + /** Time window emd of the bundled addresses |
|
51 | + * @var integer $time_window_end |
|
52 | + */ |
|
53 | + public $time_window_end; |
|
54 | + |
|
55 | + /** TO DO: Adjust description |
|
56 | + * @var array $custom_data |
|
57 | + */ |
|
58 | + public $custom_data = []; |
|
59 | + |
|
60 | + /** Array of the IDs of the bundeld addresses. |
|
61 | + * @var integer[] $addresses_id |
|
62 | + */ |
|
63 | + public $addresses_id = []; |
|
64 | + |
|
65 | + public static function fromArray(array $params) |
|
66 | + { |
|
67 | + $boundedItemResp = new self(); |
|
68 | + |
|
69 | + foreach ($params as $key => $value) { |
|
70 | + if (property_exists($boundedItemResp, $key)) { |
|
71 | + $boundedItemResp->{$key} = $value; |
|
72 | + } else { |
|
73 | + throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key"); |
|
74 | + } |
|
75 | + } |
|
76 | + |
|
77 | + return $boundedItemResp; |
|
78 | + } |
|
79 | 79 | |
80 | 80 | } |
81 | 81 | \ No newline at end of file |
@@ -10,28 +10,28 @@ |
||
10 | 10 | */ |
11 | 11 | class AddressCustomNote extends \Route4Me\Common |
12 | 12 | { |
13 | - /** A unique ID (40 chars) of a custom note entry. |
|
14 | - * @var string $note_custom_entry_id |
|
15 | - */ |
|
16 | - public $note_custom_entry_id; |
|
13 | + /** A unique ID (40 chars) of a custom note entry. |
|
14 | + * @var string $note_custom_entry_id |
|
15 | + */ |
|
16 | + public $note_custom_entry_id; |
|
17 | 17 | |
18 | - /** The custom note ID. |
|
19 | - * @var string $note_id |
|
20 | - */ |
|
21 | - public $note_id; |
|
18 | + /** The custom note ID. |
|
19 | + * @var string $note_id |
|
20 | + */ |
|
21 | + public $note_id; |
|
22 | 22 | |
23 | - /** The custom note type ID. |
|
24 | - * @var string $note_custom_type_id |
|
25 | - */ |
|
26 | - public $note_custom_type_id; |
|
23 | + /** The custom note type ID. |
|
24 | + * @var string $note_custom_type_id |
|
25 | + */ |
|
26 | + public $note_custom_type_id; |
|
27 | 27 | |
28 | - /** The custom note value. |
|
29 | - * @var string $note_custom_value |
|
30 | - */ |
|
31 | - public $note_custom_value; |
|
28 | + /** The custom note value. |
|
29 | + * @var string $note_custom_value |
|
30 | + */ |
|
31 | + public $note_custom_value; |
|
32 | 32 | |
33 | - /** The custom note type. |
|
34 | - * @var string $note_custom_type |
|
35 | - */ |
|
36 | - public $note_custom_type; |
|
33 | + /** The custom note type. |
|
34 | + * @var string $note_custom_type |
|
35 | + */ |
|
36 | + public $note_custom_type; |
|
37 | 37 | } |
38 | 38 | \ No newline at end of file |
@@ -9,60 +9,60 @@ |
||
9 | 9 | */ |
10 | 10 | class Geocoding extends \Route4Me\Common |
11 | 11 | { |
12 | - /** A unique identifier for the geocoding |
|
13 | - * @var string $key |
|
14 | - */ |
|
15 | - public $key; |
|
12 | + /** A unique identifier for the geocoding |
|
13 | + * @var string $key |
|
14 | + */ |
|
15 | + public $key; |
|
16 | 16 | |
17 | - /** Specific description of the geocoding result |
|
18 | - * @var string $name |
|
19 | - */ |
|
20 | - public $name; |
|
17 | + /** Specific description of the geocoding result |
|
18 | + * @var string $name |
|
19 | + */ |
|
20 | + public $name; |
|
21 | 21 | |
22 | - /** Boundary box |
|
23 | - * @var double[] $bbox |
|
24 | - */ |
|
25 | - public $bbox = []; |
|
22 | + /** Boundary box |
|
23 | + * @var double[] $bbox |
|
24 | + */ |
|
25 | + public $bbox = []; |
|
26 | 26 | |
27 | - /** The latitude of the geocoded address |
|
28 | - * @var double $lat |
|
29 | - */ |
|
30 | - public $lat; |
|
27 | + /** The latitude of the geocoded address |
|
28 | + * @var double $lat |
|
29 | + */ |
|
30 | + public $lat; |
|
31 | 31 | |
32 | - /** The longitude of the geocoded address |
|
33 | - * @var double $lng |
|
34 | - */ |
|
35 | - public $lng; |
|
32 | + /** The longitude of the geocoded address |
|
33 | + * @var double $lng |
|
34 | + */ |
|
35 | + public $lng; |
|
36 | 36 | |
37 | - /** Confidance level in the address geocoding: |
|
38 | - * <para>high, medium, low</para> |
|
39 | - * @var string $confidence |
|
40 | - */ |
|
41 | - public $confidence; |
|
37 | + /** Confidance level in the address geocoding: |
|
38 | + * <para>high, medium, low</para> |
|
39 | + * @var string $confidence |
|
40 | + */ |
|
41 | + public $confidence; |
|
42 | 42 | |
43 | - /** The postal code of the geocoded address |
|
44 | - * @var string $postalCode |
|
45 | - */ |
|
46 | - public $postalCode; |
|
43 | + /** The postal code of the geocoded address |
|
44 | + * @var string $postalCode |
|
45 | + */ |
|
46 | + public $postalCode; |
|
47 | 47 | |
48 | - /** Country region |
|
49 | - * @var string $countryRegion |
|
50 | - */ |
|
51 | - public $countryRegion; |
|
48 | + /** Country region |
|
49 | + * @var string $countryRegion |
|
50 | + */ |
|
51 | + public $countryRegion; |
|
52 | 52 | |
53 | - /** The address curbside coordinates |
|
54 | - * @var GeoPoint $curbside_coordinates |
|
55 | - */ |
|
56 | - public $curbside_coordinates = []; |
|
53 | + /** The address curbside coordinates |
|
54 | + * @var GeoPoint $curbside_coordinates |
|
55 | + */ |
|
56 | + public $curbside_coordinates = []; |
|
57 | 57 | |
58 | - /** The address without number |
|
59 | - * @var string $address_without_number |
|
60 | - */ |
|
61 | - public $address_without_number; |
|
58 | + /** The address without number |
|
59 | + * @var string $address_without_number |
|
60 | + */ |
|
61 | + public $address_without_number; |
|
62 | 62 | |
63 | - /** The place ID |
|
64 | - * @var string $place_id |
|
65 | - */ |
|
66 | - public $place_id; |
|
63 | + /** The place ID |
|
64 | + * @var string $place_id |
|
65 | + */ |
|
66 | + public $place_id; |
|
67 | 67 | |
68 | 68 | } |
69 | 69 | \ No newline at end of file |
@@ -11,15 +11,15 @@ |
||
11 | 11 | */ |
12 | 12 | class SlowdownParams extends Common |
13 | 13 | { |
14 | - /** |
|
15 | - * Service time slowdowon (percent) |
|
16 | - * @var integer |
|
17 | - */ |
|
18 | - public $service_time; |
|
14 | + /** |
|
15 | + * Service time slowdowon (percent) |
|
16 | + * @var integer |
|
17 | + */ |
|
18 | + public $service_time; |
|
19 | 19 | |
20 | - /** |
|
21 | - * Travel time slowdowon (percent) |
|
22 | - * @var integer |
|
23 | - */ |
|
24 | - public $travel_time; |
|
20 | + /** |
|
21 | + * Travel time slowdowon (percent) |
|
22 | + * @var integer |
|
23 | + */ |
|
24 | + public $travel_time; |
|
25 | 25 | } |
26 | 26 | \ No newline at end of file |
@@ -11,31 +11,31 @@ |
||
11 | 11 | */ |
12 | 12 | class ServiceTimeRulesClass extends Common |
13 | 13 | { |
14 | - /** |
|
15 | - * Mode of a first item of the bundled addresses. |
|
16 | - * @see Enum\AddressBundlingModes\FirstItemMode |
|
17 | - * @var integer |
|
18 | - */ |
|
19 | - public $first_item_mode; |
|
14 | + /** |
|
15 | + * Mode of a first item of the bundled addresses. |
|
16 | + * @see Enum\AddressBundlingModes\FirstItemMode |
|
17 | + * @var integer |
|
18 | + */ |
|
19 | + public $first_item_mode; |
|
20 | 20 | |
21 | - /** |
|
22 | - * First item mode parameters.<br> |
|
23 | - * If FirstItemMode=CustomTime, contains custom service time in seconds. |
|
24 | - * @var integer[] |
|
25 | - */ |
|
26 | - public $first_item_mode_params; |
|
21 | + /** |
|
22 | + * First item mode parameters.<br> |
|
23 | + * If FirstItemMode=CustomTime, contains custom service time in seconds. |
|
24 | + * @var integer[] |
|
25 | + */ |
|
26 | + public $first_item_mode_params; |
|
27 | 27 | |
28 | - /** |
|
29 | - * Mode of the non-first items of the bundled addresses. |
|
30 | - * @see Enum\AddressBundlingModes\AddtionalItemsMode |
|
31 | - * @var integer |
|
32 | - */ |
|
33 | - public $additional_items_mode; |
|
28 | + /** |
|
29 | + * Mode of the non-first items of the bundled addresses. |
|
30 | + * @see Enum\AddressBundlingModes\AddtionalItemsMode |
|
31 | + * @var integer |
|
32 | + */ |
|
33 | + public $additional_items_mode; |
|
34 | 34 | |
35 | - /** |
|
36 | - * Additional items mode parameters:<br> |
|
37 | - * if AdditionalItemsMode=CustomTime, contains an array of the custom service times |
|
38 | - * @var integer[] |
|
39 | - */ |
|
40 | - public $additional_items_mode_params; |
|
35 | + /** |
|
36 | + * Additional items mode parameters:<br> |
|
37 | + * if AdditionalItemsMode=CustomTime, contains an array of the custom service times |
|
38 | + * @var integer[] |
|
39 | + */ |
|
40 | + public $additional_items_mode_params; |
|
41 | 41 | } |
42 | 42 | \ No newline at end of file |
@@ -10,87 +10,87 @@ |
||
10 | 10 | */ |
11 | 11 | class AddressManifest extends \Route4Me\Common |
12 | 12 | { |
13 | - /** How much time is to be spent on service from the start in seconds. |
|
14 | - * @var integer $running_service_time |
|
15 | - */ |
|
16 | - public $running_service_time; |
|
17 | - |
|
18 | - /** How much time is spent driving from the start in seconds. |
|
19 | - * @var integer $running_travel_time |
|
20 | - */ |
|
21 | - public $running_travel_time; |
|
22 | - |
|
23 | - /** Running wait time. |
|
24 | - * @var integer $running_wait_time |
|
25 | - */ |
|
26 | - public $running_wait_time; |
|
27 | - |
|
28 | - /** Distance traversed before reaching this address. |
|
29 | - * @var double $running_distance |
|
30 | - */ |
|
31 | - public $running_distance; |
|
32 | - |
|
33 | - /** Expected fuel consumption from the start. |
|
34 | - * @var double $fuel_from_start |
|
35 | - */ |
|
36 | - public $fuel_from_start; |
|
37 | - |
|
38 | - /** Expected fuel cost from start. |
|
39 | - * @var double $fuel_cost_from_start |
|
40 | - */ |
|
41 | - public $fuel_cost_from_start; |
|
42 | - |
|
43 | - /** Projected arrival time UTC unixtime. |
|
44 | - * @var integer $projected_arrival_time_ts |
|
45 | - */ |
|
46 | - public $projected_arrival_time_ts; |
|
47 | - |
|
48 | - /** Estimated departure time UTC unixtime. |
|
49 | - * @var integer $projected_departure_time_ts |
|
50 | - */ |
|
51 | - public $projected_departure_time_ts; |
|
52 | - |
|
53 | - /** Time when the address was marked as visited UTC unixtime. |
|
54 | - * This is actually equal to timestamp_last_visited most of the time. |
|
55 | - * @var integer $actual_arrival_time_ts |
|
56 | - */ |
|
57 | - public $actual_arrival_time_ts; |
|
58 | - |
|
59 | - /** Time when the address was marked as departed UTC. |
|
60 | - * This is actually equal to timestamp_last_departed most of the time. |
|
61 | - * @var integer $actual_departure_time_ts |
|
62 | - */ |
|
63 | - public $actual_departure_time_ts; |
|
64 | - |
|
65 | - /** Estimated arrival time based on the current route progress, |
|
66 | - * i.e. based on the last known actual_arrival_time. |
|
67 | - * @var integer $estimated_arrival_time_ts |
|
68 | - */ |
|
69 | - public $estimated_arrival_time_ts; |
|
70 | - |
|
71 | - /** Estimated departure time based on the current route progress. |
|
72 | - * @var integer $estimated_departure_time_ts |
|
73 | - */ |
|
74 | - public $estimated_departure_time_ts; |
|
75 | - |
|
76 | - /** Scheduled arrival time. |
|
77 | - * @var integer $scheduled_arrival_time_ts |
|
78 | - */ |
|
79 | - public $scheduled_arrival_time_ts; |
|
80 | - |
|
81 | - /** Scheduled departure time. |
|
82 | - * @var integer $scheduled_departure_time_ts |
|
83 | - */ |
|
84 | - public $scheduled_departure_time_ts; |
|
85 | - |
|
86 | - /** This is the difference between the originally projected arrival time and Actual Arrival Time. |
|
87 | - * @var integer $time_impact |
|
88 | - */ |
|
89 | - public $time_impact; |
|
90 | - |
|
91 | - /** Distance traversed before reaching this address. |
|
92 | - * @var double $udu_running_distance |
|
93 | - */ |
|
94 | - public $udu_running_distance; |
|
13 | + /** How much time is to be spent on service from the start in seconds. |
|
14 | + * @var integer $running_service_time |
|
15 | + */ |
|
16 | + public $running_service_time; |
|
17 | + |
|
18 | + /** How much time is spent driving from the start in seconds. |
|
19 | + * @var integer $running_travel_time |
|
20 | + */ |
|
21 | + public $running_travel_time; |
|
22 | + |
|
23 | + /** Running wait time. |
|
24 | + * @var integer $running_wait_time |
|
25 | + */ |
|
26 | + public $running_wait_time; |
|
27 | + |
|
28 | + /** Distance traversed before reaching this address. |
|
29 | + * @var double $running_distance |
|
30 | + */ |
|
31 | + public $running_distance; |
|
32 | + |
|
33 | + /** Expected fuel consumption from the start. |
|
34 | + * @var double $fuel_from_start |
|
35 | + */ |
|
36 | + public $fuel_from_start; |
|
37 | + |
|
38 | + /** Expected fuel cost from start. |
|
39 | + * @var double $fuel_cost_from_start |
|
40 | + */ |
|
41 | + public $fuel_cost_from_start; |
|
42 | + |
|
43 | + /** Projected arrival time UTC unixtime. |
|
44 | + * @var integer $projected_arrival_time_ts |
|
45 | + */ |
|
46 | + public $projected_arrival_time_ts; |
|
47 | + |
|
48 | + /** Estimated departure time UTC unixtime. |
|
49 | + * @var integer $projected_departure_time_ts |
|
50 | + */ |
|
51 | + public $projected_departure_time_ts; |
|
52 | + |
|
53 | + /** Time when the address was marked as visited UTC unixtime. |
|
54 | + * This is actually equal to timestamp_last_visited most of the time. |
|
55 | + * @var integer $actual_arrival_time_ts |
|
56 | + */ |
|
57 | + public $actual_arrival_time_ts; |
|
58 | + |
|
59 | + /** Time when the address was marked as departed UTC. |
|
60 | + * This is actually equal to timestamp_last_departed most of the time. |
|
61 | + * @var integer $actual_departure_time_ts |
|
62 | + */ |
|
63 | + public $actual_departure_time_ts; |
|
64 | + |
|
65 | + /** Estimated arrival time based on the current route progress, |
|
66 | + * i.e. based on the last known actual_arrival_time. |
|
67 | + * @var integer $estimated_arrival_time_ts |
|
68 | + */ |
|
69 | + public $estimated_arrival_time_ts; |
|
70 | + |
|
71 | + /** Estimated departure time based on the current route progress. |
|
72 | + * @var integer $estimated_departure_time_ts |
|
73 | + */ |
|
74 | + public $estimated_departure_time_ts; |
|
75 | + |
|
76 | + /** Scheduled arrival time. |
|
77 | + * @var integer $scheduled_arrival_time_ts |
|
78 | + */ |
|
79 | + public $scheduled_arrival_time_ts; |
|
80 | + |
|
81 | + /** Scheduled departure time. |
|
82 | + * @var integer $scheduled_departure_time_ts |
|
83 | + */ |
|
84 | + public $scheduled_departure_time_ts; |
|
85 | + |
|
86 | + /** This is the difference between the originally projected arrival time and Actual Arrival Time. |
|
87 | + * @var integer $time_impact |
|
88 | + */ |
|
89 | + public $time_impact; |
|
90 | + |
|
91 | + /** Distance traversed before reaching this address. |
|
92 | + * @var double $udu_running_distance |
|
93 | + */ |
|
94 | + public $udu_running_distance; |
|
95 | 95 | |
96 | 96 | } |
97 | 97 | \ No newline at end of file |