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

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

	$propertyId = $this->get($id)['PROPERTY_ID'];
	$updateResult = PropertyEnumerationTable::update([
		'ID' => $id,
		'PROPERTY_ID' => $propertyId,
	], $fields);
	if (!$updateResult)
	{
		$this->addErrors($updateResult->getErrors());
		return null;
	}

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