Public Member Functions | Static Public Member Functions | Data Fields | Protected Attributes

Zend_Currency Class Reference

Public Member Functions

 __construct ($currency=null, $locale=null)
 toCurrency ($value, array $options=array())
 setFormat (array $options=array())
 getSymbol ($currency=null, $locale=null)
 getShortName ($currency=null, $locale=null)
 getName ($currency=null, $locale=null)
 getRegionList ($currency=null)
 getCurrencyList ($region=null)
 toString ()
 __toString ()
 setLocale ($locale=null)
 getLocale ()

Static Public Member Functions

static getCache ()
static setCache (Zend_Cache_Core $cache)
static hasCache ()
static removeCache ()
static clearCache ()

Data Fields

const NO_SYMBOL = 1
const USE_SYMBOL = 2
const USE_SHORTNAME = 3
const USE_NAME = 4
const STANDARD = 8
const RIGHT = 16
const LEFT = 32

Protected Attributes

 $_options

Detailed Description

Definition at line 37 of file Currency.php.


Constructor & Destructor Documentation

__construct ( currency = null,
locale = null 
)

Creates a currency instance. Every supressed parameter is used from the actual or the given locale.

Parameters:
string$currencyOPTIONAL currency short name
string | Zend_Locale$localeOPTIONAL locale name
Exceptions:
Zend_Currency_ExceptionWhen currency is invalid

Definition at line 91 of file Currency.php.


Member Function Documentation

__toString (  )

Returns the currency name

Returns:
string

Definition at line 441 of file Currency.php.

static clearCache (  ) [static]

Clears all set cache data

Returns:
void

Definition at line 493 of file Currency.php.

static getCache (  ) [static]

Returns the set cache

Returns:
Zend_Cache_Core The set cache

Definition at line 451 of file Currency.php.

getCurrencyList ( region = null )

Returns a list of currencies which are used in this region a region name should be 2 charachters only (f.e. EG, DE, US) If no region is given, the actual region is used

Parameters:
string$regionOPTIONAL Region to return the currencies for
Returns:
array List of currencies

Definition at line 415 of file Currency.php.

getLocale (  )

Returns the actual set locale

Returns:
string

Definition at line 530 of file Currency.php.

getName ( currency = null,
locale = null 
)

Returns the actual or details of other currency names

Parameters:
string$currency(Optional) Currency's short name
string | Zend_Locale$locale(Optional) The locale
Returns:
string

Definition at line 362 of file Currency.php.

getRegionList ( currency = null )

Returns a list of regions where this currency is or was known

Parameters:
string$currencyOPTIONAL Currency's short name
Exceptions:
Zend_Currency_ExceptionWhen no currency was defined
Returns:
array List of regions

Definition at line 390 of file Currency.php.

getShortName ( currency = null,
locale = null 
)

Returns the actual or details of other currency shortnames

Parameters:
string$currencyOPTIONAL Currency's name
string | Zend_Locale$localeOPTIONAL The locale
Returns:
string

Definition at line 327 of file Currency.php.

getSymbol ( currency = null,
locale = null 
)

Returns the actual or details of other currency symbols, when no symbol is available it returns the currency shortname (f.e. FIM for Finnian Mark)

Parameters:
string$currency(Optional) Currency name
string | Zend_Locale$locale(Optional) Locale to display informations
Returns:
string

Definition at line 299 of file Currency.php.

static hasCache (  ) [static]

Returns true when a cache is set

Returns:
boolean

Definition at line 473 of file Currency.php.

static removeCache (  ) [static]

Removes any set cache

Returns:
void

Definition at line 483 of file Currency.php.

static setCache ( Zend_Cache_Core cache ) [static]

Sets a cache for Zend_Currency

Parameters:
Zend_Cache_Core$cacheCache to set
Returns:
void

Definition at line 463 of file Currency.php.

setFormat ( array $  options = array() )

Sets the formating options of the localized currency string If no parameter is passed, the standard setting of the actual set locale will be used

Parameters:
array$options(Optional) Options to set
Returns:
Zend_Currency

Definition at line 248 of file Currency.php.

setLocale ( locale = null )

Sets a new locale for data retreivement Example: 'de_XX' will be set to 'de' because 'de_XX' does not exist 'xx_YY' will be set to 'root' because 'xx' does not exist

Parameters:
string | Zend_Locale$locale(Optional) Locale for parsing input
Exceptions:
Zend_Currency_ExceptionWhen the given locale does not exist
Returns:
Zend_Currency Provides fluent interface

Definition at line 507 of file Currency.php.

toCurrency ( value,
array $  options = array() 
)

Returns a localized currency string

Parameters:
integer | float$valueCurrency value
array$optionsOPTIONAL options to set temporary
Exceptions:
Zend_Currency_ExceptionWhen the value is not a number
Returns:
string

Definition at line 128 of file Currency.php.

toString (  )

Returns the actual currency name

Returns:
string

Definition at line 431 of file Currency.php.


Field Documentation

$_options [protected]
Initial value:
 array(
        'position'  => self::STANDARD,
        'script'    => null,
        'format'    => null,
        'display'   => self::NO_SYMBOL,
        'precision' => 2,
        'name'      => null,
        'currency'  => null,
        'symbol'    => null
    )

Definition at line 73 of file Currency.php.


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