• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/propertyvaluecollection.php
  • Класс: BitrixSalePropertyValueCollection
  • Вызов: PropertyValueCollection::save
public function save()
{
	$isChanged = $this->isChanged();

	/** @var Order $order */
	if (!$order = $this->getOrder())
	{
		throw new MainObjectNotFoundException('Entity "Order" not found');
	}

	$result = parent::save();

	if ($isChanged && $order->getId() > 0)
	{
		$registry = Registry::getInstance(static::getRegistryType());
		/** @var OrderHistory $orderHistory */
		$orderHistory = $registry->getOrderHistoryClassName();

		if ($result->isSuccess())
		{
			$orderHistory::addAction(
				'PROPERTY',
				$order->getId(),
				'PROPERTY_SAVED',
				null,
				null,
				[],
				OrderHistory::SALE_ORDER_HISTORY_ACTION_LOG_LEVEL_1
			);
		}

		$orderHistory::collectEntityFields('PROPERTY', $order->getId());
	}

	return $result;
}