• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/services/company/restrictions/price.php
  • Класс: Bitrix\Sale\Services\Company\Restrictions\Price
  • Вызов: Price::extractParams
static function extractParams(Entity $entity)
{
	/** @var \Bitrix\Sale\PaymentCollection|\Bitrix\Sale\ShipmentCollection|null $collection */
	$collection = null;

	if ($entity instanceof Payment)
		$collection = $entity->getCollection();
	elseif ($entity instanceof Shipment)
		$collection = $entity->getCollection();
	elseif ($entity instanceof Order)
	{
		return array('PRICE_PAYMENT' => $entity->getPrice());
	}

	if ($collection)
	{
		/** @var \Bitrix\Sale\Order $order */
		$order = $collection->getOrder();

		return array('PRICE_PAYMENT' => $order->getPrice());
	}

	return array('PRICE_PAYMENT' => null);
}