CBPWorkflow::RemoveEventHandler: Bitrix method

      
<?php 
//  CBPWorkflow :: RemoveEventHandler()
//  /dist/bitrix/modules/bizproc/classes/general/workflow.php:650

    
public function RemoveEventHandler($eventNameIBPActivityExternalEventListener $eventHandler)
    {
        if (!
is_array($this->rootActivity->arEventsMap))
            
$this->rootActivity->arEventsMap = array();

        if (!
array_key_exists($eventName$this->rootActivity->arEventsMap))
            
$this->rootActivity->arEventsMap[$eventName] = array();

        
$idx array_search($eventHandler$this->rootActivity->arEventsMap[$eventName], true);
        if (
$idx !== false)
            unset(
$this->rootActivity->arEventsMap[$eventName][$idx]);

        if (
count($this->rootActivity->arEventsMap[$eventName]) <= 0)
            unset(
$this->rootActivity->arEventsMap[$eventName]);
    }