vendor/shopware/core/Checkout/Cart/Price/Struct/ReferencePrice.php line 9

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Checkout\Cart\Price\Struct;
  3. use Shopware\Core\Framework\Log\Package;
  4. use Shopware\Core\Framework\Util\FloatComparator;
  5. #[Package('checkout')]
  6. class ReferencePrice extends ReferencePriceDefinition
  7. {
  8.     /**
  9.      * @var float
  10.      */
  11.     protected $price;
  12.     public function __construct(float $pricefloat $purchaseUnitfloat $referenceUnitstring $unitName)
  13.     {
  14.         parent::__construct($purchaseUnit$referenceUnit$unitName);
  15.         $this->price FloatComparator::cast($price);
  16.     }
  17.     public function getPrice(): float
  18.     {
  19.         return FloatComparator::cast($this->price);
  20.     }
  21.     public function getApiAlias(): string
  22.     {
  23.         return 'cart_price_reference';
  24.     }
  25. }