• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/classes/general/rest.php
  • Класс: CIntranetRestService
  • Вызов: CIntranetRestService::departmentDelete
static function departmentDelete($params)
{
	if(self::canEdit())
	{
		CModule::IncludeModule('iblock');

		$params = array_change_key_case($params, CASE_UPPER);

		$arDept = self::getDepartment($params['ID']);
		if(is_array($arDept))
		{
			$ob = new CIBlockSection();
			if(!$ob->Delete($arDept['ID']))
			{
				throw new Exception($ob->LAST_ERROR);
			}

			return true;
		}
		else
		{
			throw new Exception('Department not found');
		}
	}
	else
	{
		throw new Exception('Access denied!');
	}
}