Bitrix Site Manager

GetModuleEvents

CDBResult
GetModuleEvents(
 string module_id, 
 string event_id
)

The function GetModuleEvents returns a list of event_id handlers for the module_id as the CDBResult object.

Parameters

ParameterDescription
module_id The module ID.
event_id The event ID.

See Also

Example



<?
// check if the forum can be deleted

// the flag that allows or disallows deleting a forum
$bCanDelete = true;

// obtain data on all handlers of "OnBeforeForumDelete" event
// that belongs to the Forum module
$rsEvents = GetModuleEvents("forum", "OnBeforeForumDelete");
while ($arEvent = $rsEvents->Fetch())
{
    // run the scheduled handler of "OnBeforeForumDelete"
    // if false is returned...
    if (ExecuteModuleEvent($arEvent, $del_id)===false)
    {
        // cannot delete forum
        $bCanDelete = false;
        break;
    }
}
?>