Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Class for handling currency notations
NO_SYMBOL = '1'
USE_SYMBOL = '2'
USE_SHORTNAME = '3'
USE_NAME = '4'
STANDARD = '8'
RIGHT = '16'
LEFT = '32'
array $_options = 'array'
Options array
The following options are available 'position' => Position for the currency sign 'script' => Script for the output 'format' => Locale for numeric output 'display' => Currency detail to show 'precision' => Precision for the currency 'name' => Name for this currency 'currency' => 3 lettered international abbreviation 'symbol' => Currency symbol 'locale' => Locale for this currency 'value' => Money value 'service' => Exchange service to use
__construct(
string|array $options
=
null, string|Zend_Locale $locale
=
null
)
:
Creates a currency instance. Every supressed parameter is used from the actual or the given locale.
__toString(
)
:
string
Returns the currency name
_checkOptions(
array $options
=
array
)
:
array
Internal method for checking the options array
_checkParams(
string $currency
=
null, string|Zend_Locale $locale
=
null
)
:
string
Internal function for checking static given locale parameter
_exchangeCurrency(
float|integer|Zend_Currency $value, string|Zend_Currency $currency
)
:
unknown
Internal method which calculates the exchanges currency
_extractPattern(
string $pattern, float|integer $value
)
:
string
Internal method to extract the currency pattern when a choice is given based on the given value
add(
float|integer|Zend_Currency $value, string|Zend_Currency $currency
=
null
)
:
Zend_Currency
Adds a currency
clearCache(
)
:
void
Clears all set cache data
compare(
float|integer|Zend_Currency $value, string|Zend_Currency $currency
=
null
)
:
Zend_Currency
Compares two currencies
div(
float|integer|Zend_Currency $value, string|Zend_Currency $currency
=
null
)
:
Zend_Currency
Divides a currency
equals(
float|integer|Zend_Currency $value, string|Zend_Currency $currency
=
null
)
:
boolean
Returns true when the two currencies are equal
getCache(
)
:
Zend_Cache_Core
Returns the set cache
getCurrencyList(
string $region
=
null
)
:
array
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
getLocale(
)
:
string
Returns the actual set locale
getName(
string $currency
=
null, string|Zend_Locale $locale
=
null
)
:
string
Returns the actual or details of other currency names
getRegionList(
string $currency
=
null
)
:
array
Returns a list of regions where this currency is or was known
getService(
)
:
Zend_Service
Returns the set service class
getShortName(
string $currency
=
null, string|Zend_Locale $locale
=
null
)
:
string
Returns the actual or details of other currency shortnames
getSymbol(
string $currency
=
null, string|Zend_Locale $locale
=
null
)
:
string
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)
getValue(
)
:
float
Returns the value
hasCache(
)
:
boolean
Returns true when a cache is set
isLess(
float|integer|Zend_Currency $value, string|Zend_Currency $currency
=
null
)
:
boolean
Returns true when the currency is less than the given value
isMore(
float|integer|Zend_Currency $value, string|Zend_Currency $currency
=
null
)
:
boolean
Returns true when the currency is more than the given value
mod(
float|integer|Zend_Currency $value, string|Zend_Currency $currency
=
null
)
:
Zend_Currency
Calculates the modulo from a currency
mul(
float|integer|Zend_Currency $value, string|Zend_Currency $currency
=
null
)
:
Zend_Currency
Multiplies a currency
removeCache(
)
:
void
Removes any set cache
setCache(
Zend_Cache_Core $cache
)
:
void
Sets a cache for Zend_Currency
setFormat(
array $options
=
array
)
:
Zend_Currency
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
setLocale(
string|Zend_Locale $locale
=
null
)
:
Zend_Currency
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
setService(
string|Zend_Currency_CurrencyInterface $service
)
:
Zend_Currency
Sets a new exchange service
setValue(
float|integer|Zend_Currency $value, string|Zend_Currency $currency
=
null
)
:
Zend_Currency
Adds a currency
sub(
float|integer|Zend_Currency $value, string|Zend_Currency $currency
=
null
)
:
Zend_Currency
Substracts a currency
toCurrency(
integer|float $value
=
null, array $options
=
array
)
:
string
Returns a localized currency string
toString(
)
:
string
Returns the actual currency name