Class Mage_Directory_Model_Currency

Description

Currency model

Located in /Directory/Model/Currency.php (line 34)

Varien_Object
   |
   --Mage_Core_Model_Abstract
      |
      --Mage_Directory_Model_Currency
Class Constant Summary
XML_PATH_CURRENCY_ALLOW = 'currency/options/allow'
XML_PATH_CURRENCY_BASE = 'currency/options/base'
XML_PATH_CURRENCY_DEFAULT = 'currency/options/default'
Variable Summary
mixed $_filter
array $_rates
Method Summary
double convert (double $price, [string $toCurrency = null])
string format (double $price, [ $options = array()], [bool $includeContainer = true], [ $addBrackets = false])
string formatPrecision (float $price, int $precision, [array $options = array()], [bool $includeContainer = true], [bool $addBrackets = false])
void formatTxt ( $price, [ $options = array()])
double getAnyRate (string $toCurrency)
string getCode ()
void getCurrencyCode ()
array getCurrencyRates (string $currency, [array $toCurrencies = null])
void getOutputFormat ()
double getRate (string $toCurrency)
array getRates ()
Mage_Directory_Model_Currency load (string $id, [string $field = null])
object saveRates (array $rates)
void _construct ()
Variables
Methods
convert (line 162)

Convert price to currency format

  • access: public
double convert (double $price, [string $toCurrency = null])
  • double $price
  • string $toCurrency
format (line 195)

Format price to currency format

  • access: public
string format (double $price, [ $options = array()], [bool $includeContainer = true], [ $addBrackets = false])
  • double $price
  • bool $includeContainer
  • $options
  • $addBrackets
formatPrecision (line 210)

Apply currency format to number with specific rounding precision

  • access: public
string formatPrecision (float $price, int $precision, [array $options = array()], [bool $includeContainer = true], [bool $addBrackets = false])
  • float $price
  • int $precision
  • array $options
  • bool $includeContainer
  • bool $addBrackets
formatTxt (line 221)
  • access: public
void formatTxt ( $price, [ $options = array()])
  • $price
  • $options
getAnyRate (line 138)

Get currency rate (base=>allowed or allowed=>base)

  • access: public
double getAnyRate (string $toCurrency)
  • string $toCurrency
getCode (line 63)

Get currency code

  • access: public
string getCode ()
getConfigAllowCurrencies (line 247)

Retrieve allowed currencies according to config

  • access: public
void getConfigAllowCurrencies ()
getConfigBaseCurrencies (line 275)
  • access: public
void getConfigBaseCurrencies ()
getConfigDefaultCurrencies (line 268)

Retrieve default currencies according to config

  • access: public
void getConfigDefaultCurrencies ()
getCurrencyCode (line 68)
  • access: public
void getCurrencyCode ()
getCurrencyRates (line 288)

Retrieve currency rates to other currencies

  • access: public
array getCurrencyRates (string $currency, [array $toCurrencies = null])
  • string $currency
  • array $toCurrencies
getFilter (line 179)

Get currency filter

  • access: public
getOutputFormat (line 236)
  • access: public
void getOutputFormat ()
getRate (line 115)

Get currency rate (only base=>allowed)

  • access: public
double getRate (string $toCurrency)
  • string $toCurrency
getRates (line 78)

Currency Rates getter

  • access: public
array getRates ()
load (line 102)

Loading currency data

  • access: public
Mage_Directory_Model_Currency load (string $id, [string $field = null])
  • string $id
  • string $field

Redefinition of:
Mage_Core_Model_Abstract::load()
Load object data
saveRates (line 303)

Save currency rates

  • access: public
object saveRates (array $rates)
  • array $rates
setRates (line 89)

Currency Rates setter

  • access: public
Mage_Directory_Model_Currency setRates ( $rates)
  • array $rates: Currency Rates
_construct (line 53)
  • access: protected
void _construct ()

Inherited Methods

Inherited From Mage_Core_Model_Abstract

Mage_Core_Model_Abstract::afterCommitCallback()
Mage_Core_Model_Abstract::afterLoad()
Mage_Core_Model_Abstract::cleanModelCache()
Mage_Core_Model_Abstract::clearInstance()
Mage_Core_Model_Abstract::delete()
Mage_Core_Model_Abstract::getCacheIdTags()
Mage_Core_Model_Abstract::getCacheTags()
Mage_Core_Model_Abstract::getCollection()
Mage_Core_Model_Abstract::getEntityId()
Mage_Core_Model_Abstract::getId()
Mage_Core_Model_Abstract::getIdFieldName()
Mage_Core_Model_Abstract::getResource()
Mage_Core_Model_Abstract::getResourceCollection()
Mage_Core_Model_Abstract::getResourceName()
Mage_Core_Model_Abstract::isObjectNew()
Mage_Core_Model_Abstract::load()
Mage_Core_Model_Abstract::save()
Mage_Core_Model_Abstract::setId()
Mage_Core_Model_Abstract::_afterDelete()
Mage_Core_Model_Abstract::_afterDeleteCommit()
Mage_Core_Model_Abstract::_afterLoad()
Mage_Core_Model_Abstract::_afterSave()
Mage_Core_Model_Abstract::_afterSaveCommit()
Mage_Core_Model_Abstract::_beforeDelete()
Mage_Core_Model_Abstract::_beforeLoad()
Mage_Core_Model_Abstract::_beforeSave()
Mage_Core_Model_Abstract::_clearData()
Mage_Core_Model_Abstract::_clearReferences()
Mage_Core_Model_Abstract::_getEventData()
Mage_Core_Model_Abstract::_getResource()
Mage_Core_Model_Abstract::_hasModelChanged()
Mage_Core_Model_Abstract::_init()
Mage_Core_Model_Abstract::_protectFromNonAdmin()
Mage_Core_Model_Abstract::_setResourceModel()
Class Constants
XML_PATH_CURRENCY_ALLOW = 'currency/options/allow' (line 39)

CONFIG path constants

XML_PATH_CURRENCY_BASE = 'currency/options/base' (line 41)
XML_PATH_CURRENCY_DEFAULT = 'currency/options/default' (line 40)

Documentation generated on Fri, 11 Feb 2011 17:00:09 +0200 by phpDocumentor 1.4.3