Documentation

Add

mixed
CGroup::Add(
 array fields
)

The method adds a new group and returns the ID of the added group. In case of error the method will return false, and the LAST_ERROR property will contain the error description. Non-static method.

Parameters

ParameterDescription
fields Array of fields values of the array("field"=>"value" [, ...]) type.

See Also

Examples of use

<?
$group = new CGroup;
$arFields = Array(
  "ACTIVE"       => "Y",
  "C_SORT"       => 100,
  "NAME"         => "Name of the group",
  "DESCRIPTION"  => "Description of the group",
  "USER_ID"      => array(128, 134),
  "STRING_ID"      => "GROUP_1"
  );
$NEW_GROUP_ID = $group->Add($arFields);
if (strlen($group->LAST_ERROR)>0) ShowError($group->LAST_ERROR);
?>

© «Bitrix24», 2001-2024
Up