Public Member Functions | |
items ($country) |
Definition at line 34 of file Api.php.
items | ( | $ | country | ) |
Retrieve regions list
string | $country |
Definition at line 42 of file Api.php.
00043 { 00044 try { 00045 $country = Mage::getModel('directory/country')->loadByCode($country); 00046 } catch (Mage_Core_Exception $e) { 00047 $this->_fault('country_not_exists', $e->getMessage()); 00048 } 00049 00050 if (!$country->getId()) { 00051 $this->_fault('country_not_exists'); 00052 } 00053 00054 $result = array(); 00055 foreach ($country->getRegions() as $region) { 00056 $region->getName(); 00057 $result[] = $region->toArray(array('region_id', 'code', 'name')); 00058 } 00059 00060 return $result; 00061 }