• Модуль: lists
  • Путь к файлу: ~/bitrix/modules/lists/lib/entity/section.php
  • Класс: BitrixListsEntitySection
  • Вызов: Section::delete
public function delete()
{
	$this->param->checkRequiredInputParams(["SECTION_ID", "SECTION_CODE"]);
	if ($this->param->hasErrors())
	{
		$this->errorCollection->add($this->param->getErrors());
		return false;
	}

	$sectionObject = new CIBlockSection;
	if ($sectionObject->delete($this->sectionId, false))
	{
		return true;
	}
	else
	{
		if ($sectionObject->LAST_ERROR)
		{
			$this->errorCollection->setError(new Error($sectionObject->LAST_ERROR, self::ERROR_DELETE_SECTION));
		}
		else
		{
			$this->errorCollection->setError(new Error("Unknown error", self::ERROR_DELETE_SECTION));
		}

		return false;
	}
}