@@ 130-144 (lines=15) @@ | ||
127 | return $response; |
|
128 | } |
|
129 | ||
130 | public static function createMember($params) |
|
131 | { |
|
132 | $excludeFields = array('session_guid', 'member_id', 'token', 'payload', 'webiinar_date', |
|
133 | 'company_name', 'config_key', 'config_value', 'api_key'); |
|
134 | ||
135 | $allBodyFields = Route4Me::getObjectProperties(new Member(), $excludeFields); |
|
136 | ||
137 | $response = Route4Me::makeRequst(array( |
|
138 | 'url' => Endpoint::USER_V4, |
|
139 | 'method' => 'POST', |
|
140 | 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
141 | )); |
|
142 | ||
143 | return $response; |
|
144 | } |
|
145 | ||
146 | public static function getRandomMemberByType($memberType) |
|
147 | { |
|
@@ 169-183 (lines=15) @@ | ||
166 | } |
|
167 | ||
168 | ||
169 | public static function updateMember($body) |
|
170 | { |
|
171 | $excludeFields = array('session_guid', 'token', 'payload', 'webiinar_date', |
|
172 | 'company_name', 'config_key', 'config_value', 'api_key'); |
|
173 | ||
174 | $allBodyFields = Route4Me::getObjectProperties(new Member(), $excludeFields); |
|
175 | ||
176 | $response = Route4Me::makeRequst(array( |
|
177 | 'url' => Endpoint::USER_V4, |
|
178 | 'method' => 'PUT', |
|
179 | 'body' => Route4Me::generateRequestParameters($allBodyFields, $body) |
|
180 | )); |
|
181 | ||
182 | return $response; |
|
183 | } |
|
184 | ||
185 | public static function deleteMember($body) |
|
186 | { |
@@ 68-83 (lines=16) @@ | ||
65 | return $problem; |
|
66 | } |
|
67 | ||
68 | public static function optimize(OptimizationProblemParams $params) |
|
69 | { |
|
70 | $allQueryFields = array('redirect', 'directions', 'format', 'route_path_output', 'optimized_callback_url'); |
|
71 | ||
72 | $optimize = Route4Me::makeRequst(array( |
|
73 | 'url' => Endpoint::OPTIMIZATION_PROBLEM, |
|
74 | 'method' => 'POST', |
|
75 | 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
76 | 'body' => array( |
|
77 | 'addresses' => $params->getAddressesArray(), |
|
78 | 'parameters' => $params->getParametersArray() |
|
79 | ) |
|
80 | )); |
|
81 | ||
82 | return OptimizationProblem::fromArray($optimize); |
|
83 | } |
|
84 | ||
85 | public static function get($params) |
|
86 | { |
@@ 200-214 (lines=15) @@ | ||
197 | return $response; |
|
198 | } |
|
199 | ||
200 | public static function updateOrder($params) |
|
201 | { |
|
202 | $excludeFields = array('route_id', 'redirect', 'optimization_problem_id', |
|
203 | 'order_ids', 'fields', 'offset', 'limit', 'query', 'created_timestamp'); |
|
204 | ||
205 | $allBodyFields = Route4Me::getObjectProperties(new Order(), $excludeFields); |
|
206 | ||
207 | $response = Route4Me::makeRequst(array( |
|
208 | 'url' => Endpoint::ORDER_V4, |
|
209 | 'method' => 'PUT', |
|
210 | 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
211 | )); |
|
212 | ||
213 | return $response; |
|
214 | } |
|
215 | ||
216 | public static function searchOrder($params) |
|
217 | { |