Documentation

Update

bool
CCurrencyRates::Update(
 int ID, 
 array arFields
);

This method replaces the parameters of a record in the exchange rate table with the values of the arFields array. Prior to updating, a verification of availability of this currency with other ID is performed. If such currency exists - an error will occur. Static method.

In case of successful update, resets currency_rate cache and currency_id tagged cache.

Parameters

ParameterDescription
ID The record ID.
arFieldsAssociative array of new parameters of the currency rate in which keys are the parameter names and values are the parameter values.

The following keys are possible:
  • CURRENCY - the currency ID (required);
  • DATE_RATE - the date WITHOUT TIME for which the rate of exchange is set (required);
  • RATE_CNT - the number of currency units used to define the rate of exchange (for example, if CYP 10 equal to USD 21.58, 10 is the number of currency units);
  • RATE - the rate of exchange.

Return Values

Returns the ID of the modified currency rate on success, or false otherwise. Error text is returned via $APPLICATION->GetException().

© «Bitrix24», 2001-2024
Up