Documentation

Update

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

The method updates comment parameters with the ID. Non-static method.

Method parameters

ParameterDescriptionAvailable from version
ID ID of the blog post modified comment.
arFields Array of the array("field"=>"value"[, ...]) type, contains values of blog post comment fields.
bSearchIndex Optional parameter. Value by default - "true".

Returned value

The method returns the identifier of updated blog post comment, if the update was successful. If an error occurs, the method returns false, and exceptions will contain errors.

See Also

Examples of use

<?
$ID = 1;
$arFields = array(
    "TITLE" => 'My first updated comment',
    "POST_TEXT" => 'Text of my first updated comment',
    "BLOG_ID" => 1,
    "POST_ID" => 2
);

$updateID = CBlogComment::Update($ID, $arFields);
if(IntVal($updateID)>0)
{
    echo "Comment [".$updateID."] is updated.";
}
else
{
    if ($ex = $APPLICATION->GetException())
        echo $ex->GetString();
}
?>


© «Bitrix24», 2001-2024
Up