• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/controller/roundingrule.php
  • Класс: BitrixCatalogControllerRoundingRule
  • Вызов: RoundingRule::updateAction
public function updateAction(int $id, array $fields): ?array
{
	$existsResult = $this->exists($id);
	if (!$existsResult->isSuccess())
	{
		$this->addErrors($existsResult->getErrors());
		return null;
	}

	$checkFieldsResult = $this->checkFields($fields);
	if (!$checkFieldsResult->isSuccess())
	{
		$this->addErrors($checkFieldsResult->getErrors());
		return null;
	}

	$updateResult = RoundingTable::update($id, $fields);
	if (!$updateResult)
	{
		$this->addErrors($updateResult->getErrors());
		return null;
	}

	return ['ROUNDING_RULE' => $this->get($id)];
}