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

	$fields = $this->getFields();
	$this->validateFields($fields);
	if ($this->hasErrors())
	{
		return false;
	}

	$object = new CList($this->iblockId);
	if (!$this->canChangeField($fields["TYPE"]))
	{
		return false;
	}

	$result = $object->updateField($this->params["FIELD_ID"], $fields);

	if ($result)
	{
		global $CACHE_MANAGER;
		$CACHE_MANAGER->clearByTag("lists_list_".$this->iblockId);
		return $result;
	}
	else
	{
		$this->errorCollection->setError(new Error("Error update the field", self::ERROR_UPDATE_FIELD));
		return false;
	}
}