PublicAction::beforeRestApplicationDelete

  1. Bitrix24 API (v. 23.675.0)
  2. landing
  3. PublicAction
  4. beforeRestApplicationDelete
  • Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/publicaction.php
  • Класс: BitrixLandingPublicAction
  • Вызов: PublicAction::beforeRestApplicationDelete
static function beforeRestApplicationDelete(BitrixMainEvent $event)
{
	$parameters = $event->getParameters();

	if ($app = AppTable::getByClientId($parameters['ID']))
	{
		$stat = self::getRestStat(true);
		if (isset($stat[self::REST_USAGE_TYPE_BLOCK][$app['CODE']]))
		{
			$eventResult = new BitrixMainEventResult(
				BitrixMainEventResult::ERROR,
				new BitrixMainError(
					Loc::getMessage('LANDING_REST_DELETE_EXIST_BLOCKS'),
					'LANDING_EXISTS_BLOCKS'
				)
			);

			return $eventResult;
		}
		else if (isset($stat[self::REST_USAGE_TYPE_PAGE][$app['CODE']]))
		{
			$eventResult = new BitrixMainEventResult(
				BitrixMainEventResult::ERROR,
				new BitrixMainError(
					Loc::getMessage('LANDING_REST_DELETE_EXIST_PAGES'),
					'LANDING_EXISTS_PAGES'
				)
			);

			return $eventResult;
		}
	}
}

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