src/Forms/MoneyField.php
public function setAllowedCurrencies($currencies)
    {
        if (empty($currencies)) {
            $currencies = [];
        } elseif (is_string($currencies)) {
            $currencies = [
                $currencies => $currencies
            ];
        } elseif (!is_array($currencies)) {
            throw new InvalidArgumentException("Invalid currency list");
        } elseif (!ArrayLib::is_associative($currencies)) {
            $currencies = array_combine($currencies, $currencies);
        }

        $this->allowedCurrencies = $currencies;

        // Rebuild currency field
        $this->buildCurrencyField();
        return $this;
    }
public function setAllowedCurrencies($currencies)
    {
        if (empty($currencies)) {
            $currencies = [];
        } elseif (is_string($currencies)) {
            $currencies = [
                $currencies => $currencies
            ];
        } elseif (!is_array($currencies)) {
            throw new InvalidArgumentException("Invalid currency list");
        } elseif (!ArrayLib::is_associative($currencies)) {
            $currencies = array_combine($currencies, $currencies);
        }

        $this->allowedCurrencies = $currencies;

        // Rebuild currency field
        $this->buildCurrencyField();
        return $this;
    }
public function setAllowedCurrencies ( $ currencies ) { if ( empty ( $ currencies ) ) { $ currencies = [ ] ; } elseif ( is_string ( $ currencies ) ) { $ currencies = [ $ currencies => $ currencies ] ; } elseif ( ! is_array ( $ currencies ) ) { throw new InvalidArgumentException ( "Invalid currency list" ) ; } elseif ( ! ArrayLib :: is_associative ( $ currencies ) ) { $ currencies = array_combine ( $ currencies , $ currencies ) ; } $ this -> allowedCurrencies = $ currencies ; // Rebuild currency field $ this -> buildCurrencyField ( ) ; return $ this ; }
Set list of currencies. Currencies should be in the 3-letter ISO 4217 currency code.

@param array $currencies
@return $this
Set list of currencies . Currencies should be in the 3 - letter ISO 4217 currency code .