CBPSchedulerService :: UnSubscribeOnEvent: Bitrix method

      
<?php 
//  CBPSchedulerService :: UnSubscribeOnEvent()
//  /dist/bitrix/modules/bizproc/classes/general/schedulerservice.php:149

    
public function UnSubscribeOnEvent($workflowId$eventHandlerName$eventModule$eventName$entityId null)
    {
        
// Clean old-style registry entry.
        
UnRegisterModuleDependences(
            
$eventModule,
            
$eventName,
            
"bizproc",
            
"CBPSchedulerService",
            
"OnEvent",
            
"",
            array(
$workflowId$eventHandlerName, array('SchedulerService' => 'OnEvent''EntityId' => $entityId))
        );

        
$entityKey null;
        if (
is_array($entityId))
        {
            foreach (
$entityId as $entityKey => $entityId)
                break;
        }
        elseif (
$entityId !== null)
        {
            
$entityKey 0;
        }

        
SchedulerEventTable::deleteBySubscription($workflowId$eventHandlerName$eventModule$eventName$entityId);

        if (!
SchedulerEventTable::hasSubscriptions($eventModule$eventName))
        {
            
UnRegisterModuleDependences(
                
$eventModule,
                
$eventName,
                
'bizproc',
                
'CBPSchedulerService',
                
'sendEvents',
                
'',
                array(
$eventModule$eventName$entityKey)
            );
        }
    }