• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/lib/rest/helper.php
  • Класс: BitrixVoximplantRestHelper
  • Вызов: Helper::getEventSubscribers
static function getEventSubscribers($eventName)
{
	$result = [];
	if (!Loader::includeModule('rest'))
	{
		return $result;
	}

	$cursor = EventTable::getList([
		'select' => [
			'APP_ID' => 'APP_ID',
			'TITLE' => 'TITLE',
			'APP_NAME' => 'REST_APP.APP_NAME',
			'MENU_NAME' => 'REST_APP.LANG.MENU_NAME',
			'DEFAULT_MENU_NAME' => 'REST_APP.LANG_DEFAULT.MENU_NAME'
		],
		'filter' => [
			'=EVENT_NAME' => $eventName
		]
	]);

	while ($row = $cursor->fetch())
	{
		$appId = $row['APP_ID'];
		if ($appId == 0)
		{
			$appName = $row['TITLE'];
		}
		else if ($row['MENU_NAME'] != '')
		{
			$appName = $row['MENU_NAME'];
		}
		else if ($row['DEFAULT_MENU_NAME'] != '')
		{
			$appName = $row['DEFAULT_MENU_NAME'];
		}
		else
		{
			$appName = $row['APP_NAME'];
		}

		$result[$appId] = $appName;
	}

	return $result;
}