@@ -7,42 +7,42 @@ |
||
7 | 7 | */ |
8 | 8 | class TelematicsRegisterMemberResponse extends \Route4Me\Common |
9 | 9 | { |
10 | - /** |
|
11 | - * API token |
|
12 | - * Use for the operations: |
|
13 | - * Get Telematics Connections, Register Telematics Connection |
|
14 | - * @var type string |
|
15 | - */ |
|
16 | - public $api_token; |
|
10 | + /** |
|
11 | + * API token |
|
12 | + * Use for the operations: |
|
13 | + * Get Telematics Connections, Register Telematics Connection |
|
14 | + * @var type string |
|
15 | + */ |
|
16 | + public $api_token; |
|
17 | 17 | |
18 | - /** |
|
19 | - * When the registered member updated |
|
20 | - * @var type string |
|
21 | - */ |
|
22 | - public $updated_at; |
|
18 | + /** |
|
19 | + * When the registered member updated |
|
20 | + * @var type string |
|
21 | + */ |
|
22 | + public $updated_at; |
|
23 | 23 | |
24 | - /** |
|
25 | - * When the registered member created |
|
26 | - * @var type |
|
27 | - */ |
|
28 | - public $created_at; |
|
24 | + /** |
|
25 | + * When the registered member created |
|
26 | + * @var type |
|
27 | + */ |
|
28 | + public $created_at; |
|
29 | 29 | |
30 | - /** |
|
31 | - * Telemetics member ID |
|
32 | - * @var type |
|
33 | - */ |
|
34 | - public $id; |
|
30 | + /** |
|
31 | + * Telemetics member ID |
|
32 | + * @var type |
|
33 | + */ |
|
34 | + public $id; |
|
35 | 35 | |
36 | - public static function fromArray(array $params) |
|
37 | - { |
|
38 | - $thisParams = new self(); |
|
36 | + public static function fromArray(array $params) |
|
37 | + { |
|
38 | + $thisParams = new self(); |
|
39 | 39 | |
40 | - foreach ($params as $key => $value) { |
|
41 | - if (property_exists($thisParams, $key)) { |
|
42 | - $thisParams->{$key} = $value; |
|
43 | - } |
|
44 | - } |
|
40 | + foreach ($params as $key => $value) { |
|
41 | + if (property_exists($thisParams, $key)) { |
|
42 | + $thisParams->{$key} = $value; |
|
43 | + } |
|
44 | + } |
|
45 | 45 | |
46 | - return $thisParams; |
|
47 | - } |
|
46 | + return $thisParams; |
|
47 | + } |
|
48 | 48 | } |
@@ -7,112 +7,112 @@ |
||
7 | 7 | |
8 | 8 | class CreateConnectionResponse extends Common |
9 | 9 | { |
10 | - /** |
|
11 | - * Telematics connection access account_id |
|
12 | - * @var string |
|
13 | - */ |
|
14 | - public $account_id; |
|
15 | - |
|
16 | - /** |
|
17 | - * Telematics connection access api_key |
|
18 | - * @var string |
|
19 | - */ |
|
20 | - public $api_key; |
|
21 | - |
|
22 | - /** |
|
23 | - * Telematics connection access token |
|
24 | - * @var string |
|
25 | - */ |
|
26 | - public $connection_token; |
|
27 | - |
|
28 | - /** |
|
29 | - * When the connection created |
|
30 | - * @var string |
|
31 | - */ |
|
32 | - public $created_at; |
|
33 | - |
|
34 | - /** |
|
35 | - * Telemetics connection ID |
|
36 | - * @var integer |
|
37 | - */ |
|
38 | - public $id; |
|
39 | - |
|
40 | - /** |
|
41 | - * Metadata, custom key-value storage. |
|
42 | - * @var array |
|
43 | - */ |
|
44 | - public $metadata; |
|
45 | - |
|
46 | - /** |
|
47 | - * Telemetics connection name |
|
48 | - * @var string |
|
49 | - */ |
|
50 | - public $name; |
|
51 | - |
|
52 | - /** |
|
53 | - * Telematics connection access password |
|
54 | - * @var string |
|
55 | - */ |
|
56 | - public $password; |
|
57 | - |
|
58 | - /** |
|
59 | - * Synchronized vehicles number |
|
60 | - * @var integer |
|
61 | - */ |
|
62 | - public $synced_vehicles_count; |
|
63 | - |
|
64 | - /** |
|
65 | - * Total vehicles number |
|
66 | - * @var integer |
|
67 | - */ |
|
68 | - public $total_vehicles_count; |
|
69 | - |
|
70 | - /** |
|
71 | - * When the connection updated |
|
72 | - * @var string |
|
73 | - */ |
|
74 | - public $updated_at; |
|
75 | - |
|
76 | - /** |
|
77 | - * Connection user ID |
|
78 | - * @var integer |
|
79 | - */ |
|
80 | - public $user_id; |
|
81 | - |
|
82 | - /** |
|
83 | - * Telematics connection access username |
|
84 | - * @var string |
|
85 | - */ |
|
86 | - public $username; |
|
87 | - |
|
88 | - /** |
|
89 | - * Vehicle tracking interval in seconds. |
|
90 | - * @var integer |
|
91 | - */ |
|
92 | - public $vehicle_position_refresh_rate; |
|
93 | - |
|
94 | - /** |
|
95 | - * Telemetics connection vendor |
|
96 | - * @var string |
|
97 | - */ |
|
98 | - public $vendor ; |
|
99 | - |
|
100 | - /** |
|
101 | - * Telemetics connection type ID |
|
102 | - * @var integer |
|
103 | - */ |
|
104 | - public $vendor_id ; |
|
105 | - |
|
106 | - public static function fromArray(array $params) |
|
107 | - { |
|
108 | - $thisParams = new self(); |
|
109 | - |
|
110 | - foreach ($params as $key => $value) { |
|
111 | - if (property_exists($thisParams, $key)) { |
|
112 | - $thisParams->{$key} = $value; |
|
113 | - } |
|
114 | - } |
|
115 | - |
|
116 | - return $thisParams; |
|
117 | - } |
|
10 | + /** |
|
11 | + * Telematics connection access account_id |
|
12 | + * @var string |
|
13 | + */ |
|
14 | + public $account_id; |
|
15 | + |
|
16 | + /** |
|
17 | + * Telematics connection access api_key |
|
18 | + * @var string |
|
19 | + */ |
|
20 | + public $api_key; |
|
21 | + |
|
22 | + /** |
|
23 | + * Telematics connection access token |
|
24 | + * @var string |
|
25 | + */ |
|
26 | + public $connection_token; |
|
27 | + |
|
28 | + /** |
|
29 | + * When the connection created |
|
30 | + * @var string |
|
31 | + */ |
|
32 | + public $created_at; |
|
33 | + |
|
34 | + /** |
|
35 | + * Telemetics connection ID |
|
36 | + * @var integer |
|
37 | + */ |
|
38 | + public $id; |
|
39 | + |
|
40 | + /** |
|
41 | + * Metadata, custom key-value storage. |
|
42 | + * @var array |
|
43 | + */ |
|
44 | + public $metadata; |
|
45 | + |
|
46 | + /** |
|
47 | + * Telemetics connection name |
|
48 | + * @var string |
|
49 | + */ |
|
50 | + public $name; |
|
51 | + |
|
52 | + /** |
|
53 | + * Telematics connection access password |
|
54 | + * @var string |
|
55 | + */ |
|
56 | + public $password; |
|
57 | + |
|
58 | + /** |
|
59 | + * Synchronized vehicles number |
|
60 | + * @var integer |
|
61 | + */ |
|
62 | + public $synced_vehicles_count; |
|
63 | + |
|
64 | + /** |
|
65 | + * Total vehicles number |
|
66 | + * @var integer |
|
67 | + */ |
|
68 | + public $total_vehicles_count; |
|
69 | + |
|
70 | + /** |
|
71 | + * When the connection updated |
|
72 | + * @var string |
|
73 | + */ |
|
74 | + public $updated_at; |
|
75 | + |
|
76 | + /** |
|
77 | + * Connection user ID |
|
78 | + * @var integer |
|
79 | + */ |
|
80 | + public $user_id; |
|
81 | + |
|
82 | + /** |
|
83 | + * Telematics connection access username |
|
84 | + * @var string |
|
85 | + */ |
|
86 | + public $username; |
|
87 | + |
|
88 | + /** |
|
89 | + * Vehicle tracking interval in seconds. |
|
90 | + * @var integer |
|
91 | + */ |
|
92 | + public $vehicle_position_refresh_rate; |
|
93 | + |
|
94 | + /** |
|
95 | + * Telemetics connection vendor |
|
96 | + * @var string |
|
97 | + */ |
|
98 | + public $vendor ; |
|
99 | + |
|
100 | + /** |
|
101 | + * Telemetics connection type ID |
|
102 | + * @var integer |
|
103 | + */ |
|
104 | + public $vendor_id ; |
|
105 | + |
|
106 | + public static function fromArray(array $params) |
|
107 | + { |
|
108 | + $thisParams = new self(); |
|
109 | + |
|
110 | + foreach ($params as $key => $value) { |
|
111 | + if (property_exists($thisParams, $key)) { |
|
112 | + $thisParams->{$key} = $value; |
|
113 | + } |
|
114 | + } |
|
115 | + |
|
116 | + return $thisParams; |
|
117 | + } |
|
118 | 118 | } |
119 | 119 | \ No newline at end of file |
@@ -95,13 +95,13 @@ |
||
95 | 95 | * Telemetics connection vendor |
96 | 96 | * @var string |
97 | 97 | */ |
98 | - public $vendor ; |
|
98 | + public $vendor; |
|
99 | 99 | |
100 | 100 | /** |
101 | 101 | * Telemetics connection type ID |
102 | 102 | * @var integer |
103 | 103 | */ |
104 | - public $vendor_id ; |
|
104 | + public $vendor_id; |
|
105 | 105 | |
106 | 106 | public static function fromArray(array $params) |
107 | 107 | { |
@@ -11,172 +11,172 @@ |
||
11 | 11 | */ |
12 | 12 | class TelematicsVendor extends Common |
13 | 13 | { |
14 | - /** |
|
15 | - * Unique ID of a telematics vendor. |
|
16 | - * @var string |
|
17 | - */ |
|
18 | - public $id; |
|
14 | + /** |
|
15 | + * Unique ID of a telematics vendor. |
|
16 | + * @var string |
|
17 | + */ |
|
18 | + public $id; |
|
19 | 19 | |
20 | - /** |
|
21 | - * Vendor name |
|
22 | - * @var string |
|
23 | - */ |
|
24 | - public $name; |
|
20 | + /** |
|
21 | + * Vendor name |
|
22 | + * @var string |
|
23 | + */ |
|
24 | + public $name; |
|
25 | 25 | |
26 | - /** |
|
27 | - * Vendor slug |
|
28 | - * @var string |
|
29 | - */ |
|
30 | - public $slug; |
|
26 | + /** |
|
27 | + * Vendor slug |
|
28 | + * @var string |
|
29 | + */ |
|
30 | + public $slug; |
|
31 | 31 | |
32 | - /** |
|
33 | - * Vendor description |
|
34 | - * @var string |
|
35 | - */ |
|
36 | - public $description; |
|
32 | + /** |
|
33 | + * Vendor description |
|
34 | + * @var string |
|
35 | + */ |
|
36 | + public $description; |
|
37 | 37 | |
38 | - /** |
|
39 | - * URL to the telematics vendor's logo. |
|
40 | - * @var string |
|
41 | - */ |
|
42 | - public $logo_url; |
|
38 | + /** |
|
39 | + * URL to the telematics vendor's logo. |
|
40 | + * @var string |
|
41 | + */ |
|
42 | + public $logo_url; |
|
43 | 43 | |
44 | - /** |
|
45 | - * Website URL of a telematics vendor. |
|
46 | - * @var string |
|
47 | - */ |
|
48 | - public $website_url; |
|
44 | + /** |
|
45 | + * Website URL of a telematics vendor. |
|
46 | + * @var string |
|
47 | + */ |
|
48 | + public $website_url; |
|
49 | 49 | |
50 | - /** |
|
51 | - * API URL of a telematics vendor. |
|
52 | - * @var string |
|
53 | - */ |
|
54 | - public $api_docs_url; |
|
50 | + /** |
|
51 | + * API URL of a telematics vendor. |
|
52 | + * @var string |
|
53 | + */ |
|
54 | + public $api_docs_url; |
|
55 | 55 | |
56 | - /** |
|
57 | - * If 1, the vendor is integrated in Route4Me |
|
58 | - * @var string |
|
59 | - */ |
|
60 | - public $is_integrated; |
|
56 | + /** |
|
57 | + * If 1, the vendor is integrated in Route4Me |
|
58 | + * @var string |
|
59 | + */ |
|
60 | + public $is_integrated; |
|
61 | 61 | |
62 | - /** |
|
63 | - * Vendors size. |
|
64 | - * <para>Accepted values:</para> |
|
65 | - * <para>global, regional, local. </para> |
|
66 | - * @var string |
|
67 | - */ |
|
68 | - public $size; |
|
62 | + /** |
|
63 | + * Vendors size. |
|
64 | + * <para>Accepted values:</para> |
|
65 | + * <para>global, regional, local. </para> |
|
66 | + * @var string |
|
67 | + */ |
|
68 | + public $size; |
|
69 | 69 | |
70 | - /** |
|
71 | - * An array of the countries, the vendor is operating. |
|
72 | - * @var Country[] |
|
73 | - */ |
|
74 | - public $countries = []; |
|
70 | + /** |
|
71 | + * An array of the countries, the vendor is operating. |
|
72 | + * @var Country[] |
|
73 | + */ |
|
74 | + public $countries = []; |
|
75 | 75 | |
76 | - /** |
|
77 | - * An array the vendor features |
|
78 | - * @var TelematicsVendorFeature[] |
|
79 | - */ |
|
80 | - public $features = []; |
|
76 | + /** |
|
77 | + * An array the vendor features |
|
78 | + * @var TelematicsVendorFeature[] |
|
79 | + */ |
|
80 | + public $features = []; |
|
81 | 81 | |
82 | - public static function fromArray(array $params) |
|
83 | - { |
|
84 | - $vendorsParameters = new self(); |
|
85 | - |
|
86 | - foreach ($params as $key => $value) { |
|
87 | - if (property_exists($vendorsParameters, $key)) { |
|
88 | - $vendorsParameters->{$key} = $value; |
|
89 | - } |
|
90 | - } |
|
91 | - |
|
92 | - return $vendorsParameters; |
|
93 | - } |
|
94 | - |
|
95 | - /** |
|
96 | - * Get vendor(s), search for vendors, compare vendors. |
|
97 | - * @param TelematicsVendorParameters $params |
|
98 | - * @return TelematicsVendorResponse or TelematicsVendorsResponse. |
|
99 | - */ |
|
100 | - public static function GetTelematicsVendors($params) |
|
101 | - { |
|
102 | - Route4Me::setBaseUrl(Endpoint::TELEMATICS_VENDORS); |
|
103 | - |
|
104 | - $allQueryFields = ['vendor_id', 'is_integrated', 'page', 'per_page', 'country', 'feature', 'search', 'vendors']; |
|
105 | - |
|
106 | - $vendors = Route4Me::makeRequst([ |
|
107 | - 'url' => '', |
|
108 | - 'method' => 'GET', |
|
109 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
110 | - ]); |
|
111 | - |
|
112 | - return $vendors; |
|
113 | - } |
|
114 | - |
|
115 | - /** |
|
116 | - * Returns a random telematics vendor (for tests). |
|
117 | - * @param $offset integer |
|
118 | - * @param $limit integer |
|
119 | - * @return Telematics vendor |
|
120 | - */ |
|
121 | - public static function GetRandomVendorID($offset, $limit) |
|
122 | - { |
|
123 | - $allVendors = self::GetTelematicsVendors(null); |
|
124 | - $vendorsNumber = sizeof($allVendors['vendors']); |
|
125 | - |
|
126 | - if ($vendorsNumber < $limit) { |
|
127 | - if ($vendorsNumber > $offset) { |
|
128 | - $limit = $vendorsNumber; |
|
129 | - } else { |
|
130 | - if ($vendorsNumber == $offset) { |
|
131 | - return $allVendors['vendors'][$offset]->{'vendor_id'}; |
|
132 | - } else { |
|
133 | - echo 'The vendors numbers are less than offset'; |
|
134 | - |
|
135 | - return null; |
|
136 | - } |
|
137 | - } |
|
138 | - } |
|
139 | - |
|
140 | - $randNumber = rand($offset, $limit); |
|
141 | - |
|
142 | - return $allVendors['vendors'][$randNumber]['id']; |
|
143 | - } |
|
144 | - |
|
145 | - /** |
|
146 | - * Register telematics member |
|
147 | - * @param TelematicsVendorParameters $params contains: |
|
148 | - * @param integer member_id : member ID |
|
149 | - * @param string api_key : API key |
|
150 | - * @return array from a TelematicsRegisterMemberResponse type object |
|
151 | - * @throws \Route4Me\Exception\ApiError |
|
152 | - */ |
|
153 | - public static function RegisterTelematicsMember($params) |
|
154 | - { |
|
155 | - Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
156 | - |
|
157 | - $allQueryFields = ['member_id', 'api_key']; |
|
158 | - |
|
159 | - $vendors = Route4Me::makeRequst([ |
|
160 | - 'url' => Endpoint::TELEMATICS_REGISTER_MEMBER, |
|
161 | - 'method' => 'GET', |
|
162 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
163 | - ]); |
|
164 | - |
|
165 | - return $vendors; |
|
166 | - } |
|
167 | - |
|
168 | - /** |
|
169 | - * Get a vendor by ID |
|
170 | - * @param string $vendorId |
|
171 | - * @return TelematicsVendor type object |
|
172 | - */ |
|
173 | - public static function getVendorById($vendorId) |
|
174 | - { |
|
175 | - if ($vendorId!=null) { |
|
176 | - return self::GetTelematicsVendors($vendorId); |
|
177 | - } else { |
|
178 | - return null; |
|
179 | - } |
|
180 | - } |
|
82 | + public static function fromArray(array $params) |
|
83 | + { |
|
84 | + $vendorsParameters = new self(); |
|
85 | + |
|
86 | + foreach ($params as $key => $value) { |
|
87 | + if (property_exists($vendorsParameters, $key)) { |
|
88 | + $vendorsParameters->{$key} = $value; |
|
89 | + } |
|
90 | + } |
|
91 | + |
|
92 | + return $vendorsParameters; |
|
93 | + } |
|
94 | + |
|
95 | + /** |
|
96 | + * Get vendor(s), search for vendors, compare vendors. |
|
97 | + * @param TelematicsVendorParameters $params |
|
98 | + * @return TelematicsVendorResponse or TelematicsVendorsResponse. |
|
99 | + */ |
|
100 | + public static function GetTelematicsVendors($params) |
|
101 | + { |
|
102 | + Route4Me::setBaseUrl(Endpoint::TELEMATICS_VENDORS); |
|
103 | + |
|
104 | + $allQueryFields = ['vendor_id', 'is_integrated', 'page', 'per_page', 'country', 'feature', 'search', 'vendors']; |
|
105 | + |
|
106 | + $vendors = Route4Me::makeRequst([ |
|
107 | + 'url' => '', |
|
108 | + 'method' => 'GET', |
|
109 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
110 | + ]); |
|
111 | + |
|
112 | + return $vendors; |
|
113 | + } |
|
114 | + |
|
115 | + /** |
|
116 | + * Returns a random telematics vendor (for tests). |
|
117 | + * @param $offset integer |
|
118 | + * @param $limit integer |
|
119 | + * @return Telematics vendor |
|
120 | + */ |
|
121 | + public static function GetRandomVendorID($offset, $limit) |
|
122 | + { |
|
123 | + $allVendors = self::GetTelematicsVendors(null); |
|
124 | + $vendorsNumber = sizeof($allVendors['vendors']); |
|
125 | + |
|
126 | + if ($vendorsNumber < $limit) { |
|
127 | + if ($vendorsNumber > $offset) { |
|
128 | + $limit = $vendorsNumber; |
|
129 | + } else { |
|
130 | + if ($vendorsNumber == $offset) { |
|
131 | + return $allVendors['vendors'][$offset]->{'vendor_id'}; |
|
132 | + } else { |
|
133 | + echo 'The vendors numbers are less than offset'; |
|
134 | + |
|
135 | + return null; |
|
136 | + } |
|
137 | + } |
|
138 | + } |
|
139 | + |
|
140 | + $randNumber = rand($offset, $limit); |
|
141 | + |
|
142 | + return $allVendors['vendors'][$randNumber]['id']; |
|
143 | + } |
|
144 | + |
|
145 | + /** |
|
146 | + * Register telematics member |
|
147 | + * @param TelematicsVendorParameters $params contains: |
|
148 | + * @param integer member_id : member ID |
|
149 | + * @param string api_key : API key |
|
150 | + * @return array from a TelematicsRegisterMemberResponse type object |
|
151 | + * @throws \Route4Me\Exception\ApiError |
|
152 | + */ |
|
153 | + public static function RegisterTelematicsMember($params) |
|
154 | + { |
|
155 | + Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
156 | + |
|
157 | + $allQueryFields = ['member_id', 'api_key']; |
|
158 | + |
|
159 | + $vendors = Route4Me::makeRequst([ |
|
160 | + 'url' => Endpoint::TELEMATICS_REGISTER_MEMBER, |
|
161 | + 'method' => 'GET', |
|
162 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
163 | + ]); |
|
164 | + |
|
165 | + return $vendors; |
|
166 | + } |
|
167 | + |
|
168 | + /** |
|
169 | + * Get a vendor by ID |
|
170 | + * @param string $vendorId |
|
171 | + * @return TelematicsVendor type object |
|
172 | + */ |
|
173 | + public static function getVendorById($vendorId) |
|
174 | + { |
|
175 | + if ($vendorId!=null) { |
|
176 | + return self::GetTelematicsVendors($vendorId); |
|
177 | + } else { |
|
178 | + return null; |
|
179 | + } |
|
180 | + } |
|
181 | 181 | |
182 | 182 | } |
@@ -123,11 +123,11 @@ |
||
123 | 123 | $allVendors = self::GetTelematicsVendors(null); |
124 | 124 | $vendorsNumber = sizeof($allVendors['vendors']); |
125 | 125 | |
126 | - if ($vendorsNumber < $limit) { |
|
127 | - if ($vendorsNumber > $offset) { |
|
126 | + if ($vendorsNumber<$limit) { |
|
127 | + if ($vendorsNumber>$offset) { |
|
128 | 128 | $limit = $vendorsNumber; |
129 | 129 | } else { |
130 | - if ($vendorsNumber == $offset) { |
|
130 | + if ($vendorsNumber==$offset) { |
|
131 | 131 | return $allVendors['vendors'][$offset]->{'vendor_id'}; |
132 | 132 | } else { |
133 | 133 | echo 'The vendors numbers are less than offset'; |
@@ -11,72 +11,72 @@ |
||
11 | 11 | */ |
12 | 12 | class TelematicsVendors extends Common |
13 | 13 | { |
14 | - /** |
|
15 | - * Unique ID of a telematics vendor. |
|
16 | - * @var type string |
|
17 | - */ |
|
18 | - public $id; |
|
14 | + /** |
|
15 | + * Unique ID of a telematics vendor. |
|
16 | + * @var type string |
|
17 | + */ |
|
18 | + public $id; |
|
19 | 19 | |
20 | - /** |
|
21 | - * Vendor name |
|
22 | - * @var type string |
|
23 | - */ |
|
24 | - public $name; |
|
20 | + /** |
|
21 | + * Vendor name |
|
22 | + * @var type string |
|
23 | + */ |
|
24 | + public $name; |
|
25 | 25 | |
26 | - /** |
|
27 | - * Vendor slug |
|
28 | - * @var type string |
|
29 | - */ |
|
30 | - public $slug; |
|
26 | + /** |
|
27 | + * Vendor slug |
|
28 | + * @var type string |
|
29 | + */ |
|
30 | + public $slug; |
|
31 | 31 | |
32 | - /** |
|
33 | - * Vendor description |
|
34 | - * @var type string |
|
35 | - */ |
|
36 | - public $description; |
|
32 | + /** |
|
33 | + * Vendor description |
|
34 | + * @var type string |
|
35 | + */ |
|
36 | + public $description; |
|
37 | 37 | |
38 | - /** |
|
39 | - * URL to the telematics vendor's logo. |
|
40 | - * @var type string |
|
41 | - */ |
|
42 | - public $logo_url; |
|
38 | + /** |
|
39 | + * URL to the telematics vendor's logo. |
|
40 | + * @var type string |
|
41 | + */ |
|
42 | + public $logo_url; |
|
43 | 43 | |
44 | - /** |
|
45 | - * Website URL of a telematics vendor. |
|
46 | - * @var type string |
|
47 | - */ |
|
48 | - public $website_url; |
|
44 | + /** |
|
45 | + * Website URL of a telematics vendor. |
|
46 | + * @var type string |
|
47 | + */ |
|
48 | + public $website_url; |
|
49 | 49 | |
50 | - /** |
|
51 | - * API URL of a telematics vendor. |
|
52 | - * @var type string |
|
53 | - */ |
|
54 | - public $api_docs_url; |
|
50 | + /** |
|
51 | + * API URL of a telematics vendor. |
|
52 | + * @var type string |
|
53 | + */ |
|
54 | + public $api_docs_url; |
|
55 | 55 | |
56 | - /** |
|
57 | - * If 1, the vendor is integrated in Route4Me |
|
58 | - * @var type string |
|
59 | - */ |
|
60 | - public $is_integrated; |
|
56 | + /** |
|
57 | + * If 1, the vendor is integrated in Route4Me |
|
58 | + * @var type string |
|
59 | + */ |
|
60 | + public $is_integrated; |
|
61 | 61 | |
62 | - /** |
|
63 | - * Vendors size. |
|
64 | - * <para>Accepted values:</para> |
|
65 | - * <para>global, regional, local. </para> |
|
66 | - * @var type string |
|
67 | - */ |
|
68 | - public $size; |
|
62 | + /** |
|
63 | + * Vendors size. |
|
64 | + * <para>Accepted values:</para> |
|
65 | + * <para>global, regional, local. </para> |
|
66 | + * @var type string |
|
67 | + */ |
|
68 | + public $size; |
|
69 | 69 | |
70 | - public static function fromArray(array $params) |
|
71 | - { |
|
72 | - $vendorsParameters = new self(); |
|
70 | + public static function fromArray(array $params) |
|
71 | + { |
|
72 | + $vendorsParameters = new self(); |
|
73 | 73 | |
74 | - foreach ($params as $key => $value) { |
|
75 | - if (property_exists($vendorsParameters, $key)) { |
|
76 | - $vendorsParameters->{$key} = $value; |
|
77 | - } |
|
78 | - } |
|
74 | + foreach ($params as $key => $value) { |
|
75 | + if (property_exists($vendorsParameters, $key)) { |
|
76 | + $vendorsParameters->{$key} = $value; |
|
77 | + } |
|
78 | + } |
|
79 | 79 | |
80 | - return $vendorsParameters; |
|
81 | - } |
|
80 | + return $vendorsParameters; |
|
81 | + } |
|
82 | 82 | } |
@@ -9,94 +9,94 @@ |
||
9 | 9 | */ |
10 | 10 | class TelematicsVendorParameters extends Common |
11 | 11 | { |
12 | - /** |
|
13 | - * An unique ID of a telematics vendor. |
|
14 | - * @var type integer |
|
15 | - */ |
|
16 | - public $vendor_id; |
|
12 | + /** |
|
13 | + * An unique ID of a telematics vendor. |
|
14 | + * @var type integer |
|
15 | + */ |
|
16 | + public $vendor_id; |
|
17 | 17 | |
18 | - /** |
|
19 | - * If equal to 1, the vendor is integrated in the Route4Me system. |
|
20 | - * @var type integer |
|
21 | - */ |
|
22 | - public $is_integrated; |
|
18 | + /** |
|
19 | + * If equal to 1, the vendor is integrated in the Route4Me system. |
|
20 | + * @var type integer |
|
21 | + */ |
|
22 | + public $is_integrated; |
|
23 | 23 | |
24 | - /** |
|
25 | - * Current page in the vendors collection |
|
26 | - * @var type integer |
|
27 | - */ |
|
28 | - public $page; |
|
24 | + /** |
|
25 | + * Current page in the vendors collection |
|
26 | + * @var type integer |
|
27 | + */ |
|
28 | + public $page; |
|
29 | 29 | |
30 | - /** |
|
31 | - * Vendors number per page |
|
32 | - * @var type integer |
|
33 | - */ |
|
34 | - public $per_page; |
|
30 | + /** |
|
31 | + * Vendors number per page |
|
32 | + * @var type integer |
|
33 | + */ |
|
34 | + public $per_page; |
|
35 | 35 | |
36 | - /** |
|
37 | - * The vendor's country |
|
38 | - * @var type string |
|
39 | - */ |
|
40 | - public $country; |
|
36 | + /** |
|
37 | + * The vendor's country |
|
38 | + * @var type string |
|
39 | + */ |
|
40 | + public $country; |
|
41 | 41 | |
42 | - /** |
|
43 | - * Vendor's feature |
|
44 | - * @var type string |
|
45 | - */ |
|
46 | - public $feature; |
|
42 | + /** |
|
43 | + * Vendor's feature |
|
44 | + * @var type string |
|
45 | + */ |
|
46 | + public $feature; |
|
47 | 47 | |
48 | - /** |
|
49 | - * A query string |
|
50 | - * @var type string |
|
51 | - */ |
|
52 | - public $search; |
|
48 | + /** |
|
49 | + * A query string |
|
50 | + * @var type string |
|
51 | + */ |
|
52 | + public $search; |
|
53 | 53 | |
54 | - /** |
|
55 | - * Comma-delimited list of the vendors IDs |
|
56 | - * @var type string |
|
57 | - */ |
|
58 | - public $vendors; |
|
54 | + /** |
|
55 | + * Comma-delimited list of the vendors IDs |
|
56 | + * @var type string |
|
57 | + */ |
|
58 | + public $vendors; |
|
59 | 59 | |
60 | - /** |
|
61 | - * Owner of a telematicss connection. |
|
62 | - * @var type integer |
|
63 | - */ |
|
64 | - public $member_id; |
|
60 | + /** |
|
61 | + * Owner of a telematicss connection. |
|
62 | + * @var type integer |
|
63 | + */ |
|
64 | + public $member_id; |
|
65 | 65 | |
66 | - /** |
|
67 | - * Is a user real or virtual |
|
68 | - * @var type integer |
|
69 | - */ |
|
70 | - public $is_virtual; |
|
66 | + /** |
|
67 | + * Is a user real or virtual |
|
68 | + * @var type integer |
|
69 | + */ |
|
70 | + public $is_virtual; |
|
71 | 71 | |
72 | - /** |
|
73 | - * API key |
|
74 | - * @var type string |
|
75 | - */ |
|
76 | - public $api_key; |
|
72 | + /** |
|
73 | + * API key |
|
74 | + * @var type string |
|
75 | + */ |
|
76 | + public $api_key; |
|
77 | 77 | |
78 | - /** |
|
79 | - * If true, remote credentials validated. |
|
80 | - * @var type Boolean |
|
81 | - */ |
|
82 | - public $validate_remote_credentials; |
|
78 | + /** |
|
79 | + * If true, remote credentials validated. |
|
80 | + * @var type Boolean |
|
81 | + */ |
|
82 | + public $validate_remote_credentials; |
|
83 | 83 | |
84 | - /** |
|
85 | - * API token. |
|
86 | - * @var type string |
|
87 | - */ |
|
88 | - public $api_token; |
|
84 | + /** |
|
85 | + * API token. |
|
86 | + * @var type string |
|
87 | + */ |
|
88 | + public $api_token; |
|
89 | 89 | |
90 | - public static function fromArray(array $params) |
|
91 | - { |
|
92 | - $thisParams = new self(); |
|
90 | + public static function fromArray(array $params) |
|
91 | + { |
|
92 | + $thisParams = new self(); |
|
93 | 93 | |
94 | - foreach ($params as $key => $value) { |
|
95 | - if (property_exists($thisParams, $key)) { |
|
96 | - $thisParams->{$key} = $value; |
|
97 | - } |
|
98 | - } |
|
94 | + foreach ($params as $key => $value) { |
|
95 | + if (property_exists($thisParams, $key)) { |
|
96 | + $thisParams->{$key} = $value; |
|
97 | + } |
|
98 | + } |
|
99 | 99 | |
100 | - return $thisParams; |
|
101 | - } |
|
100 | + return $thisParams; |
|
101 | + } |
|
102 | 102 | } |
@@ -9,47 +9,47 @@ |
||
9 | 9 | */ |
10 | 10 | class CustomNoteType extends Common |
11 | 11 | { |
12 | - /** |
|
13 | - * Note custom entry ID |
|
14 | - * @var integer |
|
15 | - */ |
|
16 | - public $note_custom_entry_id; |
|
17 | - |
|
18 | - /** |
|
19 | - * Note ID |
|
20 | - * @var integer |
|
21 | - */ |
|
22 | - public $note_id; |
|
23 | - |
|
24 | - /** |
|
25 | - * Note custom type ID |
|
26 | - * @var integer |
|
27 | - */ |
|
28 | - public $note_custom_type_id; |
|
29 | - |
|
30 | - /** |
|
31 | - * The value of a note custom type |
|
32 | - * @var string |
|
33 | - */ |
|
34 | - public $note_custom_value; |
|
35 | - |
|
36 | - /** |
|
37 | - * Note custom type |
|
38 | - */ |
|
39 | - public $note_custom_type; |
|
40 | - |
|
41 | - public static function fromArray(array $params) |
|
42 | - { |
|
43 | - $customNoteType = new self(); |
|
44 | - |
|
45 | - foreach ($params as $key => $value) { |
|
46 | - if (property_exists($customNoteType, $key)) { |
|
47 | - $customNoteType->{$key} = $value; |
|
48 | - } else { |
|
49 | - throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key"); |
|
50 | - } |
|
51 | - } |
|
52 | - |
|
53 | - return $customNoteType; |
|
54 | - } |
|
12 | + /** |
|
13 | + * Note custom entry ID |
|
14 | + * @var integer |
|
15 | + */ |
|
16 | + public $note_custom_entry_id; |
|
17 | + |
|
18 | + /** |
|
19 | + * Note ID |
|
20 | + * @var integer |
|
21 | + */ |
|
22 | + public $note_id; |
|
23 | + |
|
24 | + /** |
|
25 | + * Note custom type ID |
|
26 | + * @var integer |
|
27 | + */ |
|
28 | + public $note_custom_type_id; |
|
29 | + |
|
30 | + /** |
|
31 | + * The value of a note custom type |
|
32 | + * @var string |
|
33 | + */ |
|
34 | + public $note_custom_value; |
|
35 | + |
|
36 | + /** |
|
37 | + * Note custom type |
|
38 | + */ |
|
39 | + public $note_custom_type; |
|
40 | + |
|
41 | + public static function fromArray(array $params) |
|
42 | + { |
|
43 | + $customNoteType = new self(); |
|
44 | + |
|
45 | + foreach ($params as $key => $value) { |
|
46 | + if (property_exists($customNoteType, $key)) { |
|
47 | + $customNoteType->{$key} = $value; |
|
48 | + } else { |
|
49 | + throw new BadParam("Correct parameter must be provided. Wrong Parameter: $key"); |
|
50 | + } |
|
51 | + } |
|
52 | + |
|
53 | + return $customNoteType; |
|
54 | + } |
|
55 | 55 | } |
56 | 56 | \ No newline at end of file |
@@ -13,82 +13,82 @@ |
||
13 | 13 | */ |
14 | 14 | class VehiclesResponseV4 extends \Route4Me\Common |
15 | 15 | { |
16 | - /** @var int $current_page |
|
17 | - * Current page number in the driver reviews collection. |
|
18 | - */ |
|
19 | - public $current_page; |
|
20 | - |
|
21 | - /** @var VehicleV4[] $data |
|
22 | - * An array of the vehicles data. |
|
23 | - */ |
|
24 | - public $data = []; |
|
25 | - |
|
26 | - /** @var string $first_page_url |
|
27 | - * URL to the first page. |
|
28 | - */ |
|
29 | - public $first_page_url; |
|
30 | - |
|
31 | - /** @var int $from |
|
32 | - * From which vehicle is starting the page. |
|
33 | - */ |
|
34 | - public $from; |
|
35 | - |
|
36 | - /** @var int $last_page |
|
37 | - * Last page number in the vehicles collection. |
|
38 | - */ |
|
39 | - public $last_page; |
|
40 | - |
|
41 | - /** @var string $last_page_url |
|
42 | - * URL to the last page. |
|
43 | - */ |
|
44 | - public $last_page_url; |
|
45 | - |
|
46 | - /** @var string $next_page_url |
|
47 | - * URL to the next page. |
|
48 | - */ |
|
49 | - public $next_page_url; |
|
50 | - |
|
51 | - /** @var string $path |
|
52 | - * Path to the API endpoint. |
|
53 | - */ |
|
54 | - public $path; |
|
55 | - |
|
56 | - /** @var int $per_page |
|
57 | - * Vehicles number per page. |
|
58 | - */ |
|
59 | - public $per_page; |
|
60 | - |
|
61 | - /** @var string $prev_page_url |
|
62 | - * URL to the previous page. |
|
63 | - */ |
|
64 | - public $prev_page_url; |
|
65 | - |
|
66 | - /** @var int $to |
|
67 | - * To which vehicle is ending the page. |
|
68 | - */ |
|
69 | - public $to; |
|
70 | - |
|
71 | - /** @var int $total |
|
72 | - * Total number of the vehicles. |
|
73 | - */ |
|
74 | - public $total; |
|
75 | - |
|
76 | - public function __construct() |
|
77 | - { |
|
78 | - Route4Me::setBaseUrl(Endpoint::WH_BASE_URL); |
|
79 | - } |
|
80 | - |
|
81 | - public static function fromArray(array $params) |
|
82 | - { |
|
83 | - $vehiclesResponse = new self(); |
|
84 | - |
|
85 | - foreach ($params as $key => $value) { |
|
86 | - if (is_null(Common::getValue($params, $key))) continue; |
|
87 | - if (property_exists($vehiclesResponse, $key)) { |
|
88 | - $vehiclesResponse->$key = $value; |
|
89 | - } |
|
90 | - } |
|
91 | - |
|
92 | - return $vehiclesResponse; |
|
93 | - } |
|
16 | + /** @var int $current_page |
|
17 | + * Current page number in the driver reviews collection. |
|
18 | + */ |
|
19 | + public $current_page; |
|
20 | + |
|
21 | + /** @var VehicleV4[] $data |
|
22 | + * An array of the vehicles data. |
|
23 | + */ |
|
24 | + public $data = []; |
|
25 | + |
|
26 | + /** @var string $first_page_url |
|
27 | + * URL to the first page. |
|
28 | + */ |
|
29 | + public $first_page_url; |
|
30 | + |
|
31 | + /** @var int $from |
|
32 | + * From which vehicle is starting the page. |
|
33 | + */ |
|
34 | + public $from; |
|
35 | + |
|
36 | + /** @var int $last_page |
|
37 | + * Last page number in the vehicles collection. |
|
38 | + */ |
|
39 | + public $last_page; |
|
40 | + |
|
41 | + /** @var string $last_page_url |
|
42 | + * URL to the last page. |
|
43 | + */ |
|
44 | + public $last_page_url; |
|
45 | + |
|
46 | + /** @var string $next_page_url |
|
47 | + * URL to the next page. |
|
48 | + */ |
|
49 | + public $next_page_url; |
|
50 | + |
|
51 | + /** @var string $path |
|
52 | + * Path to the API endpoint. |
|
53 | + */ |
|
54 | + public $path; |
|
55 | + |
|
56 | + /** @var int $per_page |
|
57 | + * Vehicles number per page. |
|
58 | + */ |
|
59 | + public $per_page; |
|
60 | + |
|
61 | + /** @var string $prev_page_url |
|
62 | + * URL to the previous page. |
|
63 | + */ |
|
64 | + public $prev_page_url; |
|
65 | + |
|
66 | + /** @var int $to |
|
67 | + * To which vehicle is ending the page. |
|
68 | + */ |
|
69 | + public $to; |
|
70 | + |
|
71 | + /** @var int $total |
|
72 | + * Total number of the vehicles. |
|
73 | + */ |
|
74 | + public $total; |
|
75 | + |
|
76 | + public function __construct() |
|
77 | + { |
|
78 | + Route4Me::setBaseUrl(Endpoint::WH_BASE_URL); |
|
79 | + } |
|
80 | + |
|
81 | + public static function fromArray(array $params) |
|
82 | + { |
|
83 | + $vehiclesResponse = new self(); |
|
84 | + |
|
85 | + foreach ($params as $key => $value) { |
|
86 | + if (is_null(Common::getValue($params, $key))) continue; |
|
87 | + if (property_exists($vehiclesResponse, $key)) { |
|
88 | + $vehiclesResponse->$key = $value; |
|
89 | + } |
|
90 | + } |
|
91 | + |
|
92 | + return $vehiclesResponse; |
|
93 | + } |
|
94 | 94 | } |
95 | 95 | \ No newline at end of file |
@@ -83,7 +83,9 @@ |
||
83 | 83 | $vehiclesResponse = new self(); |
84 | 84 | |
85 | 85 | foreach ($params as $key => $value) { |
86 | - if (is_null(Common::getValue($params, $key))) continue; |
|
86 | + if (is_null(Common::getValue($params, $key))) { |
|
87 | + continue; |
|
88 | + } |
|
87 | 89 | if (property_exists($vehiclesResponse, $key)) { |
88 | 90 | $vehiclesResponse->$key = $value; |
89 | 91 | } |
@@ -11,138 +11,138 @@ |
||
11 | 11 | */ |
12 | 12 | class VehicleCreateResponseV4 extends \Route4Me\Common |
13 | 13 | { |
14 | - /** @var string $vehicle_alias |
|
15 | - * Vehicle alias |
|
16 | - */ |
|
17 | - public $vehicle_alias; |
|
18 | - |
|
19 | - /** @var string $vehicle_vin |
|
20 | - * Vehicle VIN (vehicle identification number) |
|
21 | - */ |
|
22 | - public $vehicle_vin; |
|
23 | - |
|
24 | - /** @var int $vehicle_reg_country_id |
|
25 | - * The ID of a country the vehicle was registered. |
|
26 | - */ |
|
27 | - public $vehicle_reg_country_id; |
|
28 | - |
|
29 | - /** @var string $vehicle_license_plate |
|
30 | - * A license plate of the vehicle. |
|
31 | - */ |
|
32 | - public $vehicle_license_plate; |
|
33 | - |
|
34 | - /** @var string $vehicle_type_id |
|
35 | - * Vehicle type ID. |
|
36 | - * Available values: |
|
37 | - * 'sedan', 'suv', 'pickup_truck', 'van', '18wheeler', 'cabin', 'hatchback', |
|
38 | - * 'motorcyle', 'waste_disposal', 'tree_cutting', 'bigrig', 'cement_mixer', |
|
39 | - * 'livestock_carrier', 'dairy','tractor_trailer' |
|
40 | - */ |
|
41 | - public $vehicle_type_id; |
|
42 | - |
|
43 | - /** @var int $vehicle_model_year |
|
44 | - * A year of the vehicle model. |
|
45 | - */ |
|
46 | - public $vehicle_model_year; |
|
47 | - |
|
48 | - /** @var string $vehicle_model |
|
49 | - * A model of the vehicle. |
|
50 | - */ |
|
51 | - public $vehicle_model; |
|
52 | - |
|
53 | - /** @var int $vehicle_year_acquired |
|
54 | - * A year, the vehicle was acquired. |
|
55 | - */ |
|
56 | - public $vehicle_year_acquired; |
|
57 | - |
|
58 | - /** @var string $purchased_new |
|
59 | - * If true, the vehicle was purchased new. |
|
60 | - */ |
|
61 | - public $purchased_new; |
|
62 | - |
|
63 | - /** @var string $license_start_date |
|
64 | - * Start date of the license (e.g. '2020-12-20'). |
|
65 | - */ |
|
66 | - public $license_start_date; |
|
67 | - |
|
68 | - /** @var string $license_end_date |
|
69 | - * End date of the license (e.g. '2020-12-20'). |
|
70 | - */ |
|
71 | - public $license_end_date; |
|
72 | - |
|
73 | - /** @var string $fuel_type |
|
74 | - * A type of the fuel. |
|
75 | - * Available values: |
|
76 | - * 'unleaded 87', 'unleaded 89', 'unleaded 91', 'unleaded 93', 'diesel', 'electric', 'hybrid' |
|
77 | - */ |
|
78 | - public $fuel_type; |
|
79 | - |
|
80 | - /** @var double $fuel_consumption_city |
|
81 | - * Fuel consumption in the city area. |
|
82 | - */ |
|
83 | - public $fuel_consumption_city; |
|
84 | - |
|
85 | - /** @var double $fuel_consumption_highway |
|
86 | - * Fuel consumption in the highway area. |
|
87 | - */ |
|
88 | - public $fuel_consumption_highway; |
|
89 | - |
|
90 | - /** @var int $member_id |
|
91 | - * Member unique ID |
|
92 | - */ |
|
93 | - public $member_id; |
|
94 | - |
|
95 | - /** @var string $vehicle_id |
|
96 | - * Vehicle unique 32-chars ID |
|
97 | - */ |
|
98 | - public $vehicle_id; |
|
99 | - |
|
100 | - /** @var string $timestamp_added |
|
101 | - * When the vehicle was added. |
|
102 | - */ |
|
103 | - public $timestamp_added; |
|
104 | - |
|
105 | - /** @var string $fuel_consumption_city_unit |
|
106 | - * Fuel consumption unit in the city area (e.g. 'mi/l'). |
|
107 | - */ |
|
108 | - public $fuel_consumption_city_unit; |
|
109 | - |
|
110 | - /** @var string $fuel_consumption_highway_unit |
|
111 | - * Fuel consumption unit in the highway area (e.g. 'mi/l'). |
|
112 | - */ |
|
113 | - public $fuel_consumption_highway_unit; |
|
114 | - |
|
115 | - /** @var double $mpg_city |
|
116 | - * Miles per gallon in the city area. |
|
117 | - */ |
|
118 | - public $mpg_city; |
|
119 | - |
|
120 | - /** @var double $mpg_highway |
|
121 | - * Miles per gallon in the highway area. |
|
122 | - */ |
|
123 | - public $mpg_highway; |
|
124 | - |
|
125 | - /** @var string $fuel_consumption_city_uf_value |
|
126 | - * Fuel consumption UF (utility factor) value in the city area. |
|
127 | - */ |
|
128 | - public $fuel_consumption_city_uf_value; |
|
129 | - |
|
130 | - /** @var string $fuel_consumption_highway_uf_value |
|
131 | - * Fuel consumption UF (utility factor) value in the highway area. |
|
132 | - */ |
|
133 | - public $fuel_consumption_highway_uf_value; |
|
134 | - |
|
135 | - public static function fromArray(array $params) |
|
136 | - { |
|
137 | - $vehicleCreateResponse = new self(); |
|
138 | - |
|
139 | - foreach ($params as $key => $value) { |
|
140 | - if (is_null(Common::getValue($params, $key))) continue; |
|
141 | - if (property_exists($vehicleCreateResponse, $key)) { |
|
142 | - $vehicleCreateResponse->$key = $value; |
|
143 | - } |
|
144 | - } |
|
145 | - |
|
146 | - return $vehicleCreateResponse; |
|
147 | - } |
|
14 | + /** @var string $vehicle_alias |
|
15 | + * Vehicle alias |
|
16 | + */ |
|
17 | + public $vehicle_alias; |
|
18 | + |
|
19 | + /** @var string $vehicle_vin |
|
20 | + * Vehicle VIN (vehicle identification number) |
|
21 | + */ |
|
22 | + public $vehicle_vin; |
|
23 | + |
|
24 | + /** @var int $vehicle_reg_country_id |
|
25 | + * The ID of a country the vehicle was registered. |
|
26 | + */ |
|
27 | + public $vehicle_reg_country_id; |
|
28 | + |
|
29 | + /** @var string $vehicle_license_plate |
|
30 | + * A license plate of the vehicle. |
|
31 | + */ |
|
32 | + public $vehicle_license_plate; |
|
33 | + |
|
34 | + /** @var string $vehicle_type_id |
|
35 | + * Vehicle type ID. |
|
36 | + * Available values: |
|
37 | + * 'sedan', 'suv', 'pickup_truck', 'van', '18wheeler', 'cabin', 'hatchback', |
|
38 | + * 'motorcyle', 'waste_disposal', 'tree_cutting', 'bigrig', 'cement_mixer', |
|
39 | + * 'livestock_carrier', 'dairy','tractor_trailer' |
|
40 | + */ |
|
41 | + public $vehicle_type_id; |
|
42 | + |
|
43 | + /** @var int $vehicle_model_year |
|
44 | + * A year of the vehicle model. |
|
45 | + */ |
|
46 | + public $vehicle_model_year; |
|
47 | + |
|
48 | + /** @var string $vehicle_model |
|
49 | + * A model of the vehicle. |
|
50 | + */ |
|
51 | + public $vehicle_model; |
|
52 | + |
|
53 | + /** @var int $vehicle_year_acquired |
|
54 | + * A year, the vehicle was acquired. |
|
55 | + */ |
|
56 | + public $vehicle_year_acquired; |
|
57 | + |
|
58 | + /** @var string $purchased_new |
|
59 | + * If true, the vehicle was purchased new. |
|
60 | + */ |
|
61 | + public $purchased_new; |
|
62 | + |
|
63 | + /** @var string $license_start_date |
|
64 | + * Start date of the license (e.g. '2020-12-20'). |
|
65 | + */ |
|
66 | + public $license_start_date; |
|
67 | + |
|
68 | + /** @var string $license_end_date |
|
69 | + * End date of the license (e.g. '2020-12-20'). |
|
70 | + */ |
|
71 | + public $license_end_date; |
|
72 | + |
|
73 | + /** @var string $fuel_type |
|
74 | + * A type of the fuel. |
|
75 | + * Available values: |
|
76 | + * 'unleaded 87', 'unleaded 89', 'unleaded 91', 'unleaded 93', 'diesel', 'electric', 'hybrid' |
|
77 | + */ |
|
78 | + public $fuel_type; |
|
79 | + |
|
80 | + /** @var double $fuel_consumption_city |
|
81 | + * Fuel consumption in the city area. |
|
82 | + */ |
|
83 | + public $fuel_consumption_city; |
|
84 | + |
|
85 | + /** @var double $fuel_consumption_highway |
|
86 | + * Fuel consumption in the highway area. |
|
87 | + */ |
|
88 | + public $fuel_consumption_highway; |
|
89 | + |
|
90 | + /** @var int $member_id |
|
91 | + * Member unique ID |
|
92 | + */ |
|
93 | + public $member_id; |
|
94 | + |
|
95 | + /** @var string $vehicle_id |
|
96 | + * Vehicle unique 32-chars ID |
|
97 | + */ |
|
98 | + public $vehicle_id; |
|
99 | + |
|
100 | + /** @var string $timestamp_added |
|
101 | + * When the vehicle was added. |
|
102 | + */ |
|
103 | + public $timestamp_added; |
|
104 | + |
|
105 | + /** @var string $fuel_consumption_city_unit |
|
106 | + * Fuel consumption unit in the city area (e.g. 'mi/l'). |
|
107 | + */ |
|
108 | + public $fuel_consumption_city_unit; |
|
109 | + |
|
110 | + /** @var string $fuel_consumption_highway_unit |
|
111 | + * Fuel consumption unit in the highway area (e.g. 'mi/l'). |
|
112 | + */ |
|
113 | + public $fuel_consumption_highway_unit; |
|
114 | + |
|
115 | + /** @var double $mpg_city |
|
116 | + * Miles per gallon in the city area. |
|
117 | + */ |
|
118 | + public $mpg_city; |
|
119 | + |
|
120 | + /** @var double $mpg_highway |
|
121 | + * Miles per gallon in the highway area. |
|
122 | + */ |
|
123 | + public $mpg_highway; |
|
124 | + |
|
125 | + /** @var string $fuel_consumption_city_uf_value |
|
126 | + * Fuel consumption UF (utility factor) value in the city area. |
|
127 | + */ |
|
128 | + public $fuel_consumption_city_uf_value; |
|
129 | + |
|
130 | + /** @var string $fuel_consumption_highway_uf_value |
|
131 | + * Fuel consumption UF (utility factor) value in the highway area. |
|
132 | + */ |
|
133 | + public $fuel_consumption_highway_uf_value; |
|
134 | + |
|
135 | + public static function fromArray(array $params) |
|
136 | + { |
|
137 | + $vehicleCreateResponse = new self(); |
|
138 | + |
|
139 | + foreach ($params as $key => $value) { |
|
140 | + if (is_null(Common::getValue($params, $key))) continue; |
|
141 | + if (property_exists($vehicleCreateResponse, $key)) { |
|
142 | + $vehicleCreateResponse->$key = $value; |
|
143 | + } |
|
144 | + } |
|
145 | + |
|
146 | + return $vehicleCreateResponse; |
|
147 | + } |
|
148 | 148 | } |
149 | 149 | \ No newline at end of file |
@@ -137,7 +137,9 @@ |
||
137 | 137 | $vehicleCreateResponse = new self(); |
138 | 138 | |
139 | 139 | foreach ($params as $key => $value) { |
140 | - if (is_null(Common::getValue($params, $key))) continue; |
|
140 | + if (is_null(Common::getValue($params, $key))) { |
|
141 | + continue; |
|
142 | + } |
|
141 | 143 | if (property_exists($vehicleCreateResponse, $key)) { |
142 | 144 | $vehicleCreateResponse->$key = $value; |
143 | 145 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | $vehicles = $this->getVehicles($params); |
112 | 112 | |
113 | - if (is_null($vehicles) || !isset($vehicles['data']) || sizeof($vehicles['data']) < 1) { |
|
113 | + if (is_null($vehicles) || !isset($vehicles['data']) || sizeof($vehicles['data'])<1) { |
|
114 | 114 | return null; |
115 | 115 | } |
116 | 116 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | public function getVehicleByID($vehicleID) |
123 | 123 | { |
124 | 124 | $response = Route4Me::makeRequst([ |
125 | - 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
125 | + 'url' => Endpoint::VEHICLE_V4.'/'.$vehicleID, |
|
126 | 126 | 'method' => 'GET', |
127 | 127 | ]); |
128 | 128 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $allBodyFields = Route4Me::getObjectProperties(new self(), ['vehicle_id']); |
137 | 137 | |
138 | 138 | $response = Route4Me::makeRequst([ |
139 | - 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
139 | + 'url' => Endpoint::VEHICLE_V4.'/'.$vehicleID, |
|
140 | 140 | 'method' => 'PUT', |
141 | 141 | 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
142 | 142 | 'HTTPHEADER' => 'Content-Type: application/json', |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null; |
168 | 168 | |
169 | 169 | $response = Route4Me::makeRequst([ |
170 | - 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
170 | + 'url' => Endpoint::VEHICLE_V4.'/'.$vehicleID, |
|
171 | 171 | 'method' => 'DELETE', |
172 | 172 | 'HTTPHEADER' => 'Content-Type: application/json', |
173 | 173 | ]); |
@@ -16,192 +16,192 @@ |
||
16 | 16 | */ |
17 | 17 | class Vehicle extends \Route4Me\Common |
18 | 18 | { |
19 | - public $vehicle_id; |
|
20 | - public $member_id; |
|
21 | - public $is_deleted; |
|
22 | - public $vehicle_name; |
|
23 | - public $vehicle_alias; |
|
24 | - public $vehicle_vin; |
|
25 | - //public $created_time; |
|
26 | - public $vehicle_reg_state_id; |
|
27 | - public $vehicle_reg_country_id; |
|
28 | - public $vehicle_license_plate; |
|
29 | - public $vehicle_type_id; |
|
30 | - public $timestamp_added; |
|
31 | - public $vehicle_make; |
|
32 | - public $vehicle_model_year; |
|
33 | - public $vehicle_model; |
|
34 | - public $vehicle_year_acquired; |
|
35 | - public $vehicle_cost_new; |
|
36 | - public $purchased_new; |
|
37 | - public $license_start_date; |
|
38 | - public $license_end_date; |
|
39 | - public $vehicle_axle_count; |
|
40 | - public $mpg_city; |
|
41 | - public $mpg_highway; |
|
42 | - public $fuel_type; |
|
43 | - public $height_inches; |
|
44 | - public $weight_lb; |
|
45 | - public $route4me_telematics_internal_api_key; |
|
46 | - public $is_operational; |
|
47 | - public $external_telematics_vehicle_id; |
|
48 | - public $r4m_telematics_gateway_connection_id; |
|
49 | - public $r4m_telematics_gateway_vehicle_id; |
|
50 | - public $has_trailer; |
|
51 | - public $heightInInches; |
|
52 | - public $lengthInInches; |
|
53 | - public $widthInInches; |
|
54 | - public $maxWeightPerAxleGroupInPounds; |
|
55 | - public $numAxles; |
|
56 | - public $weightInPounds; |
|
57 | - public $HazmatType; |
|
58 | - public $LowEmissionZonePref; |
|
59 | - public $Use53FootTrailerRouting; |
|
60 | - public $UseNationalNetwork; |
|
61 | - public $UseTruckRestrictions; |
|
62 | - public $AvoidFerries; |
|
63 | - public $DividedHighwayAvoidPreference; |
|
64 | - public $FreewayAvoidPreference; |
|
65 | - public $InternationalBordersOpen; |
|
66 | - public $TollRoadUsage; |
|
67 | - public $hwy_only; |
|
68 | - public $long_combination_vehicle; |
|
69 | - public $avoid_highways; |
|
70 | - public $side_street_adherence; |
|
71 | - public $truck_config; |
|
72 | - public $height_metric; |
|
73 | - public $length_metric; |
|
74 | - public $width_metric; |
|
75 | - public $weight_metric; |
|
76 | - public $max_weight_per_axle_group_metric; |
|
77 | - public $timestamp_removed; |
|
78 | - |
|
79 | - public function __construct() |
|
80 | - { |
|
81 | - Route4Me::setBaseUrl(Endpoint::WH_BASE_URL); |
|
82 | - } |
|
83 | - |
|
84 | - public static function fromArray(array $params) |
|
85 | - { |
|
86 | - $vehicle = new self(); |
|
87 | - |
|
88 | - foreach ($params as $key => $value) { |
|
89 | - if (is_null(Common::getValue($params, $key))) { |
|
90 | - continue; |
|
91 | - } |
|
92 | - if (property_exists($vehicle, $key)) { |
|
93 | - $vehicle->$key = $value; |
|
94 | - } |
|
95 | - } |
|
96 | - |
|
97 | - return $vehicle; |
|
98 | - } |
|
99 | - |
|
100 | - /** |
|
101 | - * @deprecated 1.2.6 |
|
102 | - * @see \Route4Me\V5\Vehicles\DataTypes\Vehicle::getVehiclesPaginatedList() |
|
103 | - */ |
|
104 | - public static function getVehicles($params) |
|
105 | - { |
|
106 | - $allQueryFields = ['with_pagination', 'page', 'perPage']; |
|
107 | - |
|
108 | - $response = Route4Me::makeRequst([ |
|
109 | - 'url' => Endpoint::VEHICLE_V4, |
|
110 | - 'method' => 'GET', |
|
111 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
112 | - ]); |
|
113 | - |
|
114 | - return $response; |
|
115 | - } |
|
116 | - |
|
117 | - public function getRandomVehicleId($page, $perPage) |
|
118 | - { |
|
119 | - $params = [ |
|
120 | - 'page' => isset($page) ? $page : 1, |
|
121 | - 'perPage' => isset($perPage) ? $perPage : 10, |
|
122 | - 'with_pagination' => true, |
|
123 | - ]; |
|
124 | - |
|
125 | - $vehicles = $this->getVehicles($params); |
|
126 | - |
|
127 | - if (is_null($vehicles) || !isset($vehicles['data']) || sizeof($vehicles['data']) < 1) { |
|
128 | - return null; |
|
129 | - } |
|
130 | - |
|
131 | - $randomIndex = rand(0, sizeof($vehicles['data']) - 1); |
|
132 | - |
|
133 | - return $vehicles['data'][$randomIndex]['vehicle_id']; |
|
134 | - } |
|
135 | - |
|
136 | - /** |
|
137 | - * @deprecated 1.2.6 |
|
138 | - * @see \Route4Me\V5\Vehicles\DataTypes\Vehicle::getVehicleById() |
|
139 | - */ |
|
140 | - public function getVehicleByID($vehicleID) |
|
141 | - { |
|
142 | - $response = Route4Me::makeRequst([ |
|
143 | - 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
144 | - 'method' => 'GET', |
|
145 | - ]); |
|
146 | - |
|
147 | - return $response; |
|
148 | - } |
|
149 | - |
|
150 | - /** |
|
151 | - * @deprecated 1.2.6 |
|
152 | - * @see \Route4Me\V5\Vehicles\DataTypes\Vehicle::updateVehicle() |
|
153 | - */ |
|
154 | - public function updateVehicle($params) |
|
155 | - { |
|
156 | - $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null; |
|
157 | - |
|
158 | - $allBodyFields = Route4Me::getObjectProperties(new self(), ['vehicle_id']); |
|
159 | - |
|
160 | - $response = Route4Me::makeRequst([ |
|
161 | - 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
162 | - 'method' => 'PUT', |
|
163 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
164 | - 'HTTPHEADER' => 'Content-Type: application/json', |
|
165 | - ]); |
|
166 | - |
|
167 | - return $response; |
|
168 | - } |
|
169 | - |
|
170 | - /** |
|
171 | - * @deprecated 1.2.6 |
|
172 | - * @see \Route4Me\V5\Vehicles\DataTypes\Vehicle::createVehicle() |
|
173 | - */ |
|
174 | - public function createVehicle($params) |
|
175 | - { |
|
176 | - $excludeFields = ['vehicle_id', 'is_deleted', 'created_time', 'timestamp_added', 'timestamp_removed']; |
|
177 | - $allBodyFields = Route4Me::getObjectProperties(new self(), $excludeFields); |
|
178 | - |
|
179 | - Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
180 | - |
|
181 | - $response = Route4Me::makeRequst([ |
|
182 | - 'url' => Endpoint::VEHICLE_V4_API, |
|
183 | - 'method' => 'POST', |
|
184 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
185 | - 'HTTPHEADER' => 'Content-Type: application/json', |
|
186 | - ]); |
|
187 | - |
|
188 | - return $response; |
|
189 | - } |
|
190 | - |
|
191 | - /** |
|
192 | - * @deprecated 1.2.6 |
|
193 | - * @see \Route4Me\V5\Vehicles\DataTypes\Vehicle::removeVehicle() |
|
194 | - */ |
|
195 | - public function removeVehicle($params) |
|
196 | - { |
|
197 | - $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null; |
|
198 | - |
|
199 | - $response = Route4Me::makeRequst([ |
|
200 | - 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
201 | - 'method' => 'DELETE', |
|
202 | - 'HTTPHEADER' => 'Content-Type: application/json', |
|
203 | - ]); |
|
204 | - |
|
205 | - return $response; |
|
206 | - } |
|
19 | + public $vehicle_id; |
|
20 | + public $member_id; |
|
21 | + public $is_deleted; |
|
22 | + public $vehicle_name; |
|
23 | + public $vehicle_alias; |
|
24 | + public $vehicle_vin; |
|
25 | + //public $created_time; |
|
26 | + public $vehicle_reg_state_id; |
|
27 | + public $vehicle_reg_country_id; |
|
28 | + public $vehicle_license_plate; |
|
29 | + public $vehicle_type_id; |
|
30 | + public $timestamp_added; |
|
31 | + public $vehicle_make; |
|
32 | + public $vehicle_model_year; |
|
33 | + public $vehicle_model; |
|
34 | + public $vehicle_year_acquired; |
|
35 | + public $vehicle_cost_new; |
|
36 | + public $purchased_new; |
|
37 | + public $license_start_date; |
|
38 | + public $license_end_date; |
|
39 | + public $vehicle_axle_count; |
|
40 | + public $mpg_city; |
|
41 | + public $mpg_highway; |
|
42 | + public $fuel_type; |
|
43 | + public $height_inches; |
|
44 | + public $weight_lb; |
|
45 | + public $route4me_telematics_internal_api_key; |
|
46 | + public $is_operational; |
|
47 | + public $external_telematics_vehicle_id; |
|
48 | + public $r4m_telematics_gateway_connection_id; |
|
49 | + public $r4m_telematics_gateway_vehicle_id; |
|
50 | + public $has_trailer; |
|
51 | + public $heightInInches; |
|
52 | + public $lengthInInches; |
|
53 | + public $widthInInches; |
|
54 | + public $maxWeightPerAxleGroupInPounds; |
|
55 | + public $numAxles; |
|
56 | + public $weightInPounds; |
|
57 | + public $HazmatType; |
|
58 | + public $LowEmissionZonePref; |
|
59 | + public $Use53FootTrailerRouting; |
|
60 | + public $UseNationalNetwork; |
|
61 | + public $UseTruckRestrictions; |
|
62 | + public $AvoidFerries; |
|
63 | + public $DividedHighwayAvoidPreference; |
|
64 | + public $FreewayAvoidPreference; |
|
65 | + public $InternationalBordersOpen; |
|
66 | + public $TollRoadUsage; |
|
67 | + public $hwy_only; |
|
68 | + public $long_combination_vehicle; |
|
69 | + public $avoid_highways; |
|
70 | + public $side_street_adherence; |
|
71 | + public $truck_config; |
|
72 | + public $height_metric; |
|
73 | + public $length_metric; |
|
74 | + public $width_metric; |
|
75 | + public $weight_metric; |
|
76 | + public $max_weight_per_axle_group_metric; |
|
77 | + public $timestamp_removed; |
|
78 | + |
|
79 | + public function __construct() |
|
80 | + { |
|
81 | + Route4Me::setBaseUrl(Endpoint::WH_BASE_URL); |
|
82 | + } |
|
83 | + |
|
84 | + public static function fromArray(array $params) |
|
85 | + { |
|
86 | + $vehicle = new self(); |
|
87 | + |
|
88 | + foreach ($params as $key => $value) { |
|
89 | + if (is_null(Common::getValue($params, $key))) { |
|
90 | + continue; |
|
91 | + } |
|
92 | + if (property_exists($vehicle, $key)) { |
|
93 | + $vehicle->$key = $value; |
|
94 | + } |
|
95 | + } |
|
96 | + |
|
97 | + return $vehicle; |
|
98 | + } |
|
99 | + |
|
100 | + /** |
|
101 | + * @deprecated 1.2.6 |
|
102 | + * @see \Route4Me\V5\Vehicles\DataTypes\Vehicle::getVehiclesPaginatedList() |
|
103 | + */ |
|
104 | + public static function getVehicles($params) |
|
105 | + { |
|
106 | + $allQueryFields = ['with_pagination', 'page', 'perPage']; |
|
107 | + |
|
108 | + $response = Route4Me::makeRequst([ |
|
109 | + 'url' => Endpoint::VEHICLE_V4, |
|
110 | + 'method' => 'GET', |
|
111 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
112 | + ]); |
|
113 | + |
|
114 | + return $response; |
|
115 | + } |
|
116 | + |
|
117 | + public function getRandomVehicleId($page, $perPage) |
|
118 | + { |
|
119 | + $params = [ |
|
120 | + 'page' => isset($page) ? $page : 1, |
|
121 | + 'perPage' => isset($perPage) ? $perPage : 10, |
|
122 | + 'with_pagination' => true, |
|
123 | + ]; |
|
124 | + |
|
125 | + $vehicles = $this->getVehicles($params); |
|
126 | + |
|
127 | + if (is_null($vehicles) || !isset($vehicles['data']) || sizeof($vehicles['data']) < 1) { |
|
128 | + return null; |
|
129 | + } |
|
130 | + |
|
131 | + $randomIndex = rand(0, sizeof($vehicles['data']) - 1); |
|
132 | + |
|
133 | + return $vehicles['data'][$randomIndex]['vehicle_id']; |
|
134 | + } |
|
135 | + |
|
136 | + /** |
|
137 | + * @deprecated 1.2.6 |
|
138 | + * @see \Route4Me\V5\Vehicles\DataTypes\Vehicle::getVehicleById() |
|
139 | + */ |
|
140 | + public function getVehicleByID($vehicleID) |
|
141 | + { |
|
142 | + $response = Route4Me::makeRequst([ |
|
143 | + 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
144 | + 'method' => 'GET', |
|
145 | + ]); |
|
146 | + |
|
147 | + return $response; |
|
148 | + } |
|
149 | + |
|
150 | + /** |
|
151 | + * @deprecated 1.2.6 |
|
152 | + * @see \Route4Me\V5\Vehicles\DataTypes\Vehicle::updateVehicle() |
|
153 | + */ |
|
154 | + public function updateVehicle($params) |
|
155 | + { |
|
156 | + $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null; |
|
157 | + |
|
158 | + $allBodyFields = Route4Me::getObjectProperties(new self(), ['vehicle_id']); |
|
159 | + |
|
160 | + $response = Route4Me::makeRequst([ |
|
161 | + 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
162 | + 'method' => 'PUT', |
|
163 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
164 | + 'HTTPHEADER' => 'Content-Type: application/json', |
|
165 | + ]); |
|
166 | + |
|
167 | + return $response; |
|
168 | + } |
|
169 | + |
|
170 | + /** |
|
171 | + * @deprecated 1.2.6 |
|
172 | + * @see \Route4Me\V5\Vehicles\DataTypes\Vehicle::createVehicle() |
|
173 | + */ |
|
174 | + public function createVehicle($params) |
|
175 | + { |
|
176 | + $excludeFields = ['vehicle_id', 'is_deleted', 'created_time', 'timestamp_added', 'timestamp_removed']; |
|
177 | + $allBodyFields = Route4Me::getObjectProperties(new self(), $excludeFields); |
|
178 | + |
|
179 | + Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
180 | + |
|
181 | + $response = Route4Me::makeRequst([ |
|
182 | + 'url' => Endpoint::VEHICLE_V4_API, |
|
183 | + 'method' => 'POST', |
|
184 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
185 | + 'HTTPHEADER' => 'Content-Type: application/json', |
|
186 | + ]); |
|
187 | + |
|
188 | + return $response; |
|
189 | + } |
|
190 | + |
|
191 | + /** |
|
192 | + * @deprecated 1.2.6 |
|
193 | + * @see \Route4Me\V5\Vehicles\DataTypes\Vehicle::removeVehicle() |
|
194 | + */ |
|
195 | + public function removeVehicle($params) |
|
196 | + { |
|
197 | + $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null; |
|
198 | + |
|
199 | + $response = Route4Me::makeRequst([ |
|
200 | + 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
201 | + 'method' => 'DELETE', |
|
202 | + 'HTTPHEADER' => 'Content-Type: application/json', |
|
203 | + ]); |
|
204 | + |
|
205 | + return $response; |
|
206 | + } |
|
207 | 207 | } |