@@ -14,35 +14,35 @@ |
||
14 | 14 | */ |
15 | 15 | class Permission extends Common |
16 | 16 | { |
17 | - public ?string $id = null; |
|
18 | - public ?string $title = null; |
|
19 | - public ?string $type = null; |
|
17 | + public ?string $id = null; |
|
18 | + public ?string $title = null; |
|
19 | + public ?string $type = null; |
|
20 | 20 | |
21 | - /** |
|
22 | - * Array of Options |
|
23 | - */ |
|
24 | - public ?array $options = null; |
|
21 | + /** |
|
22 | + * Array of Options |
|
23 | + */ |
|
24 | + public ?array $options = null; |
|
25 | 25 | |
26 | - /** |
|
27 | - * Array of strings |
|
28 | - */ |
|
29 | - public ?array $value = null; |
|
26 | + /** |
|
27 | + * Array of strings |
|
28 | + */ |
|
29 | + public ?array $value = null; |
|
30 | 30 | |
31 | - public function __construct(?array $params = null) |
|
32 | - { |
|
33 | - if ($params !== null) { |
|
34 | - foreach ($this as $key => $value) { |
|
35 | - if (isset($params[$key])) { |
|
36 | - if ($key === 'options') { |
|
37 | - $this->{$key} = array(); |
|
38 | - foreach ($params[$key] as $opt_key => $opt_value) { |
|
39 | - array_push($this->{$key}, new Option($opt_value)); |
|
40 | - } |
|
41 | - } else { |
|
42 | - $this->{$key} = $params[$key]; |
|
43 | - } |
|
44 | - } |
|
45 | - } |
|
46 | - } |
|
47 | - } |
|
31 | + public function __construct(?array $params = null) |
|
32 | + { |
|
33 | + if ($params !== null) { |
|
34 | + foreach ($this as $key => $value) { |
|
35 | + if (isset($params[$key])) { |
|
36 | + if ($key === 'options') { |
|
37 | + $this->{$key} = array(); |
|
38 | + foreach ($params[$key] as $opt_key => $opt_value) { |
|
39 | + array_push($this->{$key}, new Option($opt_value)); |
|
40 | + } |
|
41 | + } else { |
|
42 | + $this->{$key} = $params[$key]; |
|
43 | + } |
|
44 | + } |
|
45 | + } |
|
46 | + } |
|
47 | + } |
|
48 | 48 | } |
@@ -30,10 +30,10 @@ |
||
30 | 30 | |
31 | 31 | public function __construct(?array $params = null) |
32 | 32 | { |
33 | - if ($params !== null) { |
|
33 | + if ($params!==null) { |
|
34 | 34 | foreach ($this as $key => $value) { |
35 | 35 | if (isset($params[$key])) { |
36 | - if ($key === 'options') { |
|
36 | + if ($key==='options') { |
|
37 | 37 | $this->{$key} = array(); |
38 | 38 | foreach ($params[$key] as $opt_key => $opt_value) { |
39 | 39 | array_push($this->{$key}, new Option($opt_value)); |
@@ -17,277 +17,277 @@ |
||
17 | 17 | */ |
18 | 18 | class TeamManagement extends Common |
19 | 19 | { |
20 | - public function __construct() |
|
21 | - { |
|
22 | - Route4Me::setBaseUrl(''); |
|
23 | - } |
|
20 | + public function __construct() |
|
21 | + { |
|
22 | + Route4Me::setBaseUrl(''); |
|
23 | + } |
|
24 | 24 | |
25 | - /** |
|
26 | - * Add a new sub-user to the Member account by sending the corresponding |
|
27 | - * body payload with the sub-users' parameters. |
|
28 | - * |
|
29 | - * @see {@link https://virtserver.swaggerhub.com/Route4Me} |
|
30 | - * |
|
31 | - * @param array $params - Sub-user properties. |
|
32 | - * string new_password - Password. |
|
33 | - * string new_member_picture - Member picture. |
|
34 | - * string member_first_name - First name. |
|
35 | - * string member_last_name - Last name. |
|
36 | - * string member_email - E-mail. |
|
37 | - * string member_company - Company. |
|
38 | - * string member_type - Member type. |
|
39 | - * int OWNER_MEMBER_ID - Owner member ID. |
|
40 | - * string member_phone - Phone. |
|
41 | - * string date_of_birth - Date of birth. |
|
42 | - * int user_reg_state_id - User state ID. |
|
43 | - * int user_reg_country_id - User country ID. |
|
44 | - * float DriverHourlyRate - Drive hourly rate. |
|
45 | - * bool HIDE_ROUTED_ADDRESSES - Hide routed addresses. |
|
46 | - * bool HIDE_VISITED_ADDRESSES - Hide visited addresses. |
|
47 | - * bool HIDE_NONFUTURE_ROUTES - Hide nonfuture routes. |
|
48 | - * bool READONLY_USER - Readonly user. |
|
49 | - * bool SHOW_SUSR_ADDR - Show sub-user addresses. |
|
50 | - * bool SHOW_SUSR_ORDERS - Show sub-user orders. |
|
51 | - * bool SHOW_ALL_DRIVERS - Show all drivers. |
|
52 | - * bool SHOW_ALL_VEHICLES - Show all vehicles. |
|
53 | - * bool display_max_routes_future_days - Display max routes. |
|
54 | - * int vendor_id - Vendoe ID. |
|
55 | - * float driving_rate - Driving rate. |
|
56 | - * float working_rate - Working rate. |
|
57 | - * float mile_rate - Mile rate. |
|
58 | - * float idling_rate - Idling rate. |
|
59 | - * string timezone - Timezone. |
|
60 | - * string optimization_profile_id - Optimization profile ID. |
|
61 | - * array permissions - Array of permissions |
|
62 | - * string id - ID of permission |
|
63 | - * array value - Array of string values |
|
64 | - * @return ResponseTeam |
|
65 | - * @throws Exception\ApiError |
|
66 | - */ |
|
67 | - public function create(array $params) : ResponseTeam |
|
68 | - { |
|
69 | - $allBodyFields = ['new_password', 'new_member_picture', 'member_first_name', 'member_last_name', |
|
70 | - 'member_email', 'member_company', 'member_type', 'OWNER_MEMBER_ID', 'member_phone', 'date_of_birth', |
|
71 | - 'user_reg_state_id', 'user_reg_country_id', 'DriverHourlyRate', 'HIDE_ROUTED_ADDRESSES', |
|
72 | - 'HIDE_VISITED_ADDRESSES', 'HIDE_NONFUTURE_ROUTES', 'READONLY_USER', 'SHOW_SUSR_ADDR', 'SHOW_SUSR_ORDERS', |
|
73 | - 'SHOW_ALL_DRIVERS', 'SHOW_ALL_VEHICLES', 'display_max_routes_future_days', 'vendor_id', 'driving_rate', |
|
74 | - 'working_rate', 'mile_rate', 'idling_rate', 'timezone', 'optimization_profile_id', 'permissions' |
|
75 | - ]; |
|
25 | + /** |
|
26 | + * Add a new sub-user to the Member account by sending the corresponding |
|
27 | + * body payload with the sub-users' parameters. |
|
28 | + * |
|
29 | + * @see {@link https://virtserver.swaggerhub.com/Route4Me} |
|
30 | + * |
|
31 | + * @param array $params - Sub-user properties. |
|
32 | + * string new_password - Password. |
|
33 | + * string new_member_picture - Member picture. |
|
34 | + * string member_first_name - First name. |
|
35 | + * string member_last_name - Last name. |
|
36 | + * string member_email - E-mail. |
|
37 | + * string member_company - Company. |
|
38 | + * string member_type - Member type. |
|
39 | + * int OWNER_MEMBER_ID - Owner member ID. |
|
40 | + * string member_phone - Phone. |
|
41 | + * string date_of_birth - Date of birth. |
|
42 | + * int user_reg_state_id - User state ID. |
|
43 | + * int user_reg_country_id - User country ID. |
|
44 | + * float DriverHourlyRate - Drive hourly rate. |
|
45 | + * bool HIDE_ROUTED_ADDRESSES - Hide routed addresses. |
|
46 | + * bool HIDE_VISITED_ADDRESSES - Hide visited addresses. |
|
47 | + * bool HIDE_NONFUTURE_ROUTES - Hide nonfuture routes. |
|
48 | + * bool READONLY_USER - Readonly user. |
|
49 | + * bool SHOW_SUSR_ADDR - Show sub-user addresses. |
|
50 | + * bool SHOW_SUSR_ORDERS - Show sub-user orders. |
|
51 | + * bool SHOW_ALL_DRIVERS - Show all drivers. |
|
52 | + * bool SHOW_ALL_VEHICLES - Show all vehicles. |
|
53 | + * bool display_max_routes_future_days - Display max routes. |
|
54 | + * int vendor_id - Vendoe ID. |
|
55 | + * float driving_rate - Driving rate. |
|
56 | + * float working_rate - Working rate. |
|
57 | + * float mile_rate - Mile rate. |
|
58 | + * float idling_rate - Idling rate. |
|
59 | + * string timezone - Timezone. |
|
60 | + * string optimization_profile_id - Optimization profile ID. |
|
61 | + * array permissions - Array of permissions |
|
62 | + * string id - ID of permission |
|
63 | + * array value - Array of string values |
|
64 | + * @return ResponseTeam |
|
65 | + * @throws Exception\ApiError |
|
66 | + */ |
|
67 | + public function create(array $params) : ResponseTeam |
|
68 | + { |
|
69 | + $allBodyFields = ['new_password', 'new_member_picture', 'member_first_name', 'member_last_name', |
|
70 | + 'member_email', 'member_company', 'member_type', 'OWNER_MEMBER_ID', 'member_phone', 'date_of_birth', |
|
71 | + 'user_reg_state_id', 'user_reg_country_id', 'DriverHourlyRate', 'HIDE_ROUTED_ADDRESSES', |
|
72 | + 'HIDE_VISITED_ADDRESSES', 'HIDE_NONFUTURE_ROUTES', 'READONLY_USER', 'SHOW_SUSR_ADDR', 'SHOW_SUSR_ORDERS', |
|
73 | + 'SHOW_ALL_DRIVERS', 'SHOW_ALL_VEHICLES', 'display_max_routes_future_days', 'vendor_id', 'driving_rate', |
|
74 | + 'working_rate', 'mile_rate', 'idling_rate', 'timezone', 'optimization_profile_id', 'permissions' |
|
75 | + ]; |
|
76 | 76 | |
77 | - return $this->toResponseTeam(Route4Me::makeRequst([ |
|
78 | - 'url' => Endpoint::TEAM_USERS, |
|
79 | - 'method' => 'POST', |
|
80 | - 'HTTPHEADER' => 'Content-Type: application/json', |
|
81 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
82 | - ])); |
|
83 | - } |
|
77 | + return $this->toResponseTeam(Route4Me::makeRequst([ |
|
78 | + 'url' => Endpoint::TEAM_USERS, |
|
79 | + 'method' => 'POST', |
|
80 | + 'HTTPHEADER' => 'Content-Type: application/json', |
|
81 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
82 | + ])); |
|
83 | + } |
|
84 | 84 | |
85 | - /** |
|
86 | - * View all existing sub-users associated with the Member’s account. |
|
87 | - * |
|
88 | - * @see {@link https://virtserver.swaggerhub.com/Route4Me} |
|
89 | - * |
|
90 | - * @return ResponseTeam[] |
|
91 | - * @throws Exception\ApiError |
|
92 | - */ |
|
93 | - public function getUsers() : ?array |
|
94 | - { |
|
95 | - $result = Route4Me::makeRequst([ |
|
96 | - 'url' => Endpoint::TEAM_USERS, |
|
97 | - 'method' => 'GET' |
|
98 | - ]); |
|
85 | + /** |
|
86 | + * View all existing sub-users associated with the Member’s account. |
|
87 | + * |
|
88 | + * @see {@link https://virtserver.swaggerhub.com/Route4Me} |
|
89 | + * |
|
90 | + * @return ResponseTeam[] |
|
91 | + * @throws Exception\ApiError |
|
92 | + */ |
|
93 | + public function getUsers() : ?array |
|
94 | + { |
|
95 | + $result = Route4Me::makeRequst([ |
|
96 | + 'url' => Endpoint::TEAM_USERS, |
|
97 | + 'method' => 'GET' |
|
98 | + ]); |
|
99 | 99 | |
100 | - if (is_array($result)) { |
|
101 | - $arr = []; |
|
102 | - foreach ($result as $key => $value) { |
|
103 | - array_push($arr, $this->toResponseTeam($value)); |
|
104 | - } |
|
105 | - return $arr; |
|
106 | - } |
|
107 | - return null; |
|
108 | - } |
|
100 | + if (is_array($result)) { |
|
101 | + $arr = []; |
|
102 | + foreach ($result as $key => $value) { |
|
103 | + array_push($arr, $this->toResponseTeam($value)); |
|
104 | + } |
|
105 | + return $arr; |
|
106 | + } |
|
107 | + return null; |
|
108 | + } |
|
109 | 109 | |
110 | - /** |
|
111 | - * Get the sub-user by specifying the path parameter ID. |
|
112 | - * |
|
113 | - * @see {@link https://virtserver.swaggerhub.com/Route4Me} |
|
114 | - * |
|
115 | - * @param int $userId - User ID. |
|
116 | - * @return ResponseTeam |
|
117 | - * @throws Exception\ApiError |
|
118 | - */ |
|
119 | - public function getUser(int $userId) : ResponseTeam |
|
120 | - { |
|
121 | - return $this->toResponseTeam(Route4Me::makeRequst([ |
|
122 | - 'url' => Endpoint::TEAM_USERS . '/' . $userId, |
|
123 | - 'method' => 'GET' |
|
124 | - ])); |
|
125 | - } |
|
110 | + /** |
|
111 | + * Get the sub-user by specifying the path parameter ID. |
|
112 | + * |
|
113 | + * @see {@link https://virtserver.swaggerhub.com/Route4Me} |
|
114 | + * |
|
115 | + * @param int $userId - User ID. |
|
116 | + * @return ResponseTeam |
|
117 | + * @throws Exception\ApiError |
|
118 | + */ |
|
119 | + public function getUser(int $userId) : ResponseTeam |
|
120 | + { |
|
121 | + return $this->toResponseTeam(Route4Me::makeRequst([ |
|
122 | + 'url' => Endpoint::TEAM_USERS . '/' . $userId, |
|
123 | + 'method' => 'GET' |
|
124 | + ])); |
|
125 | + } |
|
126 | 126 | |
127 | - /** |
|
128 | - * Delete the sub-user by specifying the path parameter ID. |
|
129 | - * |
|
130 | - * @see {@link https://virtserver.swaggerhub.com/Route4Me} |
|
131 | - * |
|
132 | - * @param int $userId - User ID. |
|
133 | - * @return ResponseTeam - Deleted object |
|
134 | - * @throws Exception\ApiError |
|
135 | - */ |
|
136 | - public function delete(int $userId) : ResponseTeam |
|
137 | - { |
|
138 | - return $this->toResponseTeam(Route4Me::makeRequst([ |
|
139 | - 'url' => Endpoint::TEAM_USERS . '/' . $userId, |
|
140 | - 'method' => 'DELETE' |
|
141 | - ])); |
|
142 | - } |
|
127 | + /** |
|
128 | + * Delete the sub-user by specifying the path parameter ID. |
|
129 | + * |
|
130 | + * @see {@link https://virtserver.swaggerhub.com/Route4Me} |
|
131 | + * |
|
132 | + * @param int $userId - User ID. |
|
133 | + * @return ResponseTeam - Deleted object |
|
134 | + * @throws Exception\ApiError |
|
135 | + */ |
|
136 | + public function delete(int $userId) : ResponseTeam |
|
137 | + { |
|
138 | + return $this->toResponseTeam(Route4Me::makeRequst([ |
|
139 | + 'url' => Endpoint::TEAM_USERS . '/' . $userId, |
|
140 | + 'method' => 'DELETE' |
|
141 | + ])); |
|
142 | + } |
|
143 | 143 | |
144 | - /** |
|
145 | - * Update the sub-user by specifying the path parameter ID and by sending the |
|
146 | - * corresponding body payload with the sub-user's parameters.. |
|
147 | - * |
|
148 | - * @see {@link https://virtserver.swaggerhub.com/Route4Me} |
|
149 | - * |
|
150 | - * @param int $userId - User ID. |
|
151 | - * @param array $params - Sub-user properties. |
|
152 | - * string new_password - Password. |
|
153 | - * string new_member_picture - Member picture. |
|
154 | - * string member_first_name - First name. |
|
155 | - * string member_last_name - Last name. |
|
156 | - * string member_email - E-mail. |
|
157 | - * string member_company - Company. |
|
158 | - * string member_type - Member type. |
|
159 | - * int OWNER_MEMBER_ID - Owner member ID. |
|
160 | - * string member_phone - Phone. |
|
161 | - * string date_of_birth - Date of birth. |
|
162 | - * int user_reg_state_id - User state ID. |
|
163 | - * int user_reg_country_id - User country ID. |
|
164 | - * float DriverHourlyRate - Drive hourly rate. |
|
165 | - * bool HIDE_ROUTED_ADDRESSES - Hide routed addresses. |
|
166 | - * bool HIDE_VISITED_ADDRESSES - Hide visited addresses. |
|
167 | - * bool HIDE_NONFUTURE_ROUTES - Hide nonfuture routes. |
|
168 | - * bool READONLY_USER - Readonly user. |
|
169 | - * bool SHOW_SUSR_ADDR - Show sub-user addresses. |
|
170 | - * bool SHOW_SUSR_ORDERS - Show sub-user orders. |
|
171 | - * bool SHOW_ALL_DRIVERS - Show all drivers. |
|
172 | - * bool SHOW_ALL_VEHICLES - Show all vehicles. |
|
173 | - * bool display_max_routes_future_days - Display max routes. |
|
174 | - * int vendor_id - Vendoe ID. |
|
175 | - * float driving_rate - Driving rate. |
|
176 | - * float working_rate - Working rate. |
|
177 | - * float mile_rate - Mile rate. |
|
178 | - * float idling_rate - Idling rate. |
|
179 | - * string timezone - Timezone. |
|
180 | - * string optimization_profile_id - Optimization profile ID. |
|
181 | - * array permissions - Array of permissions |
|
182 | - * string id - ID of permission |
|
183 | - * array value - Array of string values |
|
184 | - * @return ResponseTeam |
|
185 | - * @throws Exception\ApiError |
|
186 | - */ |
|
187 | - public function update(int $userId, array $params) : ResponseTeam |
|
188 | - { |
|
189 | - $allBodyFields = ['new_password', 'new_member_picture', 'member_first_name', 'member_last_name', |
|
190 | - 'member_email', 'member_company', 'member_type', 'OWNER_MEMBER_ID', 'member_phone', 'date_of_birth', |
|
191 | - 'user_reg_state_id', 'user_reg_country_id', 'DriverHourlyRate', 'HIDE_ROUTED_ADDRESSES', |
|
192 | - 'HIDE_VISITED_ADDRESSES', 'HIDE_NONFUTURE_ROUTES', 'READONLY_USER', 'SHOW_SUSR_ADDR', 'SHOW_SUSR_ORDERS', |
|
193 | - 'SHOW_ALL_DRIVERS', 'SHOW_ALL_VEHICLES', 'display_max_routes_future_days', 'vendor_id', 'driving_rate', |
|
194 | - 'working_rate', 'mile_rate', 'idling_rate', 'timezone', 'optimization_profile_id', 'permissions' |
|
195 | - ]; |
|
144 | + /** |
|
145 | + * Update the sub-user by specifying the path parameter ID and by sending the |
|
146 | + * corresponding body payload with the sub-user's parameters.. |
|
147 | + * |
|
148 | + * @see {@link https://virtserver.swaggerhub.com/Route4Me} |
|
149 | + * |
|
150 | + * @param int $userId - User ID. |
|
151 | + * @param array $params - Sub-user properties. |
|
152 | + * string new_password - Password. |
|
153 | + * string new_member_picture - Member picture. |
|
154 | + * string member_first_name - First name. |
|
155 | + * string member_last_name - Last name. |
|
156 | + * string member_email - E-mail. |
|
157 | + * string member_company - Company. |
|
158 | + * string member_type - Member type. |
|
159 | + * int OWNER_MEMBER_ID - Owner member ID. |
|
160 | + * string member_phone - Phone. |
|
161 | + * string date_of_birth - Date of birth. |
|
162 | + * int user_reg_state_id - User state ID. |
|
163 | + * int user_reg_country_id - User country ID. |
|
164 | + * float DriverHourlyRate - Drive hourly rate. |
|
165 | + * bool HIDE_ROUTED_ADDRESSES - Hide routed addresses. |
|
166 | + * bool HIDE_VISITED_ADDRESSES - Hide visited addresses. |
|
167 | + * bool HIDE_NONFUTURE_ROUTES - Hide nonfuture routes. |
|
168 | + * bool READONLY_USER - Readonly user. |
|
169 | + * bool SHOW_SUSR_ADDR - Show sub-user addresses. |
|
170 | + * bool SHOW_SUSR_ORDERS - Show sub-user orders. |
|
171 | + * bool SHOW_ALL_DRIVERS - Show all drivers. |
|
172 | + * bool SHOW_ALL_VEHICLES - Show all vehicles. |
|
173 | + * bool display_max_routes_future_days - Display max routes. |
|
174 | + * int vendor_id - Vendoe ID. |
|
175 | + * float driving_rate - Driving rate. |
|
176 | + * float working_rate - Working rate. |
|
177 | + * float mile_rate - Mile rate. |
|
178 | + * float idling_rate - Idling rate. |
|
179 | + * string timezone - Timezone. |
|
180 | + * string optimization_profile_id - Optimization profile ID. |
|
181 | + * array permissions - Array of permissions |
|
182 | + * string id - ID of permission |
|
183 | + * array value - Array of string values |
|
184 | + * @return ResponseTeam |
|
185 | + * @throws Exception\ApiError |
|
186 | + */ |
|
187 | + public function update(int $userId, array $params) : ResponseTeam |
|
188 | + { |
|
189 | + $allBodyFields = ['new_password', 'new_member_picture', 'member_first_name', 'member_last_name', |
|
190 | + 'member_email', 'member_company', 'member_type', 'OWNER_MEMBER_ID', 'member_phone', 'date_of_birth', |
|
191 | + 'user_reg_state_id', 'user_reg_country_id', 'DriverHourlyRate', 'HIDE_ROUTED_ADDRESSES', |
|
192 | + 'HIDE_VISITED_ADDRESSES', 'HIDE_NONFUTURE_ROUTES', 'READONLY_USER', 'SHOW_SUSR_ADDR', 'SHOW_SUSR_ORDERS', |
|
193 | + 'SHOW_ALL_DRIVERS', 'SHOW_ALL_VEHICLES', 'display_max_routes_future_days', 'vendor_id', 'driving_rate', |
|
194 | + 'working_rate', 'mile_rate', 'idling_rate', 'timezone', 'optimization_profile_id', 'permissions' |
|
195 | + ]; |
|
196 | 196 | |
197 | - return $this->toResponseTeam(Route4Me::makeRequst([ |
|
198 | - 'url' => Endpoint::TEAM_USERS . '/' . $userId, |
|
199 | - 'method' => 'PATCH', |
|
200 | - 'HTTPHEADER' => 'Content-Type: application/json', |
|
201 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
202 | - ])); |
|
203 | - } |
|
197 | + return $this->toResponseTeam(Route4Me::makeRequst([ |
|
198 | + 'url' => Endpoint::TEAM_USERS . '/' . $userId, |
|
199 | + 'method' => 'PATCH', |
|
200 | + 'HTTPHEADER' => 'Content-Type: application/json', |
|
201 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
202 | + ])); |
|
203 | + } |
|
204 | 204 | |
205 | - /** |
|
206 | - * Add multiple sub-users to the User account by sending the corresponding |
|
207 | - * body payload with the array of the sub-users' parameters |
|
208 | - * |
|
209 | - * @see {@link https://virtserver.swaggerhub.com/Route4Me} |
|
210 | - * |
|
211 | - * @param array $params - Array of array of Sub-user properties. |
|
212 | - * string new_password - Password. |
|
213 | - * string new_member_picture - Member picture. |
|
214 | - * string member_first_name - First name. |
|
215 | - * string member_last_name - Last name. |
|
216 | - * string member_email - E-mail. |
|
217 | - * string member_company - Company. |
|
218 | - * string member_type - Member type. |
|
219 | - * int OWNER_MEMBER_ID - Owner member ID. |
|
220 | - * string member_phone - Phone. |
|
221 | - * string date_of_birth - Date of birth. |
|
222 | - * int user_reg_state_id - User state ID. |
|
223 | - * int user_reg_country_id - User country ID. |
|
224 | - * float DriverHourlyRate - Drive hourly rate. |
|
225 | - * bool HIDE_ROUTED_ADDRESSES - Hide routed addresses. |
|
226 | - * bool HIDE_VISITED_ADDRESSES - Hide visited addresses. |
|
227 | - * bool HIDE_NONFUTURE_ROUTES - Hide nonfuture routes. |
|
228 | - * bool READONLY_USER - Readonly user. |
|
229 | - * bool SHOW_SUSR_ADDR - Show sub-user addresses. |
|
230 | - * bool SHOW_SUSR_ORDERS - Show sub-user orders. |
|
231 | - * bool SHOW_ALL_DRIVERS - Show all drivers. |
|
232 | - * bool SHOW_ALL_VEHICLES - Show all vehicles. |
|
233 | - * bool display_max_routes_future_days - Display max routes. |
|
234 | - * int vendor_id - Vendoe ID. |
|
235 | - * float driving_rate - Driving rate. |
|
236 | - * float working_rate - Working rate. |
|
237 | - * float mile_rate - Mile rate. |
|
238 | - * float idling_rate - Idling rate. |
|
239 | - * string timezone - Timezone. |
|
240 | - * string optimization_profile_id - Optimization profile ID. |
|
241 | - * array permissions - Array of permissions |
|
242 | - * string id - ID of permission |
|
243 | - * array value - Array of string values |
|
244 | - * @param array options - Array of insert options. |
|
245 | - * string [api_key] - User API key. |
|
246 | - * string [conflicts] - Conflict resolving rule. |
|
247 | - * Possible values: 'fail', 'overwrite' and 'skip'. |
|
248 | - * @return ResponseTeam |
|
249 | - * @throws Exception\ApiError |
|
250 | - */ |
|
251 | - public function bulkInsert(array $params, ?array $options = null) |
|
252 | - { |
|
253 | - $allBodyFields = ['new_password', 'new_member_picture', 'member_first_name', 'member_last_name', |
|
254 | - 'member_email', 'member_company', 'member_type', 'OWNER_MEMBER_ID', 'member_phone', 'date_of_birth', |
|
255 | - 'user_reg_state_id', 'user_reg_country_id', 'DriverHourlyRate', 'HIDE_ROUTED_ADDRESSES', |
|
256 | - 'HIDE_VISITED_ADDRESSES', 'HIDE_NONFUTURE_ROUTES', 'READONLY_USER', 'SHOW_SUSR_ADDR', 'SHOW_SUSR_ORDERS', |
|
257 | - 'SHOW_ALL_DRIVERS', 'SHOW_ALL_VEHICLES', 'display_max_routes_future_days', 'vendor_id', 'driving_rate', |
|
258 | - 'working_rate', 'mile_rate', 'idling_rate', 'timezone', 'optimization_profile_id', 'permissions' |
|
259 | - ]; |
|
205 | + /** |
|
206 | + * Add multiple sub-users to the User account by sending the corresponding |
|
207 | + * body payload with the array of the sub-users' parameters |
|
208 | + * |
|
209 | + * @see {@link https://virtserver.swaggerhub.com/Route4Me} |
|
210 | + * |
|
211 | + * @param array $params - Array of array of Sub-user properties. |
|
212 | + * string new_password - Password. |
|
213 | + * string new_member_picture - Member picture. |
|
214 | + * string member_first_name - First name. |
|
215 | + * string member_last_name - Last name. |
|
216 | + * string member_email - E-mail. |
|
217 | + * string member_company - Company. |
|
218 | + * string member_type - Member type. |
|
219 | + * int OWNER_MEMBER_ID - Owner member ID. |
|
220 | + * string member_phone - Phone. |
|
221 | + * string date_of_birth - Date of birth. |
|
222 | + * int user_reg_state_id - User state ID. |
|
223 | + * int user_reg_country_id - User country ID. |
|
224 | + * float DriverHourlyRate - Drive hourly rate. |
|
225 | + * bool HIDE_ROUTED_ADDRESSES - Hide routed addresses. |
|
226 | + * bool HIDE_VISITED_ADDRESSES - Hide visited addresses. |
|
227 | + * bool HIDE_NONFUTURE_ROUTES - Hide nonfuture routes. |
|
228 | + * bool READONLY_USER - Readonly user. |
|
229 | + * bool SHOW_SUSR_ADDR - Show sub-user addresses. |
|
230 | + * bool SHOW_SUSR_ORDERS - Show sub-user orders. |
|
231 | + * bool SHOW_ALL_DRIVERS - Show all drivers. |
|
232 | + * bool SHOW_ALL_VEHICLES - Show all vehicles. |
|
233 | + * bool display_max_routes_future_days - Display max routes. |
|
234 | + * int vendor_id - Vendoe ID. |
|
235 | + * float driving_rate - Driving rate. |
|
236 | + * float working_rate - Working rate. |
|
237 | + * float mile_rate - Mile rate. |
|
238 | + * float idling_rate - Idling rate. |
|
239 | + * string timezone - Timezone. |
|
240 | + * string optimization_profile_id - Optimization profile ID. |
|
241 | + * array permissions - Array of permissions |
|
242 | + * string id - ID of permission |
|
243 | + * array value - Array of string values |
|
244 | + * @param array options - Array of insert options. |
|
245 | + * string [api_key] - User API key. |
|
246 | + * string [conflicts] - Conflict resolving rule. |
|
247 | + * Possible values: 'fail', 'overwrite' and 'skip'. |
|
248 | + * @return ResponseTeam |
|
249 | + * @throws Exception\ApiError |
|
250 | + */ |
|
251 | + public function bulkInsert(array $params, ?array $options = null) |
|
252 | + { |
|
253 | + $allBodyFields = ['new_password', 'new_member_picture', 'member_first_name', 'member_last_name', |
|
254 | + 'member_email', 'member_company', 'member_type', 'OWNER_MEMBER_ID', 'member_phone', 'date_of_birth', |
|
255 | + 'user_reg_state_id', 'user_reg_country_id', 'DriverHourlyRate', 'HIDE_ROUTED_ADDRESSES', |
|
256 | + 'HIDE_VISITED_ADDRESSES', 'HIDE_NONFUTURE_ROUTES', 'READONLY_USER', 'SHOW_SUSR_ADDR', 'SHOW_SUSR_ORDERS', |
|
257 | + 'SHOW_ALL_DRIVERS', 'SHOW_ALL_VEHICLES', 'display_max_routes_future_days', 'vendor_id', 'driving_rate', |
|
258 | + 'working_rate', 'mile_rate', 'idling_rate', 'timezone', 'optimization_profile_id', 'permissions' |
|
259 | + ]; |
|
260 | 260 | |
261 | - $allQueryFields = ['api_key', 'conflicts']; |
|
261 | + $allQueryFields = ['api_key', 'conflicts']; |
|
262 | 262 | |
263 | - $body = []; |
|
264 | - foreach ($params as $key => $value) { |
|
265 | - $body[] = Route4Me::generateRequestParameters($allBodyFields, $value); |
|
266 | - } |
|
263 | + $body = []; |
|
264 | + foreach ($params as $key => $value) { |
|
265 | + $body[] = Route4Me::generateRequestParameters($allBodyFields, $value); |
|
266 | + } |
|
267 | 267 | |
268 | - $result = Route4Me::makeRequst([ |
|
269 | - 'url' => Endpoint::TEAM_USERS_BULK_INSERT, |
|
270 | - 'method' => 'POST', |
|
271 | - 'HTTPHEADER' => 'Content-Type: application/json', |
|
272 | - 'body' => ['users' => $body], |
|
273 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $options) |
|
274 | - ]); |
|
268 | + $result = Route4Me::makeRequst([ |
|
269 | + 'url' => Endpoint::TEAM_USERS_BULK_INSERT, |
|
270 | + 'method' => 'POST', |
|
271 | + 'HTTPHEADER' => 'Content-Type: application/json', |
|
272 | + 'body' => ['users' => $body], |
|
273 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $options) |
|
274 | + ]); |
|
275 | 275 | |
276 | - if (is_array($result)) { |
|
277 | - $arr = []; |
|
278 | - foreach ($result as $key => $value) { |
|
279 | - array_push($arr, $this->toResponseTeam($value)); |
|
280 | - } |
|
281 | - return $arr; |
|
282 | - } |
|
283 | - return null; |
|
284 | - } |
|
276 | + if (is_array($result)) { |
|
277 | + $arr = []; |
|
278 | + foreach ($result as $key => $value) { |
|
279 | + array_push($arr, $this->toResponseTeam($value)); |
|
280 | + } |
|
281 | + return $arr; |
|
282 | + } |
|
283 | + return null; |
|
284 | + } |
|
285 | 285 | |
286 | - private function toResponseTeam($result) : ResponseTeam |
|
287 | - { |
|
288 | - if (is_array($result)) { |
|
289 | - return new ResponseTeam($result); |
|
290 | - } |
|
291 | - throw new ApiError('Can not convert result to ResponseTeam object.'); |
|
292 | - } |
|
286 | + private function toResponseTeam($result) : ResponseTeam |
|
287 | + { |
|
288 | + if (is_array($result)) { |
|
289 | + return new ResponseTeam($result); |
|
290 | + } |
|
291 | + throw new ApiError('Can not convert result to ResponseTeam object.'); |
|
292 | + } |
|
293 | 293 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | public function getUser(int $userId) : ResponseTeam |
120 | 120 | { |
121 | 121 | return $this->toResponseTeam(Route4Me::makeRequst([ |
122 | - 'url' => Endpoint::TEAM_USERS . '/' . $userId, |
|
122 | + 'url' => Endpoint::TEAM_USERS.'/'.$userId, |
|
123 | 123 | 'method' => 'GET' |
124 | 124 | ])); |
125 | 125 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | public function delete(int $userId) : ResponseTeam |
137 | 137 | { |
138 | 138 | return $this->toResponseTeam(Route4Me::makeRequst([ |
139 | - 'url' => Endpoint::TEAM_USERS . '/' . $userId, |
|
139 | + 'url' => Endpoint::TEAM_USERS.'/'.$userId, |
|
140 | 140 | 'method' => 'DELETE' |
141 | 141 | ])); |
142 | 142 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | ]; |
196 | 196 | |
197 | 197 | return $this->toResponseTeam(Route4Me::makeRequst([ |
198 | - 'url' => Endpoint::TEAM_USERS . '/' . $userId, |
|
198 | + 'url' => Endpoint::TEAM_USERS.'/'.$userId, |
|
199 | 199 | 'method' => 'PATCH', |
200 | 200 | 'HTTPHEADER' => 'Content-Type: application/json', |
201 | 201 | 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
@@ -18,37 +18,37 @@ |
||
18 | 18 | Route4Me::setApiKey(Constants::API_KEY); |
19 | 19 | |
20 | 20 | try { |
21 | - // get OWNER_MEMBER_ID |
|
22 | - $owner_member_id = null; |
|
23 | - $member = new Member(); |
|
24 | - $res_members = $member->getUsers(); |
|
25 | - |
|
26 | - if (is_array($res_members) && isset($res_members['results'])) { |
|
27 | - foreach ($res_members['results'] as $key => $value) { |
|
28 | - if ($value['OWNER_MEMBER_ID'] == 0) { |
|
29 | - $owner_member_id = $value['member_id']; |
|
30 | - break; |
|
31 | - } |
|
32 | - } |
|
33 | - } |
|
34 | - |
|
35 | - if (!$owner_member_id) { |
|
36 | - throw new Exception("Cannot find OWNER_MEMBER_ID."); |
|
37 | - } |
|
38 | - |
|
39 | - // new sub-user |
|
40 | - $params = [ |
|
41 | - 'new_password' => '12345#Tusha', |
|
42 | - 'member_first_name' => 'Tusha I', |
|
43 | - 'member_last_name' => 'Pupkindzes', |
|
44 | - 'member_email' => '[email protected]', |
|
45 | - 'member_type' => 'SUB_ACCOUNT_DRIVER', |
|
46 | - 'OWNER_MEMBER_ID' => $owner_member_id |
|
47 | - ]; |
|
48 | - |
|
49 | - $tm = new TeamManagement(); |
|
50 | - $res = $tm->create($params); |
|
51 | - print_r($res); |
|
21 | + // get OWNER_MEMBER_ID |
|
22 | + $owner_member_id = null; |
|
23 | + $member = new Member(); |
|
24 | + $res_members = $member->getUsers(); |
|
25 | + |
|
26 | + if (is_array($res_members) && isset($res_members['results'])) { |
|
27 | + foreach ($res_members['results'] as $key => $value) { |
|
28 | + if ($value['OWNER_MEMBER_ID'] == 0) { |
|
29 | + $owner_member_id = $value['member_id']; |
|
30 | + break; |
|
31 | + } |
|
32 | + } |
|
33 | + } |
|
34 | + |
|
35 | + if (!$owner_member_id) { |
|
36 | + throw new Exception("Cannot find OWNER_MEMBER_ID."); |
|
37 | + } |
|
38 | + |
|
39 | + // new sub-user |
|
40 | + $params = [ |
|
41 | + 'new_password' => '12345#Tusha', |
|
42 | + 'member_first_name' => 'Tusha I', |
|
43 | + 'member_last_name' => 'Pupkindzes', |
|
44 | + 'member_email' => '[email protected]', |
|
45 | + 'member_type' => 'SUB_ACCOUNT_DRIVER', |
|
46 | + 'OWNER_MEMBER_ID' => $owner_member_id |
|
47 | + ]; |
|
48 | + |
|
49 | + $tm = new TeamManagement(); |
|
50 | + $res = $tm->create($params); |
|
51 | + print_r($res); |
|
52 | 52 | } catch (Exception | ApiError $e) { |
53 | - echo $e->getMessage() . PHP_EOL; |
|
53 | + echo $e->getMessage() . PHP_EOL; |
|
54 | 54 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | if (is_array($res_members) && isset($res_members['results'])) { |
27 | 27 | foreach ($res_members['results'] as $key => $value) { |
28 | - if ($value['OWNER_MEMBER_ID'] == 0) { |
|
28 | + if ($value['OWNER_MEMBER_ID']==0) { |
|
29 | 29 | $owner_member_id = $value['member_id']; |
30 | 30 | break; |
31 | 31 | } |
@@ -50,5 +50,5 @@ discard block |
||
50 | 50 | $res = $tm->create($params); |
51 | 51 | print_r($res); |
52 | 52 | } catch (Exception | ApiError $e) { |
53 | - echo $e->getMessage() . PHP_EOL; |
|
53 | + echo $e->getMessage().PHP_EOL; |
|
54 | 54 | } |
@@ -18,9 +18,9 @@ |
||
18 | 18 | $userId = 2565363; |
19 | 19 | |
20 | 20 | try { |
21 | - $tm = new TeamManagement(); |
|
22 | - $res = $tm->getUser($userId); |
|
23 | - print_r($res); |
|
21 | + $tm = new TeamManagement(); |
|
22 | + $res = $tm->getUser($userId); |
|
23 | + print_r($res); |
|
24 | 24 | } catch (ApiError $e) { |
25 | - echo 'Cannot get user with ID: ' . $userId . PHP_EOL; |
|
25 | + echo 'Cannot get user with ID: ' . $userId . PHP_EOL; |
|
26 | 26 | } |
@@ -22,5 +22,5 @@ |
||
22 | 22 | $res = $tm->getUser($userId); |
23 | 23 | print_r($res); |
24 | 24 | } catch (ApiError $e) { |
25 | - echo 'Cannot get user with ID: ' . $userId . PHP_EOL; |
|
25 | + echo 'Cannot get user with ID: '.$userId.PHP_EOL; |
|
26 | 26 | } |
@@ -16,9 +16,9 @@ |
||
16 | 16 | Route4Me::setApiKey(Constants::API_KEY); |
17 | 17 | |
18 | 18 | try { |
19 | - $tm = new TeamManagement(); |
|
20 | - $res = $tm->getUsers(); |
|
21 | - print_r($res); |
|
19 | + $tm = new TeamManagement(); |
|
20 | + $res = $tm->getUsers(); |
|
21 | + print_r($res); |
|
22 | 22 | } catch (ApiError $e) { |
23 | - echo $e->getMessage() . PHP_EOL; |
|
23 | + echo $e->getMessage() . PHP_EOL; |
|
24 | 24 | } |
@@ -20,5 +20,5 @@ |
||
20 | 20 | $res = $tm->getUsers(); |
21 | 21 | print_r($res); |
22 | 22 | } catch (ApiError $e) { |
23 | - echo $e->getMessage() . PHP_EOL; |
|
23 | + echo $e->getMessage().PHP_EOL; |
|
24 | 24 | } |
@@ -18,14 +18,14 @@ |
||
18 | 18 | |
19 | 19 | $userId = 2565363; |
20 | 20 | $params = [ |
21 | - 'HIDE_ROUTED_ADDRESSES' => true, |
|
22 | - 'member_type' => 'SUB_ACCOUNT_DISPATCHER' |
|
21 | + 'HIDE_ROUTED_ADDRESSES' => true, |
|
22 | + 'member_type' => 'SUB_ACCOUNT_DISPATCHER' |
|
23 | 23 | ]; |
24 | 24 | |
25 | 25 | try { |
26 | - $tm = new TeamManagement(); |
|
27 | - $res = $tm->update($userId, $params); |
|
28 | - print_r($res); |
|
26 | + $tm = new TeamManagement(); |
|
27 | + $res = $tm->update($userId, $params); |
|
28 | + print_r($res); |
|
29 | 29 | } catch (ApiError $e) { |
30 | - echo $e->getMessage() . PHP_EOL; |
|
30 | + echo $e->getMessage() . PHP_EOL; |
|
31 | 31 | } |
@@ -27,5 +27,5 @@ |
||
27 | 27 | $res = $tm->update($userId, $params); |
28 | 28 | print_r($res); |
29 | 29 | } catch (ApiError $e) { |
30 | - echo $e->getMessage() . PHP_EOL; |
|
30 | + echo $e->getMessage().PHP_EOL; |
|
31 | 31 | } |
@@ -19,51 +19,51 @@ |
||
19 | 19 | Route4Me::setApiKey(Constants::API_KEY); |
20 | 20 | |
21 | 21 | try { |
22 | - // get OWNER_MEMBER_ID |
|
23 | - $owner_member_id = null; |
|
24 | - $member = new Member(); |
|
25 | - $res_members = $member->getUsers(); |
|
22 | + // get OWNER_MEMBER_ID |
|
23 | + $owner_member_id = null; |
|
24 | + $member = new Member(); |
|
25 | + $res_members = $member->getUsers(); |
|
26 | 26 | |
27 | - if (is_array($res_members) && isset($res_members['results'])) { |
|
28 | - foreach ($res_members['results'] as $key => $value) { |
|
29 | - if ($value['OWNER_MEMBER_ID'] == 0) { |
|
30 | - $owner_member_id = $value['member_id']; |
|
31 | - break; |
|
32 | - } |
|
33 | - } |
|
34 | - } |
|
27 | + if (is_array($res_members) && isset($res_members['results'])) { |
|
28 | + foreach ($res_members['results'] as $key => $value) { |
|
29 | + if ($value['OWNER_MEMBER_ID'] == 0) { |
|
30 | + $owner_member_id = $value['member_id']; |
|
31 | + break; |
|
32 | + } |
|
33 | + } |
|
34 | + } |
|
35 | 35 | |
36 | - if (!$owner_member_id) { |
|
37 | - throw new Exception("Cannot find OWNER_MEMBER_ID."); |
|
38 | - } |
|
36 | + if (!$owner_member_id) { |
|
37 | + throw new Exception("Cannot find OWNER_MEMBER_ID."); |
|
38 | + } |
|
39 | 39 | |
40 | - // insert new sub-users |
|
41 | - $params = [ |
|
42 | - [ |
|
43 | - 'new_password' => '12345&Qwerty', |
|
44 | - 'member_first_name' => 'Tusha I', |
|
45 | - 'member_last_name' => 'Pupkindzes', |
|
46 | - 'member_email' => '[email protected]', |
|
47 | - 'member_type' => 'SUB_ACCOUNT_DRIVER', |
|
48 | - 'OWNER_MEMBER_ID' => $owner_member_id |
|
49 | - ], [ |
|
50 | - 'new_password' => '12345&Qwerty', |
|
51 | - 'member_first_name' => 'Tusha II', |
|
52 | - 'member_last_name' => 'Pupkindzes', |
|
53 | - 'member_email' => '[email protected]', |
|
54 | - 'member_type' => 'SUB_ACCOUNT_DRIVER', |
|
55 | - 'OWNER_MEMBER_ID' => $owner_member_id |
|
56 | - ] |
|
57 | - ]; |
|
40 | + // insert new sub-users |
|
41 | + $params = [ |
|
42 | + [ |
|
43 | + 'new_password' => '12345&Qwerty', |
|
44 | + 'member_first_name' => 'Tusha I', |
|
45 | + 'member_last_name' => 'Pupkindzes', |
|
46 | + 'member_email' => '[email protected]', |
|
47 | + 'member_type' => 'SUB_ACCOUNT_DRIVER', |
|
48 | + 'OWNER_MEMBER_ID' => $owner_member_id |
|
49 | + ], [ |
|
50 | + 'new_password' => '12345&Qwerty', |
|
51 | + 'member_first_name' => 'Tusha II', |
|
52 | + 'member_last_name' => 'Pupkindzes', |
|
53 | + 'member_email' => '[email protected]', |
|
54 | + 'member_type' => 'SUB_ACCOUNT_DRIVER', |
|
55 | + 'OWNER_MEMBER_ID' => $owner_member_id |
|
56 | + ] |
|
57 | + ]; |
|
58 | 58 | |
59 | - $options = [ |
|
60 | - 'conflicts' => 'overwrite' |
|
61 | - ]; |
|
59 | + $options = [ |
|
60 | + 'conflicts' => 'overwrite' |
|
61 | + ]; |
|
62 | 62 | |
63 | - $tm = new TeamManagement(); |
|
64 | - $res = $tm->bulkInsert($params, $options); |
|
65 | - //print_r($res); |
|
66 | - echo "Insert two sub-users." . PHP_EOL; |
|
63 | + $tm = new TeamManagement(); |
|
64 | + $res = $tm->bulkInsert($params, $options); |
|
65 | + //print_r($res); |
|
66 | + echo "Insert two sub-users." . PHP_EOL; |
|
67 | 67 | } catch (Exception | ApiError $e) { |
68 | - echo $e->getMessage() . PHP_EOL; |
|
68 | + echo $e->getMessage() . PHP_EOL; |
|
69 | 69 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | if (is_array($res_members) && isset($res_members['results'])) { |
28 | 28 | foreach ($res_members['results'] as $key => $value) { |
29 | - if ($value['OWNER_MEMBER_ID'] == 0) { |
|
29 | + if ($value['OWNER_MEMBER_ID']==0) { |
|
30 | 30 | $owner_member_id = $value['member_id']; |
31 | 31 | break; |
32 | 32 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $tm = new TeamManagement(); |
64 | 64 | $res = $tm->bulkInsert($params, $options); |
65 | 65 | //print_r($res); |
66 | - echo "Insert two sub-users." . PHP_EOL; |
|
66 | + echo "Insert two sub-users.".PHP_EOL; |
|
67 | 67 | } catch (Exception | ApiError $e) { |
68 | - echo $e->getMessage() . PHP_EOL; |
|
68 | + echo $e->getMessage().PHP_EOL; |
|
69 | 69 | } |
@@ -18,9 +18,9 @@ |
||
18 | 18 | $userId = 2567512; |
19 | 19 | |
20 | 20 | try { |
21 | - $tm = new TeamManagement(); |
|
22 | - $res = $tm->delete($userId); |
|
23 | - print_r($res); |
|
21 | + $tm = new TeamManagement(); |
|
22 | + $res = $tm->delete($userId); |
|
23 | + print_r($res); |
|
24 | 24 | } catch (ApiError $e) { |
25 | - echo 'Cannot delete user with ID: ' . $userId . PHP_EOL; |
|
25 | + echo 'Cannot delete user with ID: ' . $userId . PHP_EOL; |
|
26 | 26 | } |
@@ -22,5 +22,5 @@ |
||
22 | 22 | $res = $tm->delete($userId); |
23 | 23 | print_r($res); |
24 | 24 | } catch (ApiError $e) { |
25 | - echo 'Cannot delete user with ID: ' . $userId . PHP_EOL; |
|
25 | + echo 'Cannot delete user with ID: '.$userId.PHP_EOL; |
|
26 | 26 | } |
@@ -17,31 +17,31 @@ |
||
17 | 17 | Route4Me::setApiKey(Constants::API_KEY); |
18 | 18 | |
19 | 19 | try { |
20 | - $ab = new AddressBook(); |
|
21 | - |
|
22 | - ///////////////////////////////////////////// |
|
23 | - // update adresses in circle aria |
|
24 | - $filter = [ |
|
25 | - 'query' => "Tusha", |
|
26 | - 'bounding_box' => null, |
|
27 | - 'selected_areas' => [[ |
|
28 | - 'type' => 'circle', |
|
29 | - 'value' => [ |
|
30 | - 'center' => [ |
|
31 | - 'lat' => 38.024654, |
|
32 | - 'lng' => 77.338814 |
|
33 | - ], |
|
34 | - 'distance' => 10000 |
|
35 | - ] |
|
36 | - ]] |
|
37 | - ]; |
|
38 | - |
|
39 | - $params = [ |
|
40 | - 'last_name' => 'Grigoriani VII' |
|
41 | - ]; |
|
42 | - $res = $ab->updateAddressesByAreas($filter, $params); |
|
43 | - print_r($res); |
|
20 | + $ab = new AddressBook(); |
|
21 | + |
|
22 | + ///////////////////////////////////////////// |
|
23 | + // update adresses in circle aria |
|
24 | + $filter = [ |
|
25 | + 'query' => "Tusha", |
|
26 | + 'bounding_box' => null, |
|
27 | + 'selected_areas' => [[ |
|
28 | + 'type' => 'circle', |
|
29 | + 'value' => [ |
|
30 | + 'center' => [ |
|
31 | + 'lat' => 38.024654, |
|
32 | + 'lng' => 77.338814 |
|
33 | + ], |
|
34 | + 'distance' => 10000 |
|
35 | + ] |
|
36 | + ]] |
|
37 | + ]; |
|
38 | + |
|
39 | + $params = [ |
|
40 | + 'last_name' => 'Grigoriani VII' |
|
41 | + ]; |
|
42 | + $res = $ab->updateAddressesByAreas($filter, $params); |
|
43 | + print_r($res); |
|
44 | 44 | } catch (ApiError $e) { |
45 | - echo $e->getCode() . PHP_EOL; |
|
46 | - echo $e->getMessage() . PHP_EOL; |
|
45 | + echo $e->getCode() . PHP_EOL; |
|
46 | + echo $e->getMessage() . PHP_EOL; |
|
47 | 47 | } |
@@ -42,6 +42,6 @@ |
||
42 | 42 | $res = $ab->updateAddressesByAreas($filter, $params); |
43 | 43 | print_r($res); |
44 | 44 | } catch (ApiError $e) { |
45 | - echo $e->getCode() . PHP_EOL; |
|
46 | - echo $e->getMessage() . PHP_EOL; |
|
45 | + echo $e->getCode().PHP_EOL; |
|
46 | + echo $e->getMessage().PHP_EOL; |
|
47 | 47 | } |