Bitrix Site Manager

OnGroupDelete

event_handler(
 int group_id
);

The OnGroupDelete event is fired when a user group is deleted. A common task of this handler is to clean the database of records related to the deleted user group.

Parameters

ParameterDescription
group_id The ID of the user group which is to be deleted.

See Also

Example



<?
// file /bitrix/php_interface/init.php
AddEventHandler("main", "OnGroupDelete", 
                Array("MyClass", "OnGroupDeleteHandler"));
class MyClass
{
    // create handler "OnGroupDelete"
    function OnGroupDeleteHandler($group_id)
    {
        // delete related records
        $strSql = "DELETE FROM my_table WHERE GROUP_ID=".
                  intval($group_id);
        $rs = $DB->Query($strSql, false, 
                         "FILE: ".__FILE__."<br>LINE: ".__LINE__);
    }
}
?>