• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/app.php
  • Класс: BitrixRestAppTable
  • Вызов: AppTable::onDelete
static function onDelete(MainEntityEvent $event)
{
	if(!static::$skipRemoteUpdate)
	{
		$data = $event->getParameters();
		$app = static::getByClientId($data['primary']['ID']);

		if($app['STATUS'] == AppTable::STATUS_LOCAL)
		{
			if(OAuthService::getEngine()->isRegistered())
			{
				CRestUtil::cleanApp($app["ID"], true);

				try
				{
					OAuthService::getEngine()
						->getClient()
						->deleteApplication(array(
							'CLIENT_ID' => $app['CLIENT_ID'],
						));
				}
				catch(BitrixMainSystemException $e)
				{
				}
			}
		}
	}
}