• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/grid/row/actions/item/deletesectionitem.php
  • Класс: BitrixIblockGridRowActionsItemDeleteSectionItem
  • Вызов: DeleteSectionItem::processRequest
public function processRequest(HttpRequest $request): ?Result
{
	global $APPLICATION;

	/**
	 * @var CMain $APPLICATION
	 */

	$id = $request->getPost('id');
	if (empty($id) || !is_numeric($id))
	{
		return null;
	}
	$id = (int)$id;

	if (!$this->rights->canDeleteSection($id))
	{
		throw new AccessDeniedException('Cannot delete element');
	}

	$result = new Result();

	$updateResult = CIBlockSection::Delete($id);
	if (!$updateResult)
	{
		$message = (string)$APPLICATION->GetException() ?: 'Cannot delete element';
		$result->addError(new Error($message));
	}

	return $result;
}