Documentation

Update

bool
CCurrency::Update(
 string currency, 
 array arFields
);

The Update method replaces parameters of the currency with those specified in the arFields array. Language-dependent parameters (name, format and other) are updated separately, via the CCurrencyLang class. Non-static method.

Refreshes cache of currency_currency_list and currency_base_currency in case of a successful update (only if the database received a request). Also, a tagged cache currency_id_CURRENCY_CODE is refreshed as well.

Method parameters    

ParameterDescription
currency The ID of the currency which parameters are to be modified.
arFields Array of the new currency parameters.
  • CURRENCY - the three character currency code (required). It must match with currency code of the modified currency;
  • AMOUNT_CNT - the number of currency units used by default to define the rate of exchange (for example, if CYP 10 equal to USD 21.58, 10 is the number of currency units);
  • AMOUNT - the default rate of exchange. (One of currencies within a site must equal to 1. Such currency is called a base currency. Other currencies are defined relative to the base currency;)
  • SORT - sorting order;
  • BASE - (Y/N) flag, defines if this currency is the base currency;
  • MODIFIED_BY - ID of the last user, who modified currency.
  • If there no fields in the array, then there are no requests to the database, but the currency code will be returned.

Returned values

ID of the currency whose parameters have been modified on success, or false otherwise (text is received via $APPLICATION->GetException()).

© «Bitrix24», 2001-2024