Documentation

GetByUserID

Description and parameters

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

Method returns an associative array with account parameters with currency for user with userID. Non-static method.

Call parameters

ParameterDescription
userID User ID.
currency Account currency.

Returned values

Method returns an associative array with account parameters with keys:

  • ID - account identifier;
  • USER_ID - owner-user ID;
  • CURRENT_BUDGET - current amount deposited at the account;
  • CURRENCY - currency;
  • NOTES - text description;
  • LOCKED - flag for locked account;
  • TIMESTAMP_X - date of the last update;
  • DATE_LOCKED - date of locked account.

Note: method result is cached within a page, that's why a repeated method call doesn't results in additional database queries.

Examples

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

© «Bitrix24», 2001-2024
Up