Mage_Directory_Model_Mysql4_Country Class Reference

Inheritance diagram for Mage_Directory_Model_Mysql4_Country:

Mage_Core_Model_Mysql4_Abstract Mage_Core_Model_Resource_Abstract

List of all members.

Public Member Functions

 loadByCode (Mage_Directory_Model_Country $country, $code)

Protected Member Functions

 _construct ()


Detailed Description

Definition at line 28 of file Country.php.


Member Function Documentation

_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     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:07 2009 for Magento by  doxygen 1.5.8