@@ 69-87 (lines=19) @@ | ||
66 | return $avoidanceZones; |
|
67 | } |
|
68 | ||
69 | public static function addAvoidanceZone($params) |
|
70 | { |
|
71 | $terParams = array(); |
|
72 | ||
73 | if (isset($params->territory['type'])) $terParams['type'] = $params->territory['type']; |
|
74 | if (isset($params->territory['data'])) $terParams['data'] = $params->territory['data']; |
|
75 | ||
76 | $abContacts = Route4Me::makeRequst(array( |
|
77 | 'url' => Endpoint::AVOIDANCE_ZONE, |
|
78 | 'method' => 'POST', |
|
79 | 'body' => array( |
|
80 | 'territory_name' => isset($params->territory_name) ? $params->territory_name : null, |
|
81 | 'territory_color' => isset($params->territory_color) ? $params->territory_color : null, |
|
82 | 'territory' => $terParams |
|
83 | ) |
|
84 | )); |
|
85 | ||
86 | return $abContacts; |
|
87 | } |
|
88 | ||
89 | public function deleteAvoidanceZone($territory_id) |
|
90 | { |
@@ 70-88 (lines=19) @@ | ||
67 | return $response; |
|
68 | } |
|
69 | ||
70 | public static function addTerritory($params) |
|
71 | { |
|
72 | $terParams = array(); |
|
73 | ||
74 | if (isset($params->territory['type'])) $terParams['type'] = $params->territory['type']; |
|
75 | if (isset($params->territory['data'])) $terParams['data'] = $params->territory['data']; |
|
76 | ||
77 | $response = Route4Me::makeRequst(array( |
|
78 | 'url' => Endpoint::TERRITORY_V4, |
|
79 | 'method' => 'ADD', |
|
80 | 'query' => array( |
|
81 | 'territory_name' => isset($params->territory_name) ? $params->territory_name : null, |
|
82 | 'territory_color' => isset($params->territory_color) ? $params->territory_color : null, |
|
83 | 'territory' => $terParams |
|
84 | ) |
|
85 | )); |
|
86 | ||
87 | return $response; |
|
88 | } |
|
89 | ||
90 | public function deleteTerritory($territory_id) |
|
91 | { |