Documentation

Add

int
CBlogGroup::Add(
 array arFields
);

The method adds new group. Non-static method.

Method parameters

ParameterDescription
arFields Arra of the array("SITE_ID"=>"value", "NAME"=>"value").

Returned value

The method returns the ID of added group, if the adding was successful. When an error occurs, the method returns false, and exceptions will contain errors.

See Also

Examples of use

<?
$arFields = array(
    "SITE_ID" => "com",
    "NAME" => "General group"
);

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


© «Bitrix24», 2001-2024