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

	$cursor = ExternalLineTable::getList([
		'select' => ['ID'],
		'filter' => [
			'=REST_APP_ID' => $restAppId
		]
	]);
	while ($row = $cursor->fetch())
	{
		$externalNumberIds[] = $row['ID'];
	}

	foreach ($externalNumberIds as $externalNumberId)
	{
		ExternalLineTable::delete($externalNumberId);
	}

	Application::getInstance()->addBackgroundJob(
		["CVoxImplantUser", "clearCache"],
		[],
		Application::JOB_PRIORITY_LOW
	);
}