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

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