1 | <?php |
||
20 | class TaxZones extends Base |
||
21 | { |
||
22 | /** |
||
23 | * Export taxZones. |
||
24 | * |
||
25 | * @param TaxZoneModel[] $taxZones |
||
26 | * |
||
27 | * @return array |
||
28 | */ |
||
29 | public function export(array $taxZones = []) |
||
45 | |||
46 | /** |
||
47 | * Get tax zones definition. |
||
48 | * |
||
49 | * @param Commerce_TaxZoneModel $taxZone |
||
50 | * |
||
51 | * @return array |
||
52 | */ |
||
53 | private function getTaxZoneDefinition(Commerce_TaxZoneModel $taxZone) |
||
64 | |||
65 | /** |
||
66 | * Get country definitions. |
||
67 | * |
||
68 | * @param Commerce_CountryModel[] $countries |
||
69 | * |
||
70 | * @return array |
||
71 | */ |
||
72 | private function getCountryDefinitions(array $countries) |
||
82 | |||
83 | /** |
||
84 | * Get state definitions. |
||
85 | * |
||
86 | * @param Commerce_StateModel[] $states |
||
87 | * |
||
88 | * @return array |
||
89 | */ |
||
90 | private function getStateDefinitions(array $states) |
||
100 | |||
101 | /** |
||
102 | * Attempt to import tax zones. |
||
103 | * |
||
104 | * @param array $taxZoneDefinitions |
||
105 | * @param bool $force If set to true tax zones not included in the import will be deleted |
||
106 | * |
||
107 | * @return Result |
||
108 | */ |
||
109 | public function import(array $taxZoneDefinitions, $force = false) |
||
146 | |||
147 | /** |
||
148 | * Populate taxZone. |
||
149 | * |
||
150 | * @param Commerce_TaxZoneModel $taxZone |
||
151 | * @param array $taxZoneDefinition |
||
152 | * @param string $taxZoneHandle |
||
153 | */ |
||
154 | private function populateTaxZone(Commerce_TaxZoneModel $taxZone, array $taxZoneDefinition, $taxZoneHandle) |
||
175 | |||
176 | /** |
||
177 | * Get country ids. |
||
178 | * |
||
179 | * @param Commerce_TaxZoneModel $taxZone |
||
180 | * |
||
181 | * @return array |
||
182 | */ |
||
183 | private function getCountryIds(Commerce_TaxZoneModel $taxZone) |
||
192 | |||
193 | /** |
||
194 | * Get state ids. |
||
195 | * |
||
196 | * @param Commerce_TaxZoneModel $taxZone |
||
197 | * |
||
198 | * @return array |
||
199 | */ |
||
200 | private function getStateIds(Commerce_TaxZoneModel $taxZone) |
||
209 | } |
||
210 |