Public Member Functions | |
loadByCode (Mage_Directory_Model_Country $country, $code) | |
Protected Member Functions | |
_construct () |
Definition at line 28 of file Country.php.
_construct | ( | ) | [protected] |
Resource initialization
Reimplemented from Mage_Core_Model_Resource_Abstract.
Definition at line 30 of file Country.php.
00031 { 00032 $this->_init('directory/country', 'country_id'); 00033 }
loadByCode | ( | Mage_Directory_Model_Country $ | country, | |
$ | code | |||
) |
Definition at line 35 of file Country.php.
00036 { 00037 switch (strlen($code)) { 00038 case 2: 00039 $field = 'iso2_code'; 00040 break; 00041 00042 case 3: 00043 $field = 'iso3_code'; 00044 break; 00045 00046 default: 00047 Mage::throwException(Mage::helper('directory')->__('Invalid country code: %s', $code)); 00048 } 00049 $this->load($country, $code, $field); 00050 return $this; 00051 }