Mage_GoogleBase_Model_Config Class Reference

Inheritance diagram for Mage_GoogleBase_Model_Config:

Varien_Object

List of all members.

Public Member Functions

 getConfigData ($key, $storeId=null)
 getAccountLogin ($storeId=null)
 getAccountPassword ($storeId=null)
 getTargetCountryInfo ($storeId=null)
 getTargetCountry ($storeId=null)
 getTargetCurrency ($storeId=null)
 isValidBaseCurrencyCode ($storeId=null)
 getDefaultItemType ($storeId=null)
 getAllowedCountries ($storeId=null)
 getCountryInfo ($iso, $field=null, $storeId=null)


Detailed Description

Definition at line 34 of file Config.php.


Member Function Documentation

getAccountLogin ( storeId = null  ) 

Google Account login

Parameters:
int $storeId
Returns:
string

Definition at line 58 of file Config.php.

00059     {
00060         return $this->getConfigData('login', $storeId);
00061     }

getAccountPassword ( storeId = null  ) 

Google Account password

Parameters:
int $storeId
Returns:
string

Definition at line 69 of file Config.php.

00070     {
00071         return $this->getConfigData('password', $storeId);
00072     }

getAllowedCountries ( storeId = null  ) 

Google Base supported countries

Parameters:
int $storeId
Returns:
array

Definition at line 137 of file Config.php.

00138     {
00139         return $this->getConfigData('allowed_countries', $storeId);
00140     }

getConfigData ( key,
storeId = null 
)

Return config var

Parameters:
string $key Var path key
int $storeId Store View Id
Returns:
mixed

Definition at line 43 of file Config.php.

00044     {
00045         if (!$this->hasData($key)) {
00046             $value = Mage::getStoreConfig('google/googlebase/' . $key, $storeId);
00047             $this->setData($key, $value);
00048         }
00049         return $this->getData($key);
00050     }

getCountryInfo ( iso,
field = null,
storeId = null 
)

Country info such as name, locale, language etc.

Parameters:
string $iso two-letters country ISO code
string $field If specified, return value for field
int $storeId
Returns:
array|string

Definition at line 150 of file Config.php.

00151     {
00152         $countries = $this->getAllowedCountries($storeId);
00153         $country = isset($countries[$iso]) ? $countries[$iso] : null;
00154         return is_null($field) ? $country : ( isset($country[$field]) ? $country[$field] : null );
00155     }

getDefaultItemType ( storeId = null  ) 

Default Item Type for country

Parameters:
int $storeId
Returns:
string

Definition at line 125 of file Config.php.

00126     {
00127         $country = $this->getTargetCountry($storeId);
00128         return $this->getCountryInfo($country, 'default_item_type');
00129     }

getTargetCountry ( storeId = null  ) 

Google Account target country

Parameters:
int $storeId
Returns:
string Two-letters country ISO code

Definition at line 91 of file Config.php.

00092     {
00093         return $this->getConfigData('target_country', $storeId);
00094     }

getTargetCountryInfo ( storeId = null  ) 

Google Account target country info

Parameters:
int $storeId
Returns:
array

Definition at line 80 of file Config.php.

00081     {
00082         return $this->getCountryInfo($this->getTargetCountry($storeId), null, $storeId);
00083     }

getTargetCurrency ( storeId = null  ) 

Google Account target currency (for target country)

Parameters:
int $storeId
Returns:
string Three-letters currency ISO code

Definition at line 102 of file Config.php.

00103     {
00104         $country = $this->getTargetCountry($storeId);
00105         return $this->getCountryInfo($country, 'currency');
00106     }

isValidBaseCurrencyCode ( storeId = null  ) 

Check whether System Base currency equals Google Base target currency or not

Parameters:
int $storeId
Returns:
boolean

Definition at line 114 of file Config.php.

00115     {
00116         return Mage::app()->getStore($storeId)->getBaseCurrencyCode() == $this->getTargetCurrency($storeId);
00117     }


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

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