@@ -6,92 +6,92 @@ |
||
6 | 6 | |
7 | 7 | class ActivityParameters extends Common |
8 | 8 | { |
9 | - public $route_id; |
|
10 | - public $device_id; |
|
11 | - public $member_id; |
|
12 | - public $team; |
|
13 | - public $limit; |
|
14 | - public $offset; |
|
15 | - public $start; |
|
16 | - public $end; |
|
17 | - public $activity_type; |
|
18 | - public $activity_message; |
|
19 | - |
|
20 | - public $activity_id; |
|
21 | - public $activity_timestamp; |
|
22 | - public $route_destination_id; |
|
23 | - public $note_id; |
|
24 | - public $member; |
|
25 | - public $note_type; |
|
26 | - public $note_contents; |
|
27 | - public $route_name; |
|
28 | - public $note_file; |
|
29 | - public $destination_name; |
|
30 | - public $destination_alias; |
|
31 | - |
|
32 | - public function __construct() |
|
33 | - { |
|
34 | - Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
35 | - } |
|
36 | - |
|
37 | - public static function fromArray(array $params) |
|
38 | - { |
|
39 | - $activityparameters = new self(); |
|
40 | - |
|
41 | - foreach ($params as $key => $value) { |
|
42 | - if (property_exists($activityparameters, $key)) { |
|
43 | - $activityparameters->{$key} = $value; |
|
44 | - } |
|
45 | - } |
|
46 | - |
|
47 | - return $activityparameters; |
|
48 | - } |
|
49 | - |
|
50 | - /* |
|
9 | + public $route_id; |
|
10 | + public $device_id; |
|
11 | + public $member_id; |
|
12 | + public $team; |
|
13 | + public $limit; |
|
14 | + public $offset; |
|
15 | + public $start; |
|
16 | + public $end; |
|
17 | + public $activity_type; |
|
18 | + public $activity_message; |
|
19 | + |
|
20 | + public $activity_id; |
|
21 | + public $activity_timestamp; |
|
22 | + public $route_destination_id; |
|
23 | + public $note_id; |
|
24 | + public $member; |
|
25 | + public $note_type; |
|
26 | + public $note_contents; |
|
27 | + public $route_name; |
|
28 | + public $note_file; |
|
29 | + public $destination_name; |
|
30 | + public $destination_alias; |
|
31 | + |
|
32 | + public function __construct() |
|
33 | + { |
|
34 | + Route4Me::setBaseUrl(Endpoint::BASE_URL); |
|
35 | + } |
|
36 | + |
|
37 | + public static function fromArray(array $params) |
|
38 | + { |
|
39 | + $activityparameters = new self(); |
|
40 | + |
|
41 | + foreach ($params as $key => $value) { |
|
42 | + if (property_exists($activityparameters, $key)) { |
|
43 | + $activityparameters->{$key} = $value; |
|
44 | + } |
|
45 | + } |
|
46 | + |
|
47 | + return $activityparameters; |
|
48 | + } |
|
49 | + |
|
50 | + /* |
|
51 | 51 | * Get all the activities limited by query parameters. |
52 | 52 | */ |
53 | - public static function getActivities($params) |
|
54 | - { |
|
55 | - $allQueryFields = ['route_id', 'team', 'limit', 'offset', 'start', 'member_id']; |
|
53 | + public static function getActivities($params) |
|
54 | + { |
|
55 | + $allQueryFields = ['route_id', 'team', 'limit', 'offset', 'start', 'member_id']; |
|
56 | 56 | |
57 | - $activity = Route4Me::makeRequst([ |
|
58 | - 'url' => Endpoint::GET_ACTIVITIES, |
|
59 | - 'method' => 'GET', |
|
60 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
61 | - ]); |
|
57 | + $activity = Route4Me::makeRequst([ |
|
58 | + 'url' => Endpoint::GET_ACTIVITIES, |
|
59 | + 'method' => 'GET', |
|
60 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
61 | + ]); |
|
62 | 62 | |
63 | - return $activity; |
|
64 | - } |
|
63 | + return $activity; |
|
64 | + } |
|
65 | 65 | |
66 | - /* |
|
66 | + /* |
|
67 | 67 | * Returns the activity feed. |
68 | 68 | */ |
69 | - public static function searchActivities($params) |
|
70 | - { |
|
71 | - $allQueryFields = ['route_id', 'limit', 'offset', 'activity_type']; |
|
69 | + public static function searchActivities($params) |
|
70 | + { |
|
71 | + $allQueryFields = ['route_id', 'limit', 'offset', 'activity_type']; |
|
72 | 72 | |
73 | - $activity = Route4Me::makeRequst([ |
|
74 | - 'url' => Endpoint::GET_ACTIVITIES, |
|
75 | - 'method' => 'GET', |
|
76 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
77 | - ]); |
|
73 | + $activity = Route4Me::makeRequst([ |
|
74 | + 'url' => Endpoint::GET_ACTIVITIES, |
|
75 | + 'method' => 'GET', |
|
76 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
77 | + ]); |
|
78 | 78 | |
79 | - return $activity; |
|
80 | - } |
|
79 | + return $activity; |
|
80 | + } |
|
81 | 81 | |
82 | - /* |
|
82 | + /* |
|
83 | 83 | * Creates a user's activity by sending a custom message to the activity stream. |
84 | 84 | */ |
85 | - public static function sendUserMessage($params) |
|
86 | - { |
|
87 | - $allBodyFields = ['activity_type', 'activity_message', 'route_id']; |
|
88 | - |
|
89 | - $result = Route4Me::makeRequst([ |
|
90 | - 'url' => Endpoint::ACTIVITY_FEED, |
|
91 | - 'method' => 'POST', |
|
92 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
93 | - ]); |
|
94 | - |
|
95 | - return $result; |
|
96 | - } |
|
85 | + public static function sendUserMessage($params) |
|
86 | + { |
|
87 | + $allBodyFields = ['activity_type', 'activity_message', 'route_id']; |
|
88 | + |
|
89 | + $result = Route4Me::makeRequst([ |
|
90 | + 'url' => Endpoint::ACTIVITY_FEED, |
|
91 | + 'method' => 'POST', |
|
92 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
93 | + ]); |
|
94 | + |
|
95 | + return $result; |
|
96 | + } |
|
97 | 97 | } |
@@ -9,9 +9,9 @@ |
||
9 | 9 | */ |
10 | 10 | class TelematicsVendorsResponse |
11 | 11 | { |
12 | - /** |
|
13 | - * An array of the telematics vendors. |
|
14 | - * @var type TelematicsVendors[] |
|
15 | - */ |
|
16 | - public $vendors = []; |
|
12 | + /** |
|
13 | + * An array of the telematics vendors. |
|
14 | + * @var type TelematicsVendors[] |
|
15 | + */ |
|
16 | + public $vendors = []; |
|
17 | 17 | } |
@@ -9,88 +9,88 @@ |
||
9 | 9 | */ |
10 | 10 | class TelematicsConnectionParameters extends Common |
11 | 11 | { |
12 | - /** |
|
13 | - * Account ID |
|
14 | - * @var type string |
|
15 | - */ |
|
16 | - public $account_id; |
|
12 | + /** |
|
13 | + * Account ID |
|
14 | + * @var type string |
|
15 | + */ |
|
16 | + public $account_id; |
|
17 | 17 | |
18 | - /** |
|
19 | - * User name |
|
20 | - * @var type string |
|
21 | - */ |
|
22 | - public $username; |
|
18 | + /** |
|
19 | + * User name |
|
20 | + * @var type string |
|
21 | + */ |
|
22 | + public $username; |
|
23 | 23 | |
24 | - /** |
|
25 | - * Password |
|
26 | - * @var type string |
|
27 | - */ |
|
28 | - public $password; |
|
24 | + /** |
|
25 | + * Password |
|
26 | + * @var type string |
|
27 | + */ |
|
28 | + public $password; |
|
29 | 29 | |
30 | - /** |
|
31 | - * Connection host |
|
32 | - * @var type string |
|
33 | - */ |
|
34 | - public $host; |
|
30 | + /** |
|
31 | + * Connection host |
|
32 | + * @var type string |
|
33 | + */ |
|
34 | + public $host; |
|
35 | 35 | |
36 | - /** |
|
37 | - * An unique ID of a telematics vendor. |
|
38 | - * @var type integer |
|
39 | - */ |
|
40 | - public $vendor_id; |
|
36 | + /** |
|
37 | + * An unique ID of a telematics vendor. |
|
38 | + * @var type integer |
|
39 | + */ |
|
40 | + public $vendor_id; |
|
41 | 41 | |
42 | - /** |
|
43 | - * Telematics connection name |
|
44 | - * @var type string |
|
45 | - */ |
|
46 | - public $name; |
|
42 | + /** |
|
43 | + * Telematics connection name |
|
44 | + * @var type string |
|
45 | + */ |
|
46 | + public $name; |
|
47 | 47 | |
48 | - /** |
|
49 | - * Vehicle tracking interval in seconds |
|
50 | - * @var type integer |
|
51 | - */ |
|
52 | - public $vehicle_position_refresh_rate; |
|
48 | + /** |
|
49 | + * Vehicle tracking interval in seconds |
|
50 | + * @var type integer |
|
51 | + */ |
|
52 | + public $vehicle_position_refresh_rate; |
|
53 | 53 | |
54 | - /** |
|
55 | - * Connection token |
|
56 | - * @var type string |
|
57 | - */ |
|
58 | - public $connection_token; |
|
54 | + /** |
|
55 | + * Connection token |
|
56 | + * @var type string |
|
57 | + */ |
|
58 | + public $connection_token; |
|
59 | 59 | |
60 | - /** |
|
61 | - * Connection user ID |
|
62 | - * @var type integer |
|
63 | - */ |
|
64 | - public $user_id; |
|
60 | + /** |
|
61 | + * Connection user ID |
|
62 | + * @var type integer |
|
63 | + */ |
|
64 | + public $user_id; |
|
65 | 65 | |
66 | - /** |
|
67 | - * Connection ID |
|
68 | - * @var type integer |
|
69 | - */ |
|
70 | - public $id; |
|
66 | + /** |
|
67 | + * Connection ID |
|
68 | + * @var type integer |
|
69 | + */ |
|
70 | + public $id; |
|
71 | 71 | |
72 | - /** |
|
73 | - * Telemetics connection type |
|
74 | - * @var type string |
|
75 | - */ |
|
76 | - public $vendor; |
|
72 | + /** |
|
73 | + * Telemetics connection type |
|
74 | + * @var type string |
|
75 | + */ |
|
76 | + public $vendor; |
|
77 | 77 | |
78 | - /** |
|
79 | - * Validate connections credentials. |
|
80 | - * @var type Boolean |
|
81 | - */ |
|
82 | - public $validate_remote_credentials; |
|
78 | + /** |
|
79 | + * Validate connections credentials. |
|
80 | + * @var type Boolean |
|
81 | + */ |
|
82 | + public $validate_remote_credentials; |
|
83 | 83 | |
84 | - public static function fromArray(array $params) |
|
85 | - { |
|
86 | - $thisParams = new self(); |
|
84 | + public static function fromArray(array $params) |
|
85 | + { |
|
86 | + $thisParams = new self(); |
|
87 | 87 | |
88 | - foreach ($params as $key => $value) { |
|
89 | - if (property_exists($thisParams, $key)) { |
|
90 | - $thisParams->{$key} = $value; |
|
91 | - } |
|
92 | - } |
|
88 | + foreach ($params as $key => $value) { |
|
89 | + if (property_exists($thisParams, $key)) { |
|
90 | + $thisParams->{$key} = $value; |
|
91 | + } |
|
92 | + } |
|
93 | 93 | |
94 | - return $thisParams; |
|
95 | - } |
|
94 | + return $thisParams; |
|
95 | + } |
|
96 | 96 | } |
@@ -8,9 +8,9 @@ |
||
8 | 8 | */ |
9 | 9 | class TelematicsVendorResponse extends Common |
10 | 10 | { |
11 | - /** |
|
12 | - * Telematics Vendor |
|
13 | - * @var type TelematicsVendor |
|
14 | - */ |
|
15 | - public $vendor; |
|
11 | + /** |
|
12 | + * Telematics Vendor |
|
13 | + * @var type TelematicsVendor |
|
14 | + */ |
|
15 | + public $vendor; |
|
16 | 16 | } |
@@ -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 | } |