Documentation

RegisterModuleDependences

RegisterModuleDependences(
 string from_module_id,
string MESSAGE_ID,
string to_module_id,
string to_class = "",
string to_method = "",
int sort = 100, TO_PATH="", TO_METHOD_ARG = array() );

The function registers an event handler. It is executed once (when module is installed) and this event handler is active prior to calling the UnRegisterModuleDependences event handler.

Equivalent to the function in he new core: Bitrix\Main\EventManager::registerEventHandler .

Function parameters

ParameterDescription Available from version
from_module_id The ID of the module, that will initiate an event.
MESSAGE_ID The event ID.
to_module_id The ID of the module, containing the event handler.
to_class Class of the module, which method is the event handler.
Optional parameter. By default - "" (the file /bitrix/modules/to_module_id/include.php will be simply included).
to_method Method of the to_class operating as the event handler.
Optional parameter. By default - "" (the file /bitrix/modules/to_module_id/include.php will be simply included).
sort Queue (sequence), in which this event handler is called (more than one event handler can be registered for this event).
Optional parameter, by default equals 100.
TO_PATH Optional parameter, empty by default .
TO_METHOD_ARG Array of arguments for event handler.
Optional parameter.

See Also

Examples of use

<?
// For the corresponding forum data to be cleaned
// when a user is deleted,
//, when forum is installed, register a new
// "OnUserDelete" event handler of the 'main' module.
// This event handler is the OnUserDelete method of the CForum class of 'forum' module.

RegisterModuleDependences("main", "OnUserDelete", "forum", "CForum", "OnUserDelete");
?>


© «Bitrix24», 2001-2022
Up