Zend Framework
1.12
|
Public Member Functions | |
__construct ($options=null, $locale=null) | |
Creates a currency instance. | |
toCurrency ($value=null, array $options=array()) | |
Returns a localized currency string. | |
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. | |
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. | |
getShortName ($currency=null, $locale=null) | |
Returns the actual or details of other currency shortnames. | |
getName ($currency=null, $locale=null) | |
Returns the actual or details of other currency names. | |
getRegionList ($currency=null) | |
Returns a list of regions where this currency is or was known. | |
getCurrencyList ($region=null) | |
Returns a list of currencies which are used in this region a region name should be 2 charachters only (f.e. | |
toString () | |
Returns the actual currency name. | |
__toString () | |
Returns the currency name. | |
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. | |
getLocale () | |
Returns the actual set locale. | |
getValue () | |
Returns the value. | |
setValue ($value, $currency=null) | |
Adds a currency. | |
add ($value, $currency=null) | |
Adds a currency. | |
sub ($value, $currency=null) | |
Substracts a currency. | |
div ($value, $currency=null) | |
Divides a currency. | |
mul ($value, $currency=null) | |
Multiplies a currency. | |
mod ($value, $currency=null) | |
Calculates the modulo from a currency. | |
compare ($value, $currency=null) | |
Compares two currencies. | |
equals ($value, $currency=null) | |
Returns true when the two currencies are equal. | |
isMore ($value, $currency=null) | |
Returns true when the currency is more than the given value. | |
isLess ($value, $currency=null) | |
Returns true when the currency is less than the given value. | |
getService () | |
Returns the set service class. | |
setService ($service) | |
Sets a new exchange service. | |
Static Public Member Functions | |
static | getCache () |
Returns the set cache. | |
static | setCache (Zend_Cache_Core $cache) |
Sets a cache for Zend_Currency. | |
static | hasCache () |
Returns true when a cache is set. | |
static | removeCache () |
Removes any set cache. | |
static | clearCache ($tag=null) |
Clears all set cache data. | |
Public Attributes | |
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 Member Functions | |
_exchangeCurrency ($value, $currency) | |
Internal method which calculates the exchanges currency. | |
_checkOptions (array $options=array()) | |
Internal method for checking the options array. | |
Protected Attributes | |
$_options | |
__construct | ( | $options = null , |
|
$locale = null |
|||
) |
Creates a currency instance.
Every supressed parameter is used from the actual or the given locale.
string | array | $options | OPTIONAL Options array or currency short name when string is given |
string | Zend_Locale | $locale | OPTIONAL locale name |
Zend_Currency_Exception | When currency is invalid |
__toString | ( | ) |
Returns the currency name.
|
protected |
Internal method for checking the options array.
array | $options | Options to check |
Zend_Currency_Exception | On unknown position |
Zend_Currency_Exception | On unknown locale |
Zend_Currency_Exception | On unknown display |
Zend_Currency_Exception | On precision not between -1 and 30 |
Zend_Currency_Exception | On problem with script conversion |
Zend_Currency_Exception | On unknown options |
|
protected |
Internal method which calculates the exchanges currency.
float | integer | Zend_Currency | $value | Compares the currency with this value |
string | Zend_Currency | $currency | The currency to compare this value from |
add | ( | $value, | |
$currency = null |
|||
) |
Adds a currency.
float | integer | Zend_Currency | $value | Add this value to currency |
string | Zend_Currency | $currency | The currency to add |
|
static |
Clears all set cache data.
string | $tag | Tag to clear when the default tag name is not used |
compare | ( | $value, | |
$currency = null |
|||
) |
Compares two currencies.
float | integer | Zend_Currency | $value | Compares the currency with this value |
string | Zend_Currency | $currency | The currency to compare this value from |
div | ( | $value, | |
$currency = null |
|||
) |
Divides a currency.
float | integer | Zend_Currency | $value | Divides this value from currency |
string | Zend_Currency | $currency | The currency to divide |
equals | ( | $value, | |
$currency = null |
|||
) |
Returns true when the two currencies are equal.
float | integer | Zend_Currency | $value | Compares the currency with this value |
string | Zend_Currency | $currency | The currency to compare this value from |
|
static |
Returns the set cache.
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
string | $region | OPTIONAL Region to return the currencies for |
getLocale | ( | ) |
Returns the actual set locale.
getName | ( | $currency = null , |
|
$locale = null |
|||
) |
Returns the actual or details of other currency names.
string | $currency | (Optional) Currency's short name |
string | Zend_Locale | $locale | (Optional) The locale |
getRegionList | ( | $currency = null | ) |
Returns a list of regions where this currency is or was known.
string | $currency | OPTIONAL Currency's short name |
Zend_Currency_Exception | When no currency was defined |
getService | ( | ) |
Returns the set service class.
getShortName | ( | $currency = null , |
|
$locale = null |
|||
) |
Returns the actual or details of other currency shortnames.
string | $currency | OPTIONAL Currency's name |
string | Zend_Locale | $locale | OPTIONAL The locale |
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)
string | $currency | (Optional) Currency name |
string | Zend_Locale | $locale | (Optional) Locale to display informations |
getValue | ( | ) |
Returns the value.
|
static |
Returns true when a cache is set.
isLess | ( | $value, | |
$currency = null |
|||
) |
Returns true when the currency is less than the given value.
float | integer | Zend_Currency | $value | Compares the currency with this value |
string | Zend_Currency | $currency | The currency to compare this value from |
isMore | ( | $value, | |
$currency = null |
|||
) |
Returns true when the currency is more than the given value.
float | integer | Zend_Currency | $value | Compares the currency with this value |
string | Zend_Currency | $currency | The currency to compare this value from |
mod | ( | $value, | |
$currency = null |
|||
) |
Calculates the modulo from a currency.
float | integer | Zend_Currency | $value | Calculate modulo from this value |
string | Zend_Currency | $currency | The currency to calculate the modulo |
mul | ( | $value, | |
$currency = null |
|||
) |
Multiplies a currency.
float | integer | Zend_Currency | $value | Multiplies this value from currency |
string | Zend_Currency | $currency | The currency to multiply |
|
static |
Removes any set cache.
|
static |
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.
array | $options | (Optional) Options to set |
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.
string | Zend_Locale | $locale | (Optional) Locale for parsing input |
Zend_Currency_Exception | When the given locale does not exist |
setService | ( | $service | ) |
Sets a new exchange service.
string | Zend_Currency_CurrencyInterface | $service | Service class |
setValue | ( | $value, | |
$currency = null |
|||
) |
Adds a currency.
float | integer | Zend_Currency | $value | Add this value to currency |
string | Zend_Currency | $currency | The currency to add |
sub | ( | $value, | |
$currency = null |
|||
) |
Substracts a currency.
float | integer | Zend_Currency | $value | Substracts this value from currency |
string | Zend_Currency | $currency | The currency to substract |
toCurrency | ( | $value = null , |
|
array | $options = array() |
||
) |
Returns a localized currency string.
integer | float | $value | OPTIONAL Currency value |
array | $options | OPTIONAL options to set temporary |
Zend_Currency_Exception | When the value is not a number |
toString | ( | ) |
Returns the actual currency name.
|
protected |
const LEFT = 32 |
const NO_SYMBOL = 1 |
const RIGHT = 16 |
const STANDARD = 8 |
const USE_NAME = 4 |
const USE_SHORTNAME = 3 |
const USE_SYMBOL = 2 |