Class luya\web\jsonld\CurrencyValue

Inheritanceluya\web\jsonld\CurrencyValue » luya\web\jsonld\BaseValue
Available since version1.0.14
Source Code https://github.com/luyadev/luya/blob/master/core/web/jsonld/CurrencyValue.php

The currency accepted.

Use standard formats: ISO 4217 currency format e.g. "USD"; Ticker symbol for cryptocurrencies e.g. "BTC"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. "Ithaca HOUR".

Method Details

Hide inherited methods

__construct() public method

public void __construct ( $currency )
$currency

                public function __construct($currency)
{
    if (strlen($currency) !== 3) {
        throw new InvalidConfigException("The currency value must have 3 letter code like USD, CHF. Value \"{$currency}\" given.");
    }
    
    $this->_currency = $currency;
}

            
getValue() public method

public void getValue ( )

                public function getValue()
{
    return strtoupper($this->_currency);
}