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

	$sectionObject = new CIBlockSection;
	$result = $sectionObject->add($this->getFields());

	if ($result)
	{
		return (int)$result;
	}
	else
	{
		if ($sectionObject->LAST_ERROR)
		{
			$this->errorCollection->setError(new Error($sectionObject->LAST_ERROR, self::ERROR_ADD_SECTION));
		}
		else
		{
			$this->errorCollection->setError(new Error("Unknown error", self::ERROR_ADD_SECTION));
		}

		return false;
	}
}