Bitrix Site Manager

CSaleUserAccount::GetByUserID

array
CSaleUserAccount::GetByUserID(
 int userID,
 string currency
);

The method GetByUserID returns an associated array containing parameters of an account in the specified currency for the specified user.

Parameters

ParameterDescription
userID The user ID.
currency The currency of the account.

Return Values

The method returns an associated array containing parameters of the account with the following keys:

Notes

The result of the method is cached within a single page. Thus, repeated calls of the method do not cause additional queries to the database.

Example



<? if ($ar = CSaleUserAccount::GetByUserID(172, "USD")) 
 { echo "Account balance: ".SaleFormatCurrency($ar["CURRENT_BUDGET"], $ar["CURRENCY"]); } ?>