|
| toCurrency ($value=null, array $options=[]) |
|
| setFormat (array $options=[]) |
|
| getSymbol ($currency=null, $locale=null) |
|
| getShortName ($currency=null, $locale=null) |
|
| getName ($currency=null, $locale=null) |
|
| getRegionList ($currency=null) |
|
| getCurrencyList ($region=null) |
|
| toString () |
|
| setLocale ($locale=null) |
|
| getLocale () |
|
| getValue () |
|
| setValue ($value, $currency=null) |
|
| add ($value, $currency=null) |
|
| sub ($value, $currency=null) |
|
| div ($value, $currency=null) |
|
| mul ($value, $currency=null) |
|
| mod ($value, $currency=null) |
|
| compare ($value, $currency=null) |
|
| equals ($value, $currency=null) |
|
| isMore ($value, $currency=null) |
|
| isLess ($value, $currency=null) |
|
@api
- Since
- 100.0.2
Definition at line 12 of file CurrencyInterface.php.
◆ add()
add |
( |
|
$value, |
|
|
|
$currency = null |
|
) |
| |
Adds a currency
- Parameters
-
float | integer | \Magento\Framework\CurrencyInterface | $value | Add this value to currency |
string | \Magento\Framework\CurrencyInterface | $currency | The currency to add |
- Returns
- \Magento\Framework\CurrencyInterface
◆ clearCache()
static clearCache |
( |
|
$tag = null | ) |
|
|
static |
Clears all set cache data
- Parameters
-
string | $tag | Tag to clear when the default tag name is not used |
- Returns
- void
◆ compare()
compare |
( |
|
$value, |
|
|
|
$currency = null |
|
) |
| |
Compares two currencies
- Parameters
-
float | integer | \Magento\Framework\CurrencyInterface | $value | Compares the currency with this value |
string | \Magento\Framework\CurrencyInterface | $currency | The currency to compare this value from |
- Returns
- \Magento\Framework\CurrencyInterface
◆ div()
div |
( |
|
$value, |
|
|
|
$currency = null |
|
) |
| |
Divides a currency
- Parameters
-
float | integer | \Magento\Framework\CurrencyInterface | $value | Divides this value from currency |
string | \Magento\Framework\CurrencyInterface | $currency | The currency to divide |
- Returns
- \Magento\Framework\CurrencyInterface
◆ equals()
equals |
( |
|
$value, |
|
|
|
$currency = null |
|
) |
| |
Returns true when the two currencies are equal
- Parameters
-
float | integer | \Magento\Framework\CurrencyInterface | $value | Compares the currency with this value |
string | \Magento\Framework\CurrencyInterface | $currency | The currency to compare this value from |
- Returns
- boolean
◆ getCache()
Returns the set cache
- Returns
- \Zend_Cache_Core The set cache
◆ getCurrencyList()
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 | $region | OPTIONAL Region to return the currencies for |
- Returns
- array List of currencies
◆ getLocale()
Returns the actual set locale
- Returns
- string
◆ getName()
getName |
( |
|
$currency = null , |
|
|
|
$locale = null |
|
) |
| |
Returns the actual or details of other currency names
- Parameters
-
string | $currency | (Optional) Currency's short name |
string | $locale | (Optional) The locale |
- Returns
- string
◆ getRegionList()
getRegionList |
( |
|
$currency = null | ) |
|
Returns a list of regions where this currency is or was known
- Parameters
-
string | $currency | OPTIONAL Currency's short name |
- Exceptions
-
◆ getShortName()
getShortName |
( |
|
$currency = null , |
|
|
|
$locale = null |
|
) |
| |
Returns the actual or details of other currency shortnames
- Parameters
-
string | $currency | OPTIONAL Currency's name |
string | $locale | OPTIONAL The locale |
- Returns
- string
◆ getSymbol()
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 | $locale | (Optional) Locale to display informations |
- Returns
- string
◆ getValue()
Returns the value
- Returns
- float
◆ hasCache()
Returns true when a cache is set
- Returns
- boolean
◆ isLess()
isLess |
( |
|
$value, |
|
|
|
$currency = null |
|
) |
| |
Returns true when the currency is less than the given value
- Parameters
-
float | integer | \Magento\Framework\CurrencyInterface | $value | Compares the currency with this value |
string | \Magento\Framework\CurrencyInterface | $currency | The currency to compare this value from |
- Returns
- boolean
◆ isMore()
isMore |
( |
|
$value, |
|
|
|
$currency = null |
|
) |
| |
Returns true when the currency is more than the given value
- Parameters
-
float | integer | \Magento\Framework\CurrencyInterface | $value | Compares the currency with this value |
string | \Magento\Framework\CurrencyInterface | $currency | The currency to compare this value from |
- Returns
- boolean
◆ mod()
mod |
( |
|
$value, |
|
|
|
$currency = null |
|
) |
| |
Calculates the modulo from a currency
- Parameters
-
float | integer | \Magento\Framework\CurrencyInterface | $value | Calculate modulo from this value |
string | \Magento\Framework\CurrencyInterface | $currency | The currency to calculate the modulo |
- Returns
- \Magento\Framework\CurrencyInterface
◆ mul()
mul |
( |
|
$value, |
|
|
|
$currency = null |
|
) |
| |
Multiplies a currency
- Parameters
-
float | integer | \Magento\Framework\CurrencyInterface | $value | Multiplies this value from currency |
string | \Magento\Framework\CurrencyInterface | $currency | The currency to multiply |
- Returns
- \Magento\Framework\CurrencyInterface
◆ removeCache()
Removes any set cache
- Returns
- void
◆ setCache()
Sets a cache for \Magento\Framework\Currency
- Parameters
-
\Zend_Cache_Core | $cache | Cache to set |
- Returns
- void
◆ setFormat()
setFormat |
( |
array |
$options = [] | ) |
|
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
- \Magento\Framework\CurrencyInterface
◆ setLocale()
setLocale |
( |
|
$locale = null | ) |
|
Sets a new locale for data retrievement 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 | $locale | (Optional) Locale for parsing input |
- Exceptions
-
◆ setValue()
setValue |
( |
|
$value, |
|
|
|
$currency = null |
|
) |
| |
Adds a currency
- Parameters
-
float | integer | \Magento\Framework\CurrencyInterface | $value | Add this value to currency |
string | \Magento\Framework\CurrencyInterface | $currency | The currency to add |
- Returns
- \Magento\Framework\CurrencyInterface
◆ sub()
sub |
( |
|
$value, |
|
|
|
$currency = null |
|
) |
| |
Substracts a currency
- Parameters
-
float | integer | \Magento\Framework\CurrencyInterface | $value | Substracts this value from currency |
string | \Magento\Framework\CurrencyInterface | $currency | The currency to substract |
- Returns
- \Magento\Framework\CurrencyInterface
◆ toCurrency()
toCurrency |
( |
|
$value = null , |
|
|
array |
$options = [] |
|
) |
| |
Returns a localized currency string
- Parameters
-
integer | float | $value | OPTIONAL Currency value |
array | $options | OPTIONAL options to set temporary |
- Exceptions
-
◆ toString()
Returns the actual currency name
- Returns
- string
The documentation for this interface was generated from the following file: