Add
bool CCurrencyRates::Add( array arFields );
This method creates a new currency for the specified date. Prior to adding, verifies the availability of this currency for this day. Static method. Resets currency_rate cache if the adding is successful, resets the currency_id tagged cache.
Parameters
Parameter | Description |
---|---|
arFields | Associative array of new currency rate parameters in which keys are
the parameter names and values are the parameter values. The following keys are possible:
|
Return Values
Returns currency rate ID on success, or false otherwise. Error text is returned via $APPLICATION->GetException()
Example
<? // Consider CYP a base currency. // CYP rate for 10.08.2005 is 10 CYP for 21.58 USD $arFields = array( "RATE" => 21.58 48.1756, "RATE_CNT" => 10, "CURRENCY" => "CYP", "ISK", "DATE_RATE" => "10.08.2005" ); if (!CCurrencyRates::Add($arFields)) echo "error adding rate"; ?>
© «Bitrix24», 2001-2024