Add
Description and parameters
int CSaleUserAccount::Add( array arFields );
Method adds a new user account as per parameters from the arFields array. Non-static method.
Call parameters
Parameter | Description |
---|---|
arFields | Associative array with the new account parameters. Can contain the following keys:
|
Returned values
Method returns code for added account or false otherwise.
Examples
if($USER->IsAuthorized()) { $user_id = $USER->GetID(); $arFields = Array("USER_ID" => $user_id, "CURRENCY" => "USD", "CURRENT_BUDGET" => 0); $accountID = CSaleUserAccount::Add($arFields); }
Создание счета для текущего пользователя
if(!CSaleUserAccount::GetByUserID($USER->GetID(), "USD")){ $arFields = Array("USER_ID" => $USER->GetID(), "CURRENCY" => "USD", "CURRENT_BUDGET" => 0); CSaleUserAccount::Add($arFields); }
© «Bitrix24», 2001-2024