• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/controller/property.php
  • Класс: BitrixSaleControllerProperty
  • Вызов: Property::updateProperty
protected function updateProperty($propertiesToSave)
{
	$update = BitrixSaleInternalsOrderPropsTable::update(
		$this->property['ID'],
		array_diff_key($propertiesToSave, array('ID' => 1))
	);
	if ($update->isSuccess())
	{
		$propertyCode = $propertiesToSave['CODE'] ?: false;

		$result = OrderPropsValueTable::getList(['filter'=>[
			'ORDER_PROPS_ID' => $this->property['ID'],
			'!CODE' => $propertyCode,
		]]);
		while ($row = $result->Fetch())
		{
			OrderPropsValueTable::update($row['ID'], ['CODE' => $propertyCode]);
		}
	}
	else
	{
		foreach ($update->getErrorMessages() as $errorMessage)
		{
			$this->errors[] = $errorMessage;
		}
	}
}