@@ -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 |
@@ -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 |
@@ -13,258 +13,258 @@ |
||
13 | 13 | */ |
14 | 14 | class VehicleV4 extends \Route4Me\Common |
15 | 15 | { |
16 | - /** @var string $vehicle_id |
|
17 | - * Vehicle unique 32-chars ID |
|
18 | - */ |
|
19 | - public $vehicle_id; |
|
20 | - |
|
21 | - /** @var int $member_id |
|
22 | - * Member unique ID |
|
23 | - */ |
|
24 | - public $member_id; |
|
25 | - |
|
26 | - /** @var boolean $is_deleted |
|
27 | - * True, if the vehicle was deleted. |
|
28 | - */ |
|
29 | - public $is_deleted; |
|
30 | - |
|
31 | - /** @var string $vehicle_alias |
|
32 | - * Vehicle alias |
|
33 | - */ |
|
34 | - public $vehicle_alias; |
|
35 | - |
|
36 | - /** @var string $vehicle_vin |
|
37 | - * Vehicle VIN (vehicle identification number) |
|
38 | - */ |
|
39 | - public $vehicle_vin; |
|
40 | - |
|
41 | - /** @var int $vehicle_reg_state_id |
|
42 | - * The ID of a state the vehicle was registered. |
|
43 | - */ |
|
44 | - public $vehicle_reg_state_id; |
|
45 | - |
|
46 | - /** @var int $vehicle_reg_country_id |
|
47 | - * The ID of a country the vehicle was registered. |
|
48 | - */ |
|
49 | - public $vehicle_reg_country_id; |
|
50 | - |
|
51 | - /** @var string $vehicle_license_plate |
|
52 | - * A license plate of the vehicle. |
|
53 | - */ |
|
54 | - public $vehicle_license_plate; |
|
55 | - |
|
56 | - /** @var string $vehicle_type_id |
|
57 | - * Vehicle type ID. |
|
58 | - * Available values: |
|
59 | - * 'sedan', 'suv', 'pickup_truck', 'van', '18wheeler', 'cabin', 'hatchback', |
|
60 | - * 'motorcyle', 'waste_disposal', 'tree_cutting', 'bigrig', 'cement_mixer', |
|
61 | - * 'livestock_carrier', 'dairy','tractor_trailer' |
|
62 | - */ |
|
63 | - public $vehicle_type_id; |
|
64 | - |
|
65 | - /** @var string $timestamp_added |
|
66 | - * When the vehicle was added. |
|
67 | - */ |
|
68 | - public $timestamp_added; |
|
69 | - |
|
70 | - /** @var string $vehicle_make |
|
71 | - * Vehicle maker brend. |
|
72 | - * Available values: |
|
73 | - * 'american coleman', 'bmw', 'chevrolet', 'ford', 'freightliner', 'gmc', |
|
74 | - * 'hino', 'honda', 'isuzu', 'kenworth', 'mack', 'mercedes-benz', 'mitsubishi', |
|
75 | - * 'navistar', 'nissan', 'peterbilt', 'renault', 'scania', 'sterling', 'toyota', |
|
76 | - * 'volvo', 'western star' |
|
77 | - */ |
|
78 | - public $vehicle_make; |
|
79 | - |
|
80 | - /** @var int $vehicle_model_year |
|
81 | - * A year of the vehicle model. |
|
82 | - */ |
|
83 | - public $vehicle_model_year; |
|
84 | - |
|
85 | - /** @var string $vehicle_model |
|
86 | - * A model of the vehicle. |
|
87 | - */ |
|
88 | - public $vehicle_model; |
|
89 | - |
|
90 | - /** @var int $vehicle_year_acquired |
|
91 | - * A year, the vehicle was acquired. |
|
92 | - */ |
|
93 | - public $vehicle_year_acquired; |
|
94 | - |
|
95 | - /** @var string $vehicle_cost_new |
|
96 | - * A cost of the new vehicle. |
|
97 | - */ |
|
98 | - public $vehicle_cost_new; |
|
99 | - |
|
100 | - /** @var string $purchased_new |
|
101 | - * If true, the vehicle was purchased new. |
|
102 | - */ |
|
103 | - public $purchased_new; |
|
104 | - |
|
105 | - /** @var string $license_start_date |
|
106 | - * Start date of the license (e.g. '2020-12-20'). |
|
107 | - */ |
|
108 | - public $license_start_date; |
|
109 | - |
|
110 | - /** @var string $license_end_date |
|
111 | - * End date of the license (e.g. '2020-12-20'). |
|
112 | - */ |
|
113 | - public $license_end_date; |
|
114 | - |
|
115 | - /** @var boolean $is_operational |
|
116 | - * If true, the vehicle is operational. |
|
117 | - */ |
|
118 | - public $is_operational; |
|
119 | - |
|
120 | - /** @var string $fuel_type |
|
121 | - * A type of the fuel. |
|
122 | - * Available values: |
|
123 | - * 'unleaded 87', 'unleaded 89', 'unleaded 91', 'unleaded 93', 'diesel', 'electric', 'hybrid' |
|
124 | - */ |
|
125 | - public $fuel_type; |
|
126 | - |
|
127 | - /** @var string $external_telematics_vehicle_id |
|
128 | - * External telematics vehicle ID. |
|
129 | - */ |
|
130 | - public $external_telematics_vehicle_id; |
|
131 | - |
|
132 | - /** @var string $timestamp_removed |
|
133 | - * When the vehicle was removed. |
|
134 | - */ |
|
135 | - public $timestamp_removed; |
|
136 | - |
|
137 | - /** @var string $vehicle_profile_id |
|
138 | - * Vehicle profile ID |
|
139 | - */ |
|
140 | - public $vehicle_profile_id; |
|
141 | - |
|
142 | - /** @var double $fuel_consumption_city |
|
143 | - * Fuel consumption in the city area. |
|
144 | - */ |
|
145 | - public $fuel_consumption_city; |
|
146 | - |
|
147 | - /** @var double $fuel_consumption_highway |
|
148 | - * Fuel consumption in the highway area. |
|
149 | - */ |
|
150 | - public $fuel_consumption_highway; |
|
151 | - |
|
152 | - /** @var string $fuel_consumption_city_unit |
|
153 | - * Fuel consumption unit in the city area (e.g. 'mi/l'). |
|
154 | - */ |
|
155 | - public $fuel_consumption_city_unit; |
|
156 | - |
|
157 | - /** @var string $fuel_consumption_highway_unit |
|
158 | - * Fuel consumption unit in the highway area (e.g. 'mi/l'). |
|
159 | - */ |
|
160 | - public $fuel_consumption_highway_unit; |
|
161 | - |
|
162 | - /** @var double $mpg_city |
|
163 | - * Miles per gallon in the city area. |
|
164 | - */ |
|
165 | - public $mpg_city; |
|
166 | - |
|
167 | - /** @var double $mpg_highway |
|
168 | - * Miles per gallon in the highway area. |
|
169 | - */ |
|
170 | - public $mpg_highway; |
|
171 | - |
|
172 | - /** @var string $fuel_consumption_city_uf_value |
|
173 | - * Fuel consumption UF (utility factor) value in the city area. |
|
174 | - */ |
|
175 | - public $fuel_consumption_city_uf_value; |
|
176 | - |
|
177 | - /** @var string $fuel_consumption_highway_uf_value |
|
178 | - * Fuel consumption UF (utility factor) value in the highway area. |
|
179 | - */ |
|
180 | - public $fuel_consumption_highway_uf_value; |
|
181 | - |
|
182 | - public function __construct() |
|
183 | - { |
|
184 | - Route4Me::setBaseUrl(Endpoint::WH_BASE_URL); |
|
185 | - } |
|
186 | - |
|
187 | - public static function fromArray(array $params) |
|
188 | - { |
|
189 | - $vehicle = new self(); |
|
190 | - |
|
191 | - foreach ($params as $key => $value) { |
|
192 | - if (is_null(Common::getValue($params, $key))) continue; |
|
193 | - if (property_exists($vehicle, $key)) { |
|
194 | - $vehicle->$key = $value; |
|
195 | - } |
|
196 | - } |
|
197 | - |
|
198 | - return $vehicle; |
|
199 | - } |
|
200 | - |
|
201 | - public static function getVehicles($params) |
|
202 | - { |
|
203 | - $allQueryFields = ['with_pagination', 'page', 'perPage']; |
|
204 | - |
|
205 | - $response = Route4Me::makeRequst([ |
|
206 | - 'url' => Endpoint::VEHICLE_V4, |
|
207 | - 'method' => 'GET', |
|
208 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
209 | - ]); |
|
210 | - |
|
211 | - return $response; |
|
212 | - } |
|
213 | - |
|
214 | - public function getVehicleByID($vehicleID) |
|
215 | - { |
|
216 | - $response = Route4Me::makeRequst([ |
|
217 | - 'url' => Endpoint::VEHICLE_V4.'/'.$vehicleID, |
|
218 | - 'method' => 'GET', |
|
219 | - ]); |
|
220 | - |
|
221 | - return $response; |
|
222 | - } |
|
223 | - |
|
224 | - public function updateVehicle($params) |
|
225 | - { |
|
226 | - $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null; |
|
227 | - |
|
228 | - $allBodyFields = Route4Me::getObjectProperties(new self(), ['vehicle_id']); |
|
229 | - |
|
230 | - $response = Route4Me::makeRequst([ |
|
231 | - 'url' => Endpoint::VEHICLE_V4.'/'.$vehicleID, |
|
232 | - 'method' => 'PUT', |
|
233 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
234 | - 'HTTPHEADER' => 'Content-Type: application/json', |
|
235 | - ]); |
|
236 | - |
|
237 | - return $response; |
|
238 | - } |
|
239 | - |
|
240 | - public function createVehicle($params) |
|
241 | - { |
|
242 | - $excludeFields = ['vehicle_id','is_deleted','created_time','timestamp_added','timestamp_removed']; |
|
243 | - $allBodyFields = Route4Me::getObjectProperties(new self(), $excludeFields); |
|
244 | - |
|
245 | - //Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
246 | - |
|
247 | - $response = Route4Me::makeRequst([ |
|
248 | - 'url' => Endpoint::VEHICLE_V4, |
|
249 | - 'method' => 'POST', |
|
250 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
251 | - 'HTTPHEADER' => 'Content-Type: application/json', |
|
252 | - ]); |
|
253 | - |
|
254 | - return $response; |
|
255 | - } |
|
256 | - |
|
257 | - public function removeVehicle($params) |
|
258 | - { |
|
259 | - $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null; |
|
260 | - |
|
261 | - $response = Route4Me::makeRequst([ |
|
262 | - 'url' => Endpoint::VEHICLE_V4.'/'.$vehicleID, |
|
263 | - 'method' => 'DELETE', |
|
264 | - 'HTTPHEADER' => 'Content-Type: application/json', |
|
265 | - ]); |
|
266 | - |
|
267 | - return $response; |
|
268 | - } |
|
16 | + /** @var string $vehicle_id |
|
17 | + * Vehicle unique 32-chars ID |
|
18 | + */ |
|
19 | + public $vehicle_id; |
|
20 | + |
|
21 | + /** @var int $member_id |
|
22 | + * Member unique ID |
|
23 | + */ |
|
24 | + public $member_id; |
|
25 | + |
|
26 | + /** @var boolean $is_deleted |
|
27 | + * True, if the vehicle was deleted. |
|
28 | + */ |
|
29 | + public $is_deleted; |
|
30 | + |
|
31 | + /** @var string $vehicle_alias |
|
32 | + * Vehicle alias |
|
33 | + */ |
|
34 | + public $vehicle_alias; |
|
35 | + |
|
36 | + /** @var string $vehicle_vin |
|
37 | + * Vehicle VIN (vehicle identification number) |
|
38 | + */ |
|
39 | + public $vehicle_vin; |
|
40 | + |
|
41 | + /** @var int $vehicle_reg_state_id |
|
42 | + * The ID of a state the vehicle was registered. |
|
43 | + */ |
|
44 | + public $vehicle_reg_state_id; |
|
45 | + |
|
46 | + /** @var int $vehicle_reg_country_id |
|
47 | + * The ID of a country the vehicle was registered. |
|
48 | + */ |
|
49 | + public $vehicle_reg_country_id; |
|
50 | + |
|
51 | + /** @var string $vehicle_license_plate |
|
52 | + * A license plate of the vehicle. |
|
53 | + */ |
|
54 | + public $vehicle_license_plate; |
|
55 | + |
|
56 | + /** @var string $vehicle_type_id |
|
57 | + * Vehicle type ID. |
|
58 | + * Available values: |
|
59 | + * 'sedan', 'suv', 'pickup_truck', 'van', '18wheeler', 'cabin', 'hatchback', |
|
60 | + * 'motorcyle', 'waste_disposal', 'tree_cutting', 'bigrig', 'cement_mixer', |
|
61 | + * 'livestock_carrier', 'dairy','tractor_trailer' |
|
62 | + */ |
|
63 | + public $vehicle_type_id; |
|
64 | + |
|
65 | + /** @var string $timestamp_added |
|
66 | + * When the vehicle was added. |
|
67 | + */ |
|
68 | + public $timestamp_added; |
|
69 | + |
|
70 | + /** @var string $vehicle_make |
|
71 | + * Vehicle maker brend. |
|
72 | + * Available values: |
|
73 | + * 'american coleman', 'bmw', 'chevrolet', 'ford', 'freightliner', 'gmc', |
|
74 | + * 'hino', 'honda', 'isuzu', 'kenworth', 'mack', 'mercedes-benz', 'mitsubishi', |
|
75 | + * 'navistar', 'nissan', 'peterbilt', 'renault', 'scania', 'sterling', 'toyota', |
|
76 | + * 'volvo', 'western star' |
|
77 | + */ |
|
78 | + public $vehicle_make; |
|
79 | + |
|
80 | + /** @var int $vehicle_model_year |
|
81 | + * A year of the vehicle model. |
|
82 | + */ |
|
83 | + public $vehicle_model_year; |
|
84 | + |
|
85 | + /** @var string $vehicle_model |
|
86 | + * A model of the vehicle. |
|
87 | + */ |
|
88 | + public $vehicle_model; |
|
89 | + |
|
90 | + /** @var int $vehicle_year_acquired |
|
91 | + * A year, the vehicle was acquired. |
|
92 | + */ |
|
93 | + public $vehicle_year_acquired; |
|
94 | + |
|
95 | + /** @var string $vehicle_cost_new |
|
96 | + * A cost of the new vehicle. |
|
97 | + */ |
|
98 | + public $vehicle_cost_new; |
|
99 | + |
|
100 | + /** @var string $purchased_new |
|
101 | + * If true, the vehicle was purchased new. |
|
102 | + */ |
|
103 | + public $purchased_new; |
|
104 | + |
|
105 | + /** @var string $license_start_date |
|
106 | + * Start date of the license (e.g. '2020-12-20'). |
|
107 | + */ |
|
108 | + public $license_start_date; |
|
109 | + |
|
110 | + /** @var string $license_end_date |
|
111 | + * End date of the license (e.g. '2020-12-20'). |
|
112 | + */ |
|
113 | + public $license_end_date; |
|
114 | + |
|
115 | + /** @var boolean $is_operational |
|
116 | + * If true, the vehicle is operational. |
|
117 | + */ |
|
118 | + public $is_operational; |
|
119 | + |
|
120 | + /** @var string $fuel_type |
|
121 | + * A type of the fuel. |
|
122 | + * Available values: |
|
123 | + * 'unleaded 87', 'unleaded 89', 'unleaded 91', 'unleaded 93', 'diesel', 'electric', 'hybrid' |
|
124 | + */ |
|
125 | + public $fuel_type; |
|
126 | + |
|
127 | + /** @var string $external_telematics_vehicle_id |
|
128 | + * External telematics vehicle ID. |
|
129 | + */ |
|
130 | + public $external_telematics_vehicle_id; |
|
131 | + |
|
132 | + /** @var string $timestamp_removed |
|
133 | + * When the vehicle was removed. |
|
134 | + */ |
|
135 | + public $timestamp_removed; |
|
136 | + |
|
137 | + /** @var string $vehicle_profile_id |
|
138 | + * Vehicle profile ID |
|
139 | + */ |
|
140 | + public $vehicle_profile_id; |
|
141 | + |
|
142 | + /** @var double $fuel_consumption_city |
|
143 | + * Fuel consumption in the city area. |
|
144 | + */ |
|
145 | + public $fuel_consumption_city; |
|
146 | + |
|
147 | + /** @var double $fuel_consumption_highway |
|
148 | + * Fuel consumption in the highway area. |
|
149 | + */ |
|
150 | + public $fuel_consumption_highway; |
|
151 | + |
|
152 | + /** @var string $fuel_consumption_city_unit |
|
153 | + * Fuel consumption unit in the city area (e.g. 'mi/l'). |
|
154 | + */ |
|
155 | + public $fuel_consumption_city_unit; |
|
156 | + |
|
157 | + /** @var string $fuel_consumption_highway_unit |
|
158 | + * Fuel consumption unit in the highway area (e.g. 'mi/l'). |
|
159 | + */ |
|
160 | + public $fuel_consumption_highway_unit; |
|
161 | + |
|
162 | + /** @var double $mpg_city |
|
163 | + * Miles per gallon in the city area. |
|
164 | + */ |
|
165 | + public $mpg_city; |
|
166 | + |
|
167 | + /** @var double $mpg_highway |
|
168 | + * Miles per gallon in the highway area. |
|
169 | + */ |
|
170 | + public $mpg_highway; |
|
171 | + |
|
172 | + /** @var string $fuel_consumption_city_uf_value |
|
173 | + * Fuel consumption UF (utility factor) value in the city area. |
|
174 | + */ |
|
175 | + public $fuel_consumption_city_uf_value; |
|
176 | + |
|
177 | + /** @var string $fuel_consumption_highway_uf_value |
|
178 | + * Fuel consumption UF (utility factor) value in the highway area. |
|
179 | + */ |
|
180 | + public $fuel_consumption_highway_uf_value; |
|
181 | + |
|
182 | + public function __construct() |
|
183 | + { |
|
184 | + Route4Me::setBaseUrl(Endpoint::WH_BASE_URL); |
|
185 | + } |
|
186 | + |
|
187 | + public static function fromArray(array $params) |
|
188 | + { |
|
189 | + $vehicle = new self(); |
|
190 | + |
|
191 | + foreach ($params as $key => $value) { |
|
192 | + if (is_null(Common::getValue($params, $key))) continue; |
|
193 | + if (property_exists($vehicle, $key)) { |
|
194 | + $vehicle->$key = $value; |
|
195 | + } |
|
196 | + } |
|
197 | + |
|
198 | + return $vehicle; |
|
199 | + } |
|
200 | + |
|
201 | + public static function getVehicles($params) |
|
202 | + { |
|
203 | + $allQueryFields = ['with_pagination', 'page', 'perPage']; |
|
204 | + |
|
205 | + $response = Route4Me::makeRequst([ |
|
206 | + 'url' => Endpoint::VEHICLE_V4, |
|
207 | + 'method' => 'GET', |
|
208 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
209 | + ]); |
|
210 | + |
|
211 | + return $response; |
|
212 | + } |
|
213 | + |
|
214 | + public function getVehicleByID($vehicleID) |
|
215 | + { |
|
216 | + $response = Route4Me::makeRequst([ |
|
217 | + 'url' => Endpoint::VEHICLE_V4.'/'.$vehicleID, |
|
218 | + 'method' => 'GET', |
|
219 | + ]); |
|
220 | + |
|
221 | + return $response; |
|
222 | + } |
|
223 | + |
|
224 | + public function updateVehicle($params) |
|
225 | + { |
|
226 | + $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null; |
|
227 | + |
|
228 | + $allBodyFields = Route4Me::getObjectProperties(new self(), ['vehicle_id']); |
|
229 | + |
|
230 | + $response = Route4Me::makeRequst([ |
|
231 | + 'url' => Endpoint::VEHICLE_V4.'/'.$vehicleID, |
|
232 | + 'method' => 'PUT', |
|
233 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
234 | + 'HTTPHEADER' => 'Content-Type: application/json', |
|
235 | + ]); |
|
236 | + |
|
237 | + return $response; |
|
238 | + } |
|
239 | + |
|
240 | + public function createVehicle($params) |
|
241 | + { |
|
242 | + $excludeFields = ['vehicle_id','is_deleted','created_time','timestamp_added','timestamp_removed']; |
|
243 | + $allBodyFields = Route4Me::getObjectProperties(new self(), $excludeFields); |
|
244 | + |
|
245 | + //Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
246 | + |
|
247 | + $response = Route4Me::makeRequst([ |
|
248 | + 'url' => Endpoint::VEHICLE_V4, |
|
249 | + 'method' => 'POST', |
|
250 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
251 | + 'HTTPHEADER' => 'Content-Type: application/json', |
|
252 | + ]); |
|
253 | + |
|
254 | + return $response; |
|
255 | + } |
|
256 | + |
|
257 | + public function removeVehicle($params) |
|
258 | + { |
|
259 | + $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null; |
|
260 | + |
|
261 | + $response = Route4Me::makeRequst([ |
|
262 | + 'url' => Endpoint::VEHICLE_V4.'/'.$vehicleID, |
|
263 | + 'method' => 'DELETE', |
|
264 | + 'HTTPHEADER' => 'Content-Type: application/json', |
|
265 | + ]); |
|
266 | + |
|
267 | + return $response; |
|
268 | + } |
|
269 | 269 | |
270 | 270 | } |
271 | 271 | \ No newline at end of file |
@@ -8,170 +8,170 @@ |
||
8 | 8 | |
9 | 9 | class Vehicle extends \Route4Me\Common |
10 | 10 | { |
11 | - public $vehicle_id; |
|
12 | - public $member_id; |
|
13 | - public $is_deleted; |
|
14 | - public $vehicle_name; |
|
15 | - public $vehicle_alias; |
|
16 | - public $vehicle_vin; |
|
17 | - //public $created_time; |
|
18 | - public $vehicle_reg_state_id; |
|
19 | - public $vehicle_reg_country_id; |
|
20 | - public $vehicle_license_plate; |
|
21 | - public $vehicle_type_id; |
|
22 | - public $timestamp_added; |
|
23 | - public $vehicle_make; |
|
24 | - public $vehicle_model_year; |
|
25 | - public $vehicle_model; |
|
26 | - public $vehicle_year_acquired; |
|
27 | - public $vehicle_cost_new; |
|
28 | - public $purchased_new; |
|
29 | - public $license_start_date; |
|
30 | - public $license_end_date; |
|
31 | - public $vehicle_axle_count; |
|
32 | - public $mpg_city; |
|
33 | - public $mpg_highway; |
|
34 | - public $fuel_type; |
|
35 | - public $height_inches; |
|
36 | - public $weight_lb; |
|
37 | - public $route4me_telematics_internal_api_key; |
|
38 | - public $is_operational; |
|
39 | - public $external_telematics_vehicle_id; |
|
40 | - public $r4m_telematics_gateway_connection_id; |
|
41 | - public $r4m_telematics_gateway_vehicle_id; |
|
42 | - public $has_trailer; |
|
43 | - public $heightInInches; |
|
44 | - public $lengthInInches; |
|
45 | - public $widthInInches; |
|
46 | - public $maxWeightPerAxleGroupInPounds; |
|
47 | - public $numAxles; |
|
48 | - public $weightInPounds; |
|
49 | - public $HazmatType; |
|
50 | - public $LowEmissionZonePref; |
|
51 | - public $Use53FootTrailerRouting; |
|
52 | - public $UseNationalNetwork; |
|
53 | - public $UseTruckRestrictions; |
|
54 | - public $AvoidFerries; |
|
55 | - public $DividedHighwayAvoidPreference; |
|
56 | - public $FreewayAvoidPreference; |
|
57 | - public $InternationalBordersOpen; |
|
58 | - public $TollRoadUsage; |
|
59 | - public $hwy_only; |
|
60 | - public $long_combination_vehicle; |
|
61 | - public $avoid_highways; |
|
62 | - public $side_street_adherence; |
|
63 | - public $truck_config; |
|
64 | - public $height_metric; |
|
65 | - public $length_metric; |
|
66 | - public $width_metric; |
|
67 | - public $weight_metric; |
|
68 | - public $max_weight_per_axle_group_metric; |
|
69 | - public $timestamp_removed; |
|
70 | - |
|
71 | - public function __construct() |
|
72 | - { |
|
73 | - Route4Me::setBaseUrl(Endpoint::WH_BASE_URL); |
|
74 | - } |
|
75 | - |
|
76 | - public static function fromArray(array $params) |
|
77 | - { |
|
78 | - $vehicle = new self(); |
|
79 | - |
|
80 | - foreach ($params as $key => $value) { |
|
81 | - if (is_null(Common::getValue($params, $key))) continue; |
|
82 | - if (property_exists($vehicle, $key)) { |
|
83 | - $vehicle->$key = $value; |
|
84 | - } |
|
85 | - } |
|
86 | - |
|
87 | - return $vehicle; |
|
88 | - } |
|
89 | - |
|
90 | - public static function getVehicles($params) |
|
91 | - { |
|
92 | - $allQueryFields = ['with_pagination', 'page', 'perPage']; |
|
93 | - |
|
94 | - $response = Route4Me::makeRequst([ |
|
95 | - 'url' => Endpoint::VEHICLE_V4, |
|
96 | - 'method' => 'GET', |
|
97 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
98 | - ]); |
|
99 | - |
|
100 | - return $response; |
|
101 | - } |
|
102 | - |
|
103 | - public function getRandomVehicleId($page, $perPage) |
|
104 | - { |
|
105 | - $params = [ |
|
106 | - 'page' => isset($page) ? $page : 1, |
|
107 | - 'perPage' => isset($perPage) ? $perPage : 10, |
|
108 | - 'with_pagination' => true, |
|
109 | - ]; |
|
110 | - |
|
111 | - $vehicles = $this->getVehicles($params); |
|
112 | - |
|
113 | - if (is_null($vehicles) || !isset($vehicles['data']) || sizeof($vehicles['data']) < 1) { |
|
114 | - return null; |
|
115 | - } |
|
116 | - |
|
117 | - $randomIndex = rand(0, sizeof($vehicles['data']) - 1); |
|
118 | - |
|
119 | - return $vehicles['data'][$randomIndex]['vehicle_id']; |
|
120 | - } |
|
121 | - |
|
122 | - public function getVehicleByID($vehicleID) |
|
123 | - { |
|
124 | - $response = Route4Me::makeRequst([ |
|
125 | - 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
126 | - 'method' => 'GET', |
|
127 | - ]); |
|
128 | - |
|
129 | - return $response; |
|
130 | - } |
|
131 | - |
|
132 | - public function updateVehicle($params) |
|
133 | - { |
|
134 | - $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null; |
|
135 | - |
|
136 | - $allBodyFields = Route4Me::getObjectProperties(new self(), ['vehicle_id']); |
|
137 | - |
|
138 | - $response = Route4Me::makeRequst([ |
|
139 | - 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
140 | - 'method' => 'PUT', |
|
141 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
142 | - 'HTTPHEADER' => 'Content-Type: application/json', |
|
143 | - ]); |
|
144 | - |
|
145 | - return $response; |
|
146 | - } |
|
147 | - |
|
148 | - public function createVehicle($params) |
|
149 | - { |
|
150 | - $excludeFields = ['vehicle_id', 'is_deleted', 'created_time', 'timestamp_added', 'timestamp_removed']; |
|
151 | - $allBodyFields = Route4Me::getObjectProperties(new self(), $excludeFields); |
|
152 | - |
|
153 | - Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
154 | - |
|
155 | - $response = Route4Me::makeRequst([ |
|
156 | - 'url' => Endpoint::VEHICLE_V4_API, |
|
157 | - 'method' => 'POST', |
|
158 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
159 | - 'HTTPHEADER' => 'Content-Type: application/json', |
|
160 | - ]); |
|
161 | - |
|
162 | - return $response; |
|
163 | - } |
|
164 | - |
|
165 | - public function removeVehicle($params) |
|
166 | - { |
|
167 | - $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null; |
|
168 | - |
|
169 | - $response = Route4Me::makeRequst([ |
|
170 | - 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
171 | - 'method' => 'DELETE', |
|
172 | - 'HTTPHEADER' => 'Content-Type: application/json', |
|
173 | - ]); |
|
174 | - |
|
175 | - return $response; |
|
176 | - } |
|
11 | + public $vehicle_id; |
|
12 | + public $member_id; |
|
13 | + public $is_deleted; |
|
14 | + public $vehicle_name; |
|
15 | + public $vehicle_alias; |
|
16 | + public $vehicle_vin; |
|
17 | + //public $created_time; |
|
18 | + public $vehicle_reg_state_id; |
|
19 | + public $vehicle_reg_country_id; |
|
20 | + public $vehicle_license_plate; |
|
21 | + public $vehicle_type_id; |
|
22 | + public $timestamp_added; |
|
23 | + public $vehicle_make; |
|
24 | + public $vehicle_model_year; |
|
25 | + public $vehicle_model; |
|
26 | + public $vehicle_year_acquired; |
|
27 | + public $vehicle_cost_new; |
|
28 | + public $purchased_new; |
|
29 | + public $license_start_date; |
|
30 | + public $license_end_date; |
|
31 | + public $vehicle_axle_count; |
|
32 | + public $mpg_city; |
|
33 | + public $mpg_highway; |
|
34 | + public $fuel_type; |
|
35 | + public $height_inches; |
|
36 | + public $weight_lb; |
|
37 | + public $route4me_telematics_internal_api_key; |
|
38 | + public $is_operational; |
|
39 | + public $external_telematics_vehicle_id; |
|
40 | + public $r4m_telematics_gateway_connection_id; |
|
41 | + public $r4m_telematics_gateway_vehicle_id; |
|
42 | + public $has_trailer; |
|
43 | + public $heightInInches; |
|
44 | + public $lengthInInches; |
|
45 | + public $widthInInches; |
|
46 | + public $maxWeightPerAxleGroupInPounds; |
|
47 | + public $numAxles; |
|
48 | + public $weightInPounds; |
|
49 | + public $HazmatType; |
|
50 | + public $LowEmissionZonePref; |
|
51 | + public $Use53FootTrailerRouting; |
|
52 | + public $UseNationalNetwork; |
|
53 | + public $UseTruckRestrictions; |
|
54 | + public $AvoidFerries; |
|
55 | + public $DividedHighwayAvoidPreference; |
|
56 | + public $FreewayAvoidPreference; |
|
57 | + public $InternationalBordersOpen; |
|
58 | + public $TollRoadUsage; |
|
59 | + public $hwy_only; |
|
60 | + public $long_combination_vehicle; |
|
61 | + public $avoid_highways; |
|
62 | + public $side_street_adherence; |
|
63 | + public $truck_config; |
|
64 | + public $height_metric; |
|
65 | + public $length_metric; |
|
66 | + public $width_metric; |
|
67 | + public $weight_metric; |
|
68 | + public $max_weight_per_axle_group_metric; |
|
69 | + public $timestamp_removed; |
|
70 | + |
|
71 | + public function __construct() |
|
72 | + { |
|
73 | + Route4Me::setBaseUrl(Endpoint::WH_BASE_URL); |
|
74 | + } |
|
75 | + |
|
76 | + public static function fromArray(array $params) |
|
77 | + { |
|
78 | + $vehicle = new self(); |
|
79 | + |
|
80 | + foreach ($params as $key => $value) { |
|
81 | + if (is_null(Common::getValue($params, $key))) continue; |
|
82 | + if (property_exists($vehicle, $key)) { |
|
83 | + $vehicle->$key = $value; |
|
84 | + } |
|
85 | + } |
|
86 | + |
|
87 | + return $vehicle; |
|
88 | + } |
|
89 | + |
|
90 | + public static function getVehicles($params) |
|
91 | + { |
|
92 | + $allQueryFields = ['with_pagination', 'page', 'perPage']; |
|
93 | + |
|
94 | + $response = Route4Me::makeRequst([ |
|
95 | + 'url' => Endpoint::VEHICLE_V4, |
|
96 | + 'method' => 'GET', |
|
97 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
98 | + ]); |
|
99 | + |
|
100 | + return $response; |
|
101 | + } |
|
102 | + |
|
103 | + public function getRandomVehicleId($page, $perPage) |
|
104 | + { |
|
105 | + $params = [ |
|
106 | + 'page' => isset($page) ? $page : 1, |
|
107 | + 'perPage' => isset($perPage) ? $perPage : 10, |
|
108 | + 'with_pagination' => true, |
|
109 | + ]; |
|
110 | + |
|
111 | + $vehicles = $this->getVehicles($params); |
|
112 | + |
|
113 | + if (is_null($vehicles) || !isset($vehicles['data']) || sizeof($vehicles['data']) < 1) { |
|
114 | + return null; |
|
115 | + } |
|
116 | + |
|
117 | + $randomIndex = rand(0, sizeof($vehicles['data']) - 1); |
|
118 | + |
|
119 | + return $vehicles['data'][$randomIndex]['vehicle_id']; |
|
120 | + } |
|
121 | + |
|
122 | + public function getVehicleByID($vehicleID) |
|
123 | + { |
|
124 | + $response = Route4Me::makeRequst([ |
|
125 | + 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
126 | + 'method' => 'GET', |
|
127 | + ]); |
|
128 | + |
|
129 | + return $response; |
|
130 | + } |
|
131 | + |
|
132 | + public function updateVehicle($params) |
|
133 | + { |
|
134 | + $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null; |
|
135 | + |
|
136 | + $allBodyFields = Route4Me::getObjectProperties(new self(), ['vehicle_id']); |
|
137 | + |
|
138 | + $response = Route4Me::makeRequst([ |
|
139 | + 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
140 | + 'method' => 'PUT', |
|
141 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
142 | + 'HTTPHEADER' => 'Content-Type: application/json', |
|
143 | + ]); |
|
144 | + |
|
145 | + return $response; |
|
146 | + } |
|
147 | + |
|
148 | + public function createVehicle($params) |
|
149 | + { |
|
150 | + $excludeFields = ['vehicle_id', 'is_deleted', 'created_time', 'timestamp_added', 'timestamp_removed']; |
|
151 | + $allBodyFields = Route4Me::getObjectProperties(new self(), $excludeFields); |
|
152 | + |
|
153 | + Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
154 | + |
|
155 | + $response = Route4Me::makeRequst([ |
|
156 | + 'url' => Endpoint::VEHICLE_V4_API, |
|
157 | + 'method' => 'POST', |
|
158 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
159 | + 'HTTPHEADER' => 'Content-Type: application/json', |
|
160 | + ]); |
|
161 | + |
|
162 | + return $response; |
|
163 | + } |
|
164 | + |
|
165 | + public function removeVehicle($params) |
|
166 | + { |
|
167 | + $vehicleID = isset($params->vehicle_id) ? $params->vehicle_id : null; |
|
168 | + |
|
169 | + $response = Route4Me::makeRequst([ |
|
170 | + 'url' => Endpoint::VEHICLE_V4 . '/' . $vehicleID, |
|
171 | + 'method' => 'DELETE', |
|
172 | + 'HTTPHEADER' => 'Content-Type: application/json', |
|
173 | + ]); |
|
174 | + |
|
175 | + return $response; |
|
176 | + } |
|
177 | 177 | } |
@@ -12,58 +12,58 @@ |
||
12 | 12 | */ |
13 | 13 | class TrackingHistory extends Common |
14 | 14 | { |
15 | - /** |
|
16 | - * Speed at the time of the location transaction event. |
|
17 | - * @var type string |
|
18 | - */ |
|
19 | - public $s; |
|
15 | + /** |
|
16 | + * Speed at the time of the location transaction event. |
|
17 | + * @var type string |
|
18 | + */ |
|
19 | + public $s; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Speed unit ('mph', 'kph') |
|
23 | - * @var type string |
|
24 | - */ |
|
25 | - public $su; |
|
21 | + /** |
|
22 | + * Speed unit ('mph', 'kph') |
|
23 | + * @var type string |
|
24 | + */ |
|
25 | + public $su; |
|
26 | 26 | |
27 | - /** |
|
28 | - * Latitude at the time of the location transaction event. |
|
29 | - * @var type string |
|
30 | - */ |
|
31 | - public $lt; |
|
27 | + /** |
|
28 | + * Latitude at the time of the location transaction event. |
|
29 | + * @var type string |
|
30 | + */ |
|
31 | + public $lt; |
|
32 | 32 | |
33 | - /** |
|
34 | - * Member ID |
|
35 | - * @var type integer |
|
36 | - */ |
|
37 | - public $m; |
|
33 | + /** |
|
34 | + * Member ID |
|
35 | + * @var type integer |
|
36 | + */ |
|
37 | + public $m; |
|
38 | 38 | |
39 | - /** |
|
40 | - * Longitude at the time of the location transaction event. |
|
41 | - * @var type string |
|
42 | - */ |
|
43 | - public $lg; |
|
39 | + /** |
|
40 | + * Longitude at the time of the location transaction event. |
|
41 | + * @var type string |
|
42 | + */ |
|
43 | + public $lg; |
|
44 | 44 | |
45 | - /** |
|
46 | - * Direction/heading at the time of the location transaction event. |
|
47 | - * @var type integer |
|
48 | - */ |
|
49 | - public $d; |
|
45 | + /** |
|
46 | + * Direction/heading at the time of the location transaction event. |
|
47 | + * @var type integer |
|
48 | + */ |
|
49 | + public $d; |
|
50 | 50 | |
51 | - /** |
|
52 | - * The original timestamp in unix timestamp format at the moment location transaction event. |
|
53 | - * @var type string |
|
54 | - */ |
|
55 | - public $ts; |
|
51 | + /** |
|
52 | + * The original timestamp in unix timestamp format at the moment location transaction event. |
|
53 | + * @var type string |
|
54 | + */ |
|
55 | + public $ts; |
|
56 | 56 | |
57 | - /** |
|
58 | - * The original timestamp in a human readable timestamp format at the moment location transaction event. |
|
59 | - * @var type string |
|
60 | - */ |
|
61 | - public $ts_friendly; |
|
57 | + /** |
|
58 | + * The original timestamp in a human readable timestamp format at the moment location transaction event. |
|
59 | + * @var type string |
|
60 | + */ |
|
61 | + public $ts_friendly; |
|
62 | 62 | |
63 | - /** |
|
64 | - * GPS package src (e.g. 'R4M'). |
|
65 | - * @var type string |
|
66 | - */ |
|
67 | - public $src; |
|
63 | + /** |
|
64 | + * GPS package src (e.g. 'R4M'). |
|
65 | + * @var type string |
|
66 | + */ |
|
67 | + public $src; |
|
68 | 68 | |
69 | 69 | } |
70 | 70 | \ No newline at end of file |
@@ -6,43 +6,43 @@ |
||
6 | 6 | |
7 | 7 | class MemberData extends \Route4Me\Common |
8 | 8 | { |
9 | - /** @var int $account_type_id */ |
|
10 | - public $account_type_id; |
|
9 | + /** @var int $account_type_id */ |
|
10 | + public $account_type_id; |
|
11 | 11 | |
12 | - /** @var string $member_email */ |
|
13 | - public $member_email; |
|
12 | + /** @var string $member_email */ |
|
13 | + public $member_email; |
|
14 | 14 | |
15 | - /** @var string $member_first_name */ |
|
16 | - public $member_first_name; |
|
15 | + /** @var string $member_first_name */ |
|
16 | + public $member_first_name; |
|
17 | 17 | |
18 | - /** @var int $member_id */ |
|
19 | - public $member_id; |
|
18 | + /** @var int $member_id */ |
|
19 | + public $member_id; |
|
20 | 20 | |
21 | - /** @var string $member_last_name */ |
|
22 | - public $member_last_name; |
|
21 | + /** @var string $member_last_name */ |
|
22 | + public $member_last_name; |
|
23 | 23 | |
24 | - /** @var string $member_type */ |
|
25 | - public $member_type; |
|
24 | + /** @var string $member_type */ |
|
25 | + public $member_type; |
|
26 | 26 | |
27 | - /** @var string $phone_number */ |
|
28 | - public $phone_number; |
|
27 | + /** @var string $phone_number */ |
|
28 | + public $phone_number; |
|
29 | 29 | |
30 | - /** @var boolean $readonly_user */ |
|
31 | - public $readonly_user; |
|
30 | + /** @var boolean $readonly_user */ |
|
31 | + public $readonly_user; |
|
32 | 32 | |
33 | - /** @var boolean $show_superuser_addresses */ |
|
34 | - public $show_superuser_addresses; |
|
33 | + /** @var boolean $show_superuser_addresses */ |
|
34 | + public $show_superuser_addresses; |
|
35 | 35 | |
36 | - public static function fromArray(array $params) |
|
37 | - { |
|
38 | - $memberData = new self(); |
|
36 | + public static function fromArray(array $params) |
|
37 | + { |
|
38 | + $memberData = new self(); |
|
39 | 39 | |
40 | - foreach ($params as $key => $value) { |
|
41 | - if (property_exists($memberData, $key)) { |
|
42 | - $memberData->{$key} = $value; |
|
43 | - } |
|
44 | - } |
|
40 | + foreach ($params as $key => $value) { |
|
41 | + if (property_exists($memberData, $key)) { |
|
42 | + $memberData->{$key} = $value; |
|
43 | + } |
|
44 | + } |
|
45 | 45 | |
46 | - return $memberData; |
|
47 | - } |
|
46 | + return $memberData; |
|
47 | + } |
|
48 | 48 | } |
49 | 49 | \ No newline at end of file |
@@ -4,26 +4,26 @@ |
||
4 | 4 | |
5 | 5 | class SetGpsResponse extends \Route4Me\Common |
6 | 6 | { |
7 | - /** @var boolean $status |
|
8 | - * Status of the GPS setting request process. |
|
9 | - */ |
|
10 | - public $status; |
|
7 | + /** @var boolean $status |
|
8 | + * Status of the GPS setting request process. |
|
9 | + */ |
|
10 | + public $status; |
|
11 | 11 | |
12 | - /** @var string $tx_id |
|
13 | - * Unique ID of the GPS points group. |
|
14 | - */ |
|
15 | - public $tx_id; |
|
12 | + /** @var string $tx_id |
|
13 | + * Unique ID of the GPS points group. |
|
14 | + */ |
|
15 | + public $tx_id; |
|
16 | 16 | |
17 | - public static function fromArray(array $params) |
|
18 | - { |
|
19 | - $gpsPosition = new self(); |
|
17 | + public static function fromArray(array $params) |
|
18 | + { |
|
19 | + $gpsPosition = new self(); |
|
20 | 20 | |
21 | - foreach ($params as $key => $value) { |
|
22 | - if (property_exists($gpsPosition, $key)) { |
|
23 | - $gpsPosition->{$key} = $value; |
|
24 | - } |
|
25 | - } |
|
21 | + foreach ($params as $key => $value) { |
|
22 | + if (property_exists($gpsPosition, $key)) { |
|
23 | + $gpsPosition->{$key} = $value; |
|
24 | + } |
|
25 | + } |
|
26 | 26 | |
27 | - return $gpsPosition; |
|
28 | - } |
|
27 | + return $gpsPosition; |
|
28 | + } |
|
29 | 29 | } |
30 | 30 | \ No newline at end of file |
@@ -10,108 +10,108 @@ |
||
10 | 10 | |
11 | 11 | class TrackSetParams extends \Route4Me\Common |
12 | 12 | { |
13 | - public $format; |
|
14 | - public $member_id; |
|
15 | - public $route_id; |
|
16 | - public $tx_id; |
|
17 | - public $vehicle_id; |
|
18 | - public $course; |
|
19 | - public $speed; |
|
20 | - public $lat; |
|
21 | - public $lng; |
|
22 | - public $altitude; |
|
23 | - public $device_type; |
|
24 | - public $device_guid; |
|
25 | - public $device_timestamp; |
|
26 | - public $app_version; |
|
27 | - |
|
28 | - public function __construct() |
|
29 | - { |
|
30 | - Route4Me\Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
31 | - } |
|
32 | - |
|
33 | - public static function fromArray(array $params) |
|
34 | - { |
|
35 | - $param = new self(); |
|
36 | - |
|
37 | - if (!isset($params['format'])) { |
|
38 | - throw new BadParam('format must be provided.'); |
|
39 | - } |
|
40 | - |
|
41 | - $types = [ |
|
42 | - Format::JSON, |
|
43 | - Format::SERIALIZED, |
|
44 | - Format::CSV, |
|
45 | - Format::XML, |
|
46 | - ]; |
|
47 | - if (!in_array($params['format'], $types)) { |
|
48 | - throw new BadParam('format is invalid.'); |
|
49 | - } |
|
50 | - |
|
51 | - if (!isset($params['route_id'])) { |
|
52 | - throw new BadParam('route_id must be provided.'); |
|
53 | - } |
|
54 | - |
|
55 | - if (!isset($params['member_id'])) { |
|
56 | - throw new BadParam('member_id must be provided.'); |
|
57 | - } |
|
58 | - |
|
59 | - if (!isset($params['course'])) { |
|
60 | - throw new BadParam('course must be provided.'); |
|
61 | - } |
|
62 | - |
|
63 | - if (!isset($params['speed'])) { |
|
64 | - throw new BadParam('speed must be provided.'); |
|
65 | - } |
|
66 | - |
|
67 | - if (!isset($params['lat'])) { |
|
68 | - throw new BadParam('lat must be provided.'); |
|
69 | - } |
|
70 | - |
|
71 | - if (!isset($params['lng'])) { |
|
72 | - throw new BadParam('lng must be provided.'); |
|
73 | - } |
|
74 | - |
|
75 | - if (!isset($params['device_type'])) { |
|
76 | - throw new BadParam('device_type must be provided.'); |
|
77 | - } |
|
78 | - |
|
79 | - $deviceTypes = [ |
|
80 | - DeviceType::IPHONE, |
|
81 | - DeviceType::IPAD, |
|
82 | - DeviceType::ANDROID_PHONE, |
|
83 | - DeviceType::ANDROID_TABLET, |
|
84 | - ]; |
|
85 | - if (!in_array($params['device_type'], $deviceTypes)) { |
|
86 | - throw new BadParam('device_type is invalid.'); |
|
87 | - } |
|
88 | - |
|
89 | - if (!isset($params['device_guid'])) { |
|
90 | - throw new BadParam('device_guid must be provided.'); |
|
91 | - } |
|
92 | - |
|
93 | - if (isset($params['device_timestamp'])) { |
|
94 | - $template = '/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/i'; |
|
95 | - if (!preg_match($template, $params['device_timestamp'])) { |
|
96 | - throw new BadParam('device_timestamp is invalid.'); |
|
97 | - } |
|
98 | - } |
|
99 | - |
|
100 | - $param->format = self::getValue($params, 'format'); |
|
101 | - $param->route_id = self::getValue($params, 'route_id'); |
|
102 | - $param->member_id = self::getValue($params, 'member_id'); |
|
103 | - $param->course = self::getValue($params, 'course'); |
|
104 | - $param->speed = self::getValue($params, 'speed'); |
|
105 | - $param->lat = self::getValue($params, 'lat'); |
|
106 | - $param->lng = self::getValue($params, 'lng'); |
|
107 | - $param->device_type = self::getValue($params, 'device_type'); |
|
108 | - $param->device_guid = self::getValue($params, 'device_guid'); |
|
109 | - $param->device_timestamp = self::getValue($params, 'device_timestamp'); |
|
110 | - $param->vehicle_id = self::getValue($params, 'vehicle_id'); |
|
111 | - $param->altitude = self::getValue($params, 'altitude'); |
|
112 | - $param->app_version = self::getValue($params, 'app_version'); |
|
113 | - $param->tx_id = self::getValue($params, 'tx_id'); |
|
114 | - |
|
115 | - return $param; |
|
116 | - } |
|
13 | + public $format; |
|
14 | + public $member_id; |
|
15 | + public $route_id; |
|
16 | + public $tx_id; |
|
17 | + public $vehicle_id; |
|
18 | + public $course; |
|
19 | + public $speed; |
|
20 | + public $lat; |
|
21 | + public $lng; |
|
22 | + public $altitude; |
|
23 | + public $device_type; |
|
24 | + public $device_guid; |
|
25 | + public $device_timestamp; |
|
26 | + public $app_version; |
|
27 | + |
|
28 | + public function __construct() |
|
29 | + { |
|
30 | + Route4Me\Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
31 | + } |
|
32 | + |
|
33 | + public static function fromArray(array $params) |
|
34 | + { |
|
35 | + $param = new self(); |
|
36 | + |
|
37 | + if (!isset($params['format'])) { |
|
38 | + throw new BadParam('format must be provided.'); |
|
39 | + } |
|
40 | + |
|
41 | + $types = [ |
|
42 | + Format::JSON, |
|
43 | + Format::SERIALIZED, |
|
44 | + Format::CSV, |
|
45 | + Format::XML, |
|
46 | + ]; |
|
47 | + if (!in_array($params['format'], $types)) { |
|
48 | + throw new BadParam('format is invalid.'); |
|
49 | + } |
|
50 | + |
|
51 | + if (!isset($params['route_id'])) { |
|
52 | + throw new BadParam('route_id must be provided.'); |
|
53 | + } |
|
54 | + |
|
55 | + if (!isset($params['member_id'])) { |
|
56 | + throw new BadParam('member_id must be provided.'); |
|
57 | + } |
|
58 | + |
|
59 | + if (!isset($params['course'])) { |
|
60 | + throw new BadParam('course must be provided.'); |
|
61 | + } |
|
62 | + |
|
63 | + if (!isset($params['speed'])) { |
|
64 | + throw new BadParam('speed must be provided.'); |
|
65 | + } |
|
66 | + |
|
67 | + if (!isset($params['lat'])) { |
|
68 | + throw new BadParam('lat must be provided.'); |
|
69 | + } |
|
70 | + |
|
71 | + if (!isset($params['lng'])) { |
|
72 | + throw new BadParam('lng must be provided.'); |
|
73 | + } |
|
74 | + |
|
75 | + if (!isset($params['device_type'])) { |
|
76 | + throw new BadParam('device_type must be provided.'); |
|
77 | + } |
|
78 | + |
|
79 | + $deviceTypes = [ |
|
80 | + DeviceType::IPHONE, |
|
81 | + DeviceType::IPAD, |
|
82 | + DeviceType::ANDROID_PHONE, |
|
83 | + DeviceType::ANDROID_TABLET, |
|
84 | + ]; |
|
85 | + if (!in_array($params['device_type'], $deviceTypes)) { |
|
86 | + throw new BadParam('device_type is invalid.'); |
|
87 | + } |
|
88 | + |
|
89 | + if (!isset($params['device_guid'])) { |
|
90 | + throw new BadParam('device_guid must be provided.'); |
|
91 | + } |
|
92 | + |
|
93 | + if (isset($params['device_timestamp'])) { |
|
94 | + $template = '/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/i'; |
|
95 | + if (!preg_match($template, $params['device_timestamp'])) { |
|
96 | + throw new BadParam('device_timestamp is invalid.'); |
|
97 | + } |
|
98 | + } |
|
99 | + |
|
100 | + $param->format = self::getValue($params, 'format'); |
|
101 | + $param->route_id = self::getValue($params, 'route_id'); |
|
102 | + $param->member_id = self::getValue($params, 'member_id'); |
|
103 | + $param->course = self::getValue($params, 'course'); |
|
104 | + $param->speed = self::getValue($params, 'speed'); |
|
105 | + $param->lat = self::getValue($params, 'lat'); |
|
106 | + $param->lng = self::getValue($params, 'lng'); |
|
107 | + $param->device_type = self::getValue($params, 'device_type'); |
|
108 | + $param->device_guid = self::getValue($params, 'device_guid'); |
|
109 | + $param->device_timestamp = self::getValue($params, 'device_timestamp'); |
|
110 | + $param->vehicle_id = self::getValue($params, 'vehicle_id'); |
|
111 | + $param->altitude = self::getValue($params, 'altitude'); |
|
112 | + $param->app_version = self::getValue($params, 'app_version'); |
|
113 | + $param->tx_id = self::getValue($params, 'tx_id'); |
|
114 | + |
|
115 | + return $param; |
|
116 | + } |
|
117 | 117 | } |