vendor/shopware/core/Framework/DataAbstractionLayer/Pricing/Price.php line 7

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Framework\DataAbstractionLayer\Pricing;
  3. use Shopware\Core\Framework\Struct\Struct;
  4. class Price extends Struct
  5. {
  6.     /**
  7.      * @var string
  8.      */
  9.     protected $currencyId;
  10.     /**
  11.      * @var float
  12.      */
  13.     protected $net;
  14.     /**
  15.      * @var float
  16.      */
  17.     protected $gross;
  18.     /**
  19.      * @var bool
  20.      */
  21.     protected $linked;
  22.     /**
  23.      * @var Price|null
  24.      */
  25.     protected $listPrice;
  26.     /**
  27.      * @var array|null
  28.      */
  29.     protected $percentage;
  30.     /**
  31.      * @var Price|null
  32.      */
  33.     protected $regulationPrice;
  34.     public function __construct(string $currencyIdfloat $netfloat $grossbool $linked, ?Price $listPrice null, ?array $percentage null, ?Price $regulationPrice null)
  35.     {
  36.         $this->net $net;
  37.         $this->gross $gross;
  38.         $this->linked $linked;
  39.         $this->currencyId $currencyId;
  40.         $this->listPrice $listPrice;
  41.         $this->percentage $percentage;
  42.         $this->regulationPrice $regulationPrice;
  43.     }
  44.     public function getNet(): float
  45.     {
  46.         return $this->net;
  47.     }
  48.     public function setNet(float $net): void
  49.     {
  50.         $this->net $net;
  51.     }
  52.     public function getGross(): float
  53.     {
  54.         return $this->gross;
  55.     }
  56.     public function setGross(float $gross): void
  57.     {
  58.         $this->gross $gross;
  59.     }
  60.     public function getLinked(): bool
  61.     {
  62.         return $this->linked;
  63.     }
  64.     public function setLinked(bool $linked): void
  65.     {
  66.         $this->linked $linked;
  67.     }
  68.     public function add(self $price): void
  69.     {
  70.         $this->gross += $price->getGross();
  71.         $this->net += $price->getNet();
  72.     }
  73.     public function getCurrencyId(): string
  74.     {
  75.         return $this->currencyId;
  76.     }
  77.     public function setCurrencyId(string $currencyId): void
  78.     {
  79.         $this->currencyId $currencyId;
  80.     }
  81.     public function setListPrice(?Price $listPrice): void
  82.     {
  83.         $this->listPrice $listPrice;
  84.     }
  85.     public function getListPrice(): ?Price
  86.     {
  87.         return $this->listPrice;
  88.     }
  89.     public function getPercentage(): ?array
  90.     {
  91.         return $this->percentage;
  92.     }
  93.     public function setPercentage(?array $percentage): void
  94.     {
  95.         $this->percentage $percentage;
  96.     }
  97.     public function getApiAlias(): string
  98.     {
  99.         return 'price';
  100.     }
  101.     public function getRegulationPrice(): ?Price
  102.     {
  103.         return $this->regulationPrice;
  104.     }
  105.     public function setRegulationPrice(?Price $regulationPrice): void
  106.     {
  107.         $this->regulationPrice $regulationPrice;
  108.     }
  109. }