Bitrix24\Event\Event::bind PHP Method

bind() public method

Register new event handler. Work only for user with portal administrator rights
public bind ( $eventName, $handler, $authType = null ) : array
$eventName string event handler code
$handler string event handler URL
$authType integer user identifier, under witch event handler was executed
return array
    public function bind($eventName, $handler, $authType = null)
    {
        if (!$this->isEventHandlerCodeValid($eventName)) {
            throw new Bitrix24Exception('eventName is invalid');
        }
        if (is_null($handler)) {
            throw new Bitrix24Exception('handler URL is null');
        }
        $fullResult = $this->client->call('event.bind', array('event' => $eventName, 'handler' => $handler, 'auth_type' => $authType));
        return $fullResult;
    }