• Модуль: lists
  • Путь к файлу: ~/bitrix/modules/lists/lib/rest/restservice.php
  • Класс: BitrixListsRestRestService
  • Вызов: RestService::updateField
static function updateField(array $params, $n, CRestServer $server)
{
	$param = new Param($params);

	$iblock = new Iblock($param);
	if (!$iblock->isExist())
	{
		self::throwError($iblock->getErrors(), "Iblock not found", Iblock::ERROR_IBLOCK_NOT_FOUND);
	}

	global $USER;
	$rightParam = new RightParam($param);
	$rightParam->setUser($USER);

	if (!CLists::isListFeatureEnabled($rightParam->getIblockTypeId()))
	{
		throw new AccessException('Available only on extended plans');
	}

	$right = new Right($rightParam, new IblockRight($rightParam));
	$right->checkPermission(IblockRight::EDIT);
	if ($right->hasErrors())
	{
		self::throwError($right->getErrors());
	}

	$field = new Field($param);
	if ($field->update())
	{
		return true;
	}
	else
	{
		self::throwError($field->getErrors());
	}
}