Documentation

Add

int
CBlogCategory::Add(
 array arFields
);

The method adds a new category. Non-static method.

Method parameters

ParameterDescription
arFields Array of the array("BLOG_ID"=>"value", "NAME"=>"value") type.

Returned value

The method returns an added category ID, if adding was completed successfully. When an error occurs, the method will return false, and exceptions will contain errors.

See Also

Examples of use

<?
$arFields = array(
    "BLOG_ID" => 1,
    "NAME" => "General category"
);

$newID = CBlogCategory::Add($arFields);
if(IntVal($newID)>0)
{
    echo "New category [".$newID."] is added.";
}
else
{
    if ($ex = $APPLICATION->GetException())
        echo $ex->GetString();
}
?>


© «Bitrix24», 2001-2024
Up