@@ -24,15 +24,15 @@ discard block |
||
24 | 24 | //********************************************************************** |
25 | 25 | // General Route Parameters |
26 | 26 | $parameters = RouteParameters::fromArray([ |
27 | - 'rt' => true, |
|
28 | - 'algorithm_type' => Algorithmtype::ADVANCED_CVRP_TW, |
|
29 | - 'route_name' => 'Single Depot, Multiple Driver - 3 Territories IDs '.date('Y-m-d H:i:s', time()), |
|
30 | - 'route_time' => 46800, |
|
31 | - 'distance_unit' => DistanceUnit::MILES, |
|
32 | - 'device_type' => DeviceType::WEB, |
|
33 | - 'optimize' => OptimizationType::DISTANCE, |
|
34 | - 'travel_mode' => TravelMode::DRIVING, |
|
35 | - 'advanced_constraints' => [] |
|
27 | + 'rt' => true, |
|
28 | + 'algorithm_type' => Algorithmtype::ADVANCED_CVRP_TW, |
|
29 | + 'route_name' => 'Single Depot, Multiple Driver - 3 Territories IDs '.date('Y-m-d H:i:s', time()), |
|
30 | + 'route_time' => 46800, |
|
31 | + 'distance_unit' => DistanceUnit::MILES, |
|
32 | + 'device_type' => DeviceType::WEB, |
|
33 | + 'optimize' => OptimizationType::DISTANCE, |
|
34 | + 'travel_mode' => TravelMode::DRIVING, |
|
35 | + 'advanced_constraints' => [] |
|
36 | 36 | ]); |
37 | 37 | |
38 | 38 | //********************************************************************** |
@@ -41,30 +41,30 @@ discard block |
||
41 | 41 | // Time Window Start: 8:00 am EST |
42 | 42 | // Time Window End: 11:00 am EST |
43 | 43 | $parameters->advanced_constraints[] = RouteAdvancedConstraints::fromArray([ |
44 | - 'max_cargo_volume' => 0.0, |
|
45 | - 'members_count' => 3, |
|
46 | - 'available_time_windows' => [[46800, 57600]], |
|
47 | - 'tags' => ['A34BA30C717D1194FC0230252DF0C45C'] |
|
44 | + 'max_cargo_volume' => 0.0, |
|
45 | + 'members_count' => 3, |
|
46 | + 'available_time_windows' => [[46800, 57600]], |
|
47 | + 'tags' => ['A34BA30C717D1194FC0230252DF0C45C'] |
|
48 | 48 | ]); |
49 | 49 | |
50 | 50 | // Schedule 2 |
51 | 51 | // Time Window Start: 8:00 am EST |
52 | 52 | // Time Window End: 12:00 am EST |
53 | 53 | $parameters->advanced_constraints[] = RouteAdvancedConstraints::fromArray([ |
54 | - 'max_cargo_volume' => 0.0, |
|
55 | - 'members_count' => 4, |
|
56 | - 'available_time_windows' => [[46800, 61200]], |
|
57 | - 'tags' => ['DA6A8F10313CCFEC843978FC065F235B'] |
|
54 | + 'max_cargo_volume' => 0.0, |
|
55 | + 'members_count' => 4, |
|
56 | + 'available_time_windows' => [[46800, 61200]], |
|
57 | + 'tags' => ['DA6A8F10313CCFEC843978FC065F235B'] |
|
58 | 58 | ]); |
59 | 59 | |
60 | 60 | // Schedule 3 |
61 | 61 | // Time Window Start: 8:00 am EST |
62 | 62 | // Time Window End: 13:00 am EST |
63 | 63 | $parameters->advanced_constraints[] = RouteAdvancedConstraints::fromArray([ |
64 | - 'max_cargo_volume' => 0.0, |
|
65 | - 'members_count' => 3, |
|
66 | - 'available_time_windows' => [[46800, 64800]], |
|
67 | - 'tags' => ['8142ABF2D693336987726ECDB5ED2D6D'] |
|
64 | + 'max_cargo_volume' => 0.0, |
|
65 | + 'members_count' => 3, |
|
66 | + 'available_time_windows' => [[46800, 64800]], |
|
67 | + 'tags' => ['8142ABF2D693336987726ECDB5ED2D6D'] |
|
68 | 68 | ]); |
69 | 69 | |
70 | 70 | //********************************************************************** |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $addresses = []; |
74 | 74 | |
75 | 75 | foreach ($json as $address) { |
76 | - $addresses[] = Address::fromArray($address); |
|
76 | + $addresses[] = Address::fromArray($address); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | $optimizationParams = new OptimizationProblemParams(); |
@@ -82,5 +82,5 @@ |
||
82 | 82 | |
83 | 83 | $problem = OptimizationProblem::optimize($optimizationParams); |
84 | 84 | |
85 | -echo "Optimization Problem ID: " . $problem->optimization_problem_id . PHP_EOL; |
|
86 | -echo "State: " . OptimizationStates::getName($problem->state) . " (" . $problem->state . ")" . PHP_EOL; |
|
85 | +echo "Optimization Problem ID: ".$problem->optimization_problem_id.PHP_EOL; |
|
86 | +echo "State: ".OptimizationStates::getName($problem->state)." (".$problem->state.")".PHP_EOL; |
@@ -4,25 +4,25 @@ |
||
4 | 4 | |
5 | 5 | class StatusUpdateType |
6 | 6 | { |
7 | - const PICKUP = 'pickup'; |
|
8 | - const DROPOFF = 'dropoff'; |
|
9 | - const NOANSWER = 'noanswer'; |
|
10 | - const NOTFOUND = 'notfound'; |
|
11 | - const NOTPAID = 'notpaid'; |
|
12 | - const PAID = 'paid'; |
|
13 | - const WRONGDELIVERY = 'wrongdelivery'; |
|
14 | - const WRONGADDRESSRECIPIENT = 'wrongaddressrecipient'; |
|
15 | - const NOTPRESENT = 'notpresent'; |
|
16 | - const PARTS_MISSING = 'parts_missing'; |
|
17 | - const SERVICE_RENDERED = 'service_rendered'; |
|
18 | - const FOLLOW_UP = 'follow_up'; |
|
19 | - const LEFT_INFORMATION = 'left_information'; |
|
20 | - const SPOKE_WITH_DECISION_MAKER = 'spoke_with_decision_maker'; |
|
21 | - const SPOKE_WITH_DECISION_INFLUENCER = 'spoke_with_decision_influencer'; |
|
22 | - const COMPETITIVE_ACCOUNT = 'competitive_account'; |
|
23 | - const SCHEDULED_FOLLOW_UP_MEETING = 'scheduled_follow_up_meeting'; |
|
24 | - const SCHEDULED_LUNCH = 'scheduled_lunch'; |
|
25 | - const SCHEDULED_PRODUCT_DEMO = 'scheduled_product_demo'; |
|
26 | - const SCHEDULED_CLINICAL_DEMO = 'scheduled_clinical_demo'; |
|
27 | - const NO_OPPORTUNITY = 'no_opportunity'; |
|
7 | + const PICKUP = 'pickup'; |
|
8 | + const DROPOFF = 'dropoff'; |
|
9 | + const NOANSWER = 'noanswer'; |
|
10 | + const NOTFOUND = 'notfound'; |
|
11 | + const NOTPAID = 'notpaid'; |
|
12 | + const PAID = 'paid'; |
|
13 | + const WRONGDELIVERY = 'wrongdelivery'; |
|
14 | + const WRONGADDRESSRECIPIENT = 'wrongaddressrecipient'; |
|
15 | + const NOTPRESENT = 'notpresent'; |
|
16 | + const PARTS_MISSING = 'parts_missing'; |
|
17 | + const SERVICE_RENDERED = 'service_rendered'; |
|
18 | + const FOLLOW_UP = 'follow_up'; |
|
19 | + const LEFT_INFORMATION = 'left_information'; |
|
20 | + const SPOKE_WITH_DECISION_MAKER = 'spoke_with_decision_maker'; |
|
21 | + const SPOKE_WITH_DECISION_INFLUENCER = 'spoke_with_decision_influencer'; |
|
22 | + const COMPETITIVE_ACCOUNT = 'competitive_account'; |
|
23 | + const SCHEDULED_FOLLOW_UP_MEETING = 'scheduled_follow_up_meeting'; |
|
24 | + const SCHEDULED_LUNCH = 'scheduled_lunch'; |
|
25 | + const SCHEDULED_PRODUCT_DEMO = 'scheduled_product_demo'; |
|
26 | + const SCHEDULED_CLINICAL_DEMO = 'scheduled_clinical_demo'; |
|
27 | + const NO_OPPORTUNITY = 'no_opportunity'; |
|
28 | 28 | } |
@@ -6,22 +6,22 @@ |
||
6 | 6 | |
7 | 7 | class OptimizationStates |
8 | 8 | { |
9 | - const NEW = 0; |
|
10 | - const INITIAL = 1; |
|
11 | - const MATRIX_PROCESSING = 2; |
|
12 | - const OPTIMIZING = 3; |
|
13 | - const OPTIMIZED = 4; |
|
14 | - const ERROR = 5; |
|
15 | - const COMPUTING_DIRECTIONS = 6; |
|
16 | - const IN_QUEUE = 7; |
|
9 | + const NEW = 0; |
|
10 | + const INITIAL = 1; |
|
11 | + const MATRIX_PROCESSING = 2; |
|
12 | + const OPTIMIZING = 3; |
|
13 | + const OPTIMIZED = 4; |
|
14 | + const ERROR = 5; |
|
15 | + const COMPUTING_DIRECTIONS = 6; |
|
16 | + const IN_QUEUE = 7; |
|
17 | 17 | |
18 | - public static function getName(int $state) : string |
|
19 | - { |
|
20 | - $refl = new ReflectionClass(__CLASS__); |
|
21 | - foreach($refl->getConstants() AS $key => $val) |
|
22 | - { |
|
23 | - if($val == $state) return $key; |
|
24 | - } |
|
25 | - return 'UNKNOWN'; |
|
26 | - } |
|
18 | + public static function getName(int $state) : string |
|
19 | + { |
|
20 | + $refl = new ReflectionClass(__CLASS__); |
|
21 | + foreach($refl->getConstants() AS $key => $val) |
|
22 | + { |
|
23 | + if($val == $state) return $key; |
|
24 | + } |
|
25 | + return 'UNKNOWN'; |
|
26 | + } |
|
27 | 27 | } |
@@ -18,9 +18,9 @@ |
||
18 | 18 | public static function getName(int $state) : string |
19 | 19 | { |
20 | 20 | $refl = new ReflectionClass(__CLASS__); |
21 | - foreach($refl->getConstants() AS $key => $val) |
|
21 | + foreach ($refl->getConstants() AS $key => $val) |
|
22 | 22 | { |
23 | - if($val == $state) return $key; |
|
23 | + if ($val==$state) return $key; |
|
24 | 24 | } |
25 | 25 | return 'UNKNOWN'; |
26 | 26 | } |
@@ -20,7 +20,9 @@ |
||
20 | 20 | $refl = new ReflectionClass(__CLASS__); |
21 | 21 | foreach($refl->getConstants() AS $key => $val) |
22 | 22 | { |
23 | - if($val == $state) return $key; |
|
23 | + if($val == $state) { |
|
24 | + return $key; |
|
25 | + } |
|
24 | 26 | } |
25 | 27 | return 'UNKNOWN'; |
26 | 28 | } |
@@ -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,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 | } |
@@ -4,9 +4,9 @@ |
||
4 | 4 | |
5 | 5 | class Metric |
6 | 6 | { |
7 | - const EUCLIDEAN = 1; //measures point to point distance as a straight line |
|
8 | - const MANHATTAN = 2; //measures point to point distance as taxicab geometry line |
|
9 | - const GEODESIC = 3; //measures point to point distance approximating curvature of the earth |
|
10 | - const MATRIX = 4; //measures point to point distance by traversing the actual road network |
|
11 | - const EXACT_2D = 5; //measures point to point distance using 2d rectilinear distance |
|
7 | + const EUCLIDEAN = 1; //measures point to point distance as a straight line |
|
8 | + const MANHATTAN = 2; //measures point to point distance as taxicab geometry line |
|
9 | + const GEODESIC = 3; //measures point to point distance approximating curvature of the earth |
|
10 | + const MATRIX = 4; //measures point to point distance by traversing the actual road network |
|
11 | + const EXACT_2D = 5; //measures point to point distance using 2d rectilinear distance |
|
12 | 12 | } |
@@ -4,9 +4,9 @@ |
||
4 | 4 | |
5 | 5 | class DeviceType |
6 | 6 | { |
7 | - const WEB = 'web'; |
|
8 | - const IPHONE = 'iphone'; |
|
9 | - const IPAD = 'ipad'; |
|
10 | - const ANDROID_PHONE = 'android_phone'; |
|
11 | - const ANDROID_TABLET = 'android_tablet'; |
|
7 | + const WEB = 'web'; |
|
8 | + const IPHONE = 'iphone'; |
|
9 | + const IPAD = 'ipad'; |
|
10 | + const ANDROID_PHONE = 'android_phone'; |
|
11 | + const ANDROID_TABLET = 'android_tablet'; |
|
12 | 12 | } |
@@ -4,9 +4,9 @@ |
||
4 | 4 | |
5 | 5 | class TravelMode |
6 | 6 | { |
7 | - const DRIVING = 'Driving'; |
|
8 | - const WALKING = 'Walking'; |
|
9 | - const TRUCKING = 'Trucking'; |
|
10 | - const CYCLING = 'Cycling'; |
|
11 | - const TRANSIT = 'Transit'; |
|
7 | + const DRIVING = 'Driving'; |
|
8 | + const WALKING = 'Walking'; |
|
9 | + const TRUCKING = 'Trucking'; |
|
10 | + const CYCLING = 'Cycling'; |
|
11 | + const TRANSIT = 'Transit'; |
|
12 | 12 | } |
@@ -11,279 +11,279 @@ |
||
11 | 11 | */ |
12 | 12 | class TelematicsConnection extends \Route4Me\Common |
13 | 13 | { |
14 | - /** |
|
15 | - * Telematics connection access account_id |
|
16 | - * @var string |
|
17 | - */ |
|
18 | - public $account_id; |
|
14 | + /** |
|
15 | + * Telematics connection access account_id |
|
16 | + * @var string |
|
17 | + */ |
|
18 | + public $account_id; |
|
19 | 19 | |
20 | - /** |
|
21 | - * Telematics connection access username |
|
22 | - * @var string |
|
23 | - */ |
|
24 | - public $username; |
|
20 | + /** |
|
21 | + * Telematics connection access username |
|
22 | + * @var string |
|
23 | + */ |
|
24 | + public $username; |
|
25 | 25 | |
26 | - /** |
|
27 | - * Telematics connection access password |
|
28 | - * @var string |
|
29 | - */ |
|
30 | - public $password; |
|
26 | + /** |
|
27 | + * Telematics connection access password |
|
28 | + * @var string |
|
29 | + */ |
|
30 | + public $password; |
|
31 | 31 | |
32 | - /** |
|
33 | - * Telematics connection access host |
|
34 | - * @var string |
|
35 | - */ |
|
36 | - public $host; |
|
32 | + /** |
|
33 | + * Telematics connection access host |
|
34 | + * @var string |
|
35 | + */ |
|
36 | + public $host; |
|
37 | 37 | |
38 | - /** |
|
39 | - * Telematics connection access api_key |
|
40 | - * @var string |
|
41 | - */ |
|
42 | - public $api_key; |
|
38 | + /** |
|
39 | + * Telematics connection access api_key |
|
40 | + * @var string |
|
41 | + */ |
|
42 | + public $api_key; |
|
43 | 43 | |
44 | - /** |
|
45 | - * Telemetics connection type ID |
|
46 | - * @var integer |
|
47 | - */ |
|
48 | - public $vendor_id; |
|
44 | + /** |
|
45 | + * Telemetics connection type ID |
|
46 | + * @var integer |
|
47 | + */ |
|
48 | + public $vendor_id; |
|
49 | 49 | |
50 | - /** |
|
51 | - * Telemetics connection name |
|
52 | - * @var string |
|
53 | - */ |
|
54 | - public $name; |
|
50 | + /** |
|
51 | + * Telemetics connection name |
|
52 | + * @var string |
|
53 | + */ |
|
54 | + public $name; |
|
55 | 55 | |
56 | - /** |
|
57 | - * Vehicle tracking interval in seconds. |
|
58 | - * @var integer |
|
59 | - */ |
|
60 | - public $vehicle_position_refresh_rate; |
|
56 | + /** |
|
57 | + * Vehicle tracking interval in seconds. |
|
58 | + * @var integer |
|
59 | + */ |
|
60 | + public $vehicle_position_refresh_rate; |
|
61 | 61 | |
62 | - /** |
|
63 | - * Maximum idle time |
|
64 | - * @var integer |
|
65 | - */ |
|
66 | - public $max_idle_time; |
|
62 | + /** |
|
63 | + * Maximum idle time |
|
64 | + * @var integer |
|
65 | + */ |
|
66 | + public $max_idle_time; |
|
67 | 67 | |
68 | - /** |
|
69 | - * Disable/enable vehicle tracking |
|
70 | - * @var integer |
|
71 | - */ |
|
72 | - public $is_enabled; |
|
68 | + /** |
|
69 | + * Disable/enable vehicle tracking |
|
70 | + * @var integer |
|
71 | + */ |
|
72 | + public $is_enabled; |
|
73 | 73 | |
74 | - /** |
|
75 | - * The last timestamp, when the vehicles reloaded. |
|
76 | - * @var integer |
|
77 | - */ |
|
78 | - public $last_vehicles_reload; |
|
74 | + /** |
|
75 | + * The last timestamp, when the vehicles reloaded. |
|
76 | + * @var integer |
|
77 | + */ |
|
78 | + public $last_vehicles_reload; |
|
79 | 79 | |
80 | - /** |
|
81 | - * The last timestamp, when the addresses reloaded. |
|
82 | - * @var integer |
|
83 | - */ |
|
84 | - public $last_addresses_reload; |
|
80 | + /** |
|
81 | + * The last timestamp, when the addresses reloaded. |
|
82 | + * @var integer |
|
83 | + */ |
|
84 | + public $last_addresses_reload; |
|
85 | 85 | |
86 | - /** |
|
87 | - * The last timestamp, when the positions reloaded. |
|
88 | - * @var integer |
|
89 | - */ |
|
90 | - public $last_position_reload; |
|
86 | + /** |
|
87 | + * The last timestamp, when the positions reloaded. |
|
88 | + * @var integer |
|
89 | + */ |
|
90 | + public $last_position_reload; |
|
91 | 91 | |
92 | - /** |
|
93 | - * Telematics connection access token |
|
94 | - * @var string |
|
95 | - */ |
|
96 | - public $connection_token; |
|
92 | + /** |
|
93 | + * Telematics connection access token |
|
94 | + * @var string |
|
95 | + */ |
|
96 | + public $connection_token; |
|
97 | 97 | |
98 | - /** |
|
99 | - * Connection user ID |
|
100 | - * @var integer |
|
101 | - */ |
|
102 | - public $user_id; |
|
98 | + /** |
|
99 | + * Connection user ID |
|
100 | + * @var integer |
|
101 | + */ |
|
102 | + public $user_id; |
|
103 | 103 | |
104 | - /** |
|
105 | - * When the connection updated |
|
106 | - * @var string |
|
107 | - */ |
|
108 | - public $updated_at; |
|
104 | + /** |
|
105 | + * When the connection updated |
|
106 | + * @var string |
|
107 | + */ |
|
108 | + public $updated_at; |
|
109 | 109 | |
110 | - /** |
|
111 | - * When the connection created |
|
112 | - * @var string |
|
113 | - */ |
|
114 | - public $created_at; |
|
110 | + /** |
|
111 | + * When the connection created |
|
112 | + * @var string |
|
113 | + */ |
|
114 | + public $created_at; |
|
115 | 115 | |
116 | - /** |
|
117 | - * Telemetics connection ID |
|
118 | - * @var integer |
|
119 | - */ |
|
120 | - public $id; |
|
116 | + /** |
|
117 | + * Telemetics connection ID |
|
118 | + * @var integer |
|
119 | + */ |
|
120 | + public $id; |
|
121 | 121 | |
122 | - /** |
|
123 | - * Metadata, custom key-value storage. |
|
124 | - * @var array |
|
125 | - */ |
|
126 | - public $metadata; |
|
122 | + /** |
|
123 | + * Metadata, custom key-value storage. |
|
124 | + * @var array |
|
125 | + */ |
|
126 | + public $metadata; |
|
127 | 127 | |
128 | - /** |
|
129 | - * Total vehicles number |
|
130 | - * @var integer |
|
131 | - */ |
|
132 | - public $total_vehicles_count; |
|
128 | + /** |
|
129 | + * Total vehicles number |
|
130 | + * @var integer |
|
131 | + */ |
|
132 | + public $total_vehicles_count; |
|
133 | 133 | |
134 | - /** |
|
135 | - * Total addresses number |
|
136 | - * @var integer |
|
137 | - */ |
|
138 | - public $total_addresses_count; |
|
134 | + /** |
|
135 | + * Total addresses number |
|
136 | + * @var integer |
|
137 | + */ |
|
138 | + public $total_addresses_count; |
|
139 | 139 | |
140 | - /** |
|
141 | - * Synchronized vehicles number |
|
142 | - * @var integer |
|
143 | - */ |
|
144 | - public $synced_vehicles_count; |
|
140 | + /** |
|
141 | + * Synchronized vehicles number |
|
142 | + * @var integer |
|
143 | + */ |
|
144 | + public $synced_vehicles_count; |
|
145 | 145 | |
146 | - /** |
|
147 | - * Telemetics connection vendor |
|
148 | - * @var string |
|
149 | - */ |
|
150 | - public $vendor; |
|
146 | + /** |
|
147 | + * Telemetics connection vendor |
|
148 | + * @var string |
|
149 | + */ |
|
150 | + public $vendor; |
|
151 | 151 | |
152 | - /** |
|
153 | - * Validate connections credentials.<br> |
|
154 | - * If true, the connection validated. |
|
155 | - * @var Boolean |
|
156 | - */ |
|
157 | - public $validate_remote_credentials; |
|
152 | + /** |
|
153 | + * Validate connections credentials.<br> |
|
154 | + * If true, the connection validated. |
|
155 | + * @var Boolean |
|
156 | + */ |
|
157 | + public $validate_remote_credentials; |
|
158 | 158 | |
159 | - public static function fromArray(array $params) |
|
160 | - { |
|
161 | - $thisParams = new self(); |
|
159 | + public static function fromArray(array $params) |
|
160 | + { |
|
161 | + $thisParams = new self(); |
|
162 | 162 | |
163 | - foreach ($params as $key => $value) { |
|
164 | - if (property_exists($thisParams, $key)) { |
|
165 | - $thisParams->{$key} = $value; |
|
166 | - } |
|
167 | - } |
|
163 | + foreach ($params as $key => $value) { |
|
164 | + if (property_exists($thisParams, $key)) { |
|
165 | + $thisParams->{$key} = $value; |
|
166 | + } |
|
167 | + } |
|
168 | 168 | |
169 | - return $thisParams; |
|
170 | - } |
|
169 | + return $thisParams; |
|
170 | + } |
|
171 | 171 | |
172 | - /** |
|
173 | - * Create a telematics connection. |
|
174 | - * @param $apiToken string : API token |
|
175 | - * @param $params TelematicsConnectionParameters : Telematics connection parameters |
|
176 | - * @return array Array from a TelematicsConnection type object |
|
177 | - * @throws \Route4Me\Exception\ApiError |
|
178 | - */ |
|
179 | - public function createTelematicsConnection($apiToken, $params) |
|
180 | - { |
|
181 | - Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
172 | + /** |
|
173 | + * Create a telematics connection. |
|
174 | + * @param $apiToken string : API token |
|
175 | + * @param $params TelematicsConnectionParameters : Telematics connection parameters |
|
176 | + * @return array Array from a TelematicsConnection type object |
|
177 | + * @throws \Route4Me\Exception\ApiError |
|
178 | + */ |
|
179 | + public function createTelematicsConnection($apiToken, $params) |
|
180 | + { |
|
181 | + Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
182 | 182 | |
183 | - $excludeFields = ['id', 'connection_token']; |
|
183 | + $excludeFields = ['id', 'connection_token']; |
|
184 | 184 | |
185 | - $allBodyFields = Route4Me::getObjectProperties(new TelematicsConnectionParameters(), $excludeFields); |
|
185 | + $allBodyFields = Route4Me::getObjectProperties(new TelematicsConnectionParameters(), $excludeFields); |
|
186 | 186 | |
187 | - $result = Route4Me::makeRequst([ |
|
188 | - 'url' => Endpoint::TELEMATICS_CONNECTION, |
|
189 | - 'method' => 'POST', |
|
190 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
191 | - 'query' => ['api_token' => $apiToken], |
|
192 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data', |
|
193 | - ]); |
|
187 | + $result = Route4Me::makeRequst([ |
|
188 | + 'url' => Endpoint::TELEMATICS_CONNECTION, |
|
189 | + 'method' => 'POST', |
|
190 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
191 | + 'query' => ['api_token' => $apiToken], |
|
192 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data', |
|
193 | + ]); |
|
194 | 194 | |
195 | - return $result; |
|
196 | - } |
|
195 | + return $result; |
|
196 | + } |
|
197 | 197 | |
198 | - /** |
|
199 | - * Delete a telematics connection. |
|
200 | - * @param $apiToken string : API token |
|
201 | - * @param $connectionToken string : connection token |
|
202 | - * @return array Array from a TelematicsConnection type object |
|
203 | - * @throws \Route4Me\Exception\ApiError |
|
204 | - */ |
|
205 | - public function deleteTelematicsConnection($apiToken, $connectionToken) |
|
206 | - { |
|
207 | - Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
198 | + /** |
|
199 | + * Delete a telematics connection. |
|
200 | + * @param $apiToken string : API token |
|
201 | + * @param $connectionToken string : connection token |
|
202 | + * @return array Array from a TelematicsConnection type object |
|
203 | + * @throws \Route4Me\Exception\ApiError |
|
204 | + */ |
|
205 | + public function deleteTelematicsConnection($apiToken, $connectionToken) |
|
206 | + { |
|
207 | + Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
208 | 208 | |
209 | - $result = Route4Me::makeRequst([ |
|
210 | - 'url' => Endpoint::TELEMATICS_CONNECTION, |
|
211 | - 'method' => 'DELETE', |
|
212 | - 'query' => [ |
|
213 | - 'api_token' => $apiToken, |
|
214 | - 'connection_token' => $connectionToken |
|
215 | - ], |
|
216 | - ]); |
|
209 | + $result = Route4Me::makeRequst([ |
|
210 | + 'url' => Endpoint::TELEMATICS_CONNECTION, |
|
211 | + 'method' => 'DELETE', |
|
212 | + 'query' => [ |
|
213 | + 'api_token' => $apiToken, |
|
214 | + 'connection_token' => $connectionToken |
|
215 | + ], |
|
216 | + ]); |
|
217 | 217 | |
218 | - return $result; |
|
219 | - } |
|
218 | + return $result; |
|
219 | + } |
|
220 | 220 | |
221 | - /** |
|
222 | - * Get all telematics connections. |
|
223 | - * @param $apiToken string : API token |
|
224 | - * @return array Array of the TelematicsConnection type objects |
|
225 | - * @throws \Route4Me\Exception\ApiError |
|
226 | - */ |
|
227 | - public function getTelematicsConnections($apiToken) |
|
228 | - { |
|
229 | - Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
221 | + /** |
|
222 | + * Get all telematics connections. |
|
223 | + * @param $apiToken string : API token |
|
224 | + * @return array Array of the TelematicsConnection type objects |
|
225 | + * @throws \Route4Me\Exception\ApiError |
|
226 | + */ |
|
227 | + public function getTelematicsConnections($apiToken) |
|
228 | + { |
|
229 | + Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
230 | 230 | |
231 | - $result = Route4Me::makeRequst([ |
|
232 | - 'url' => Endpoint::TELEMATICS_CONNECTION, |
|
233 | - 'method' => 'GET', |
|
234 | - 'query' => [ |
|
235 | - 'api_token' => $apiToken |
|
236 | - ], |
|
237 | - ]); |
|
231 | + $result = Route4Me::makeRequst([ |
|
232 | + 'url' => Endpoint::TELEMATICS_CONNECTION, |
|
233 | + 'method' => 'GET', |
|
234 | + 'query' => [ |
|
235 | + 'api_token' => $apiToken |
|
236 | + ], |
|
237 | + ]); |
|
238 | 238 | |
239 | - return $result; |
|
240 | - } |
|
239 | + return $result; |
|
240 | + } |
|
241 | 241 | |
242 | - /** |
|
243 | - * Get a telematics connection |
|
244 | - * @param $apiToken string : API token |
|
245 | - * @param $connectionToken string : connection token |
|
246 | - * @return array Array from a TelematicsConnection type object |
|
247 | - * @throws \Route4Me\Exception\ApiError |
|
248 | - */ |
|
249 | - public function getTelematicsConnection($apiToken, $connectionToken) |
|
250 | - { |
|
251 | - Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
242 | + /** |
|
243 | + * Get a telematics connection |
|
244 | + * @param $apiToken string : API token |
|
245 | + * @param $connectionToken string : connection token |
|
246 | + * @return array Array from a TelematicsConnection type object |
|
247 | + * @throws \Route4Me\Exception\ApiError |
|
248 | + */ |
|
249 | + public function getTelematicsConnection($apiToken, $connectionToken) |
|
250 | + { |
|
251 | + Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
252 | 252 | |
253 | - $result = Route4Me::makeRequst([ |
|
254 | - 'url' => Endpoint::TELEMATICS_CONNECTION, |
|
255 | - 'method' => 'GET', |
|
256 | - 'query' => [ |
|
257 | - 'api_token' => $apiToken, |
|
258 | - 'connection_token' => $connectionToken |
|
259 | - ], |
|
260 | - ]); |
|
253 | + $result = Route4Me::makeRequst([ |
|
254 | + 'url' => Endpoint::TELEMATICS_CONNECTION, |
|
255 | + 'method' => 'GET', |
|
256 | + 'query' => [ |
|
257 | + 'api_token' => $apiToken, |
|
258 | + 'connection_token' => $connectionToken |
|
259 | + ], |
|
260 | + ]); |
|
261 | 261 | |
262 | - return $result; |
|
263 | - } |
|
262 | + return $result; |
|
263 | + } |
|
264 | 264 | |
265 | - /** |
|
266 | - * Update telematics connection |
|
267 | - * @param $apiToken string : API token |
|
268 | - * @param $connectionToken string : connection token |
|
269 | - * @param $teleConParams TelematicsConnectionParameters : Telematics connection parameters |
|
270 | - * @return array Array from a TelematicsConnection type object |
|
271 | - * @throws \Route4Me\Exception\ApiError |
|
272 | - */ |
|
273 | - public function updateTelematicsConnection($apiToken, $connectionToken, $teleConParams) |
|
274 | - { |
|
275 | - $excludeFields = ['id', 'connection_token']; |
|
265 | + /** |
|
266 | + * Update telematics connection |
|
267 | + * @param $apiToken string : API token |
|
268 | + * @param $connectionToken string : connection token |
|
269 | + * @param $teleConParams TelematicsConnectionParameters : Telematics connection parameters |
|
270 | + * @return array Array from a TelematicsConnection type object |
|
271 | + * @throws \Route4Me\Exception\ApiError |
|
272 | + */ |
|
273 | + public function updateTelematicsConnection($apiToken, $connectionToken, $teleConParams) |
|
274 | + { |
|
275 | + $excludeFields = ['id', 'connection_token']; |
|
276 | 276 | |
277 | - $allBodyFields = Route4Me::getObjectProperties(new TelematicsConnectionParameters(), $excludeFields); |
|
277 | + $allBodyFields = Route4Me::getObjectProperties(new TelematicsConnectionParameters(), $excludeFields); |
|
278 | 278 | |
279 | - $result = Route4Me::makeRequst([ |
|
280 | - 'url' => Endpoint::TELEMATICS_CONNECTION, |
|
281 | - 'method' => 'PUT', |
|
282 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $teleConParams), |
|
283 | - 'query' => ['api_token' => $apiToken, 'connection_token' => $connectionToken], |
|
284 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data', |
|
285 | - ]); |
|
279 | + $result = Route4Me::makeRequst([ |
|
280 | + 'url' => Endpoint::TELEMATICS_CONNECTION, |
|
281 | + 'method' => 'PUT', |
|
282 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $teleConParams), |
|
283 | + 'query' => ['api_token' => $apiToken, 'connection_token' => $connectionToken], |
|
284 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data', |
|
285 | + ]); |
|
286 | 286 | |
287 | - return $result; |
|
288 | - } |
|
287 | + return $result; |
|
288 | + } |
|
289 | 289 | } |