Documentation

Update

int
CBlogUser::Update(
 int   ID
 array arFields
);

The method modifies parameters of the blog user with the ID. Static method.

Method parameters

ParameterDescription
ID ID of the modified blog user.
arFields Array of the array("field"=>"value"[, ...]) type, containing the values of the blog user fields.

Returned value

The method returns the ID of the modified blog user on success. When an error occurs, the method will return false, and exceptions will contain errors.

See Also

Examples of use

<?
//update blog user profile for the current user
$arUser = CBlogUser::GetByID($USER->GetID(), BLOG_BY_USER_ID)
$arFields = array(
    "ALIAS" => "Current user alias",
    "DESCRIPTION" => "General site user with a blog",
    "INTERESTS" => "programming, PHP, MySQL, Bitrix24, Microsoft"
);

$updateID = CBlogUser::Update($arUser["ID"], $arFields);
if(IntVal($updateID)>0)
{
    echo "Information of the blog user [".$updateID."] modified.";
}
else
{
    if ($ex = $APPLICATION->GetException())
        echo $ex->GetString();
}
?>


© «Bitrix24», 2001-2024
Up