CBPSchedulerService::unSubscribeOnEvent

  1. Bitrix24 API (v. 23.675.0)
  2. bizproc
  3. CBPSchedulerService
  4. unSubscribeOnEvent
  • Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/schedulerservice.php
  • Класс: CBPSchedulerService
  • Вызов: CBPSchedulerService::unSubscribeOnEvent
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;
	}

	if (is_array($entityId))
	{
		$entityId = current(CBPHelper::makeArrayFlat($entityId));
	}

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

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

Добавить комментарий