vendor/shopware/core/Content/Product/SalesChannel/SalesChannelProductEntity.php line 12

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Content\Product\SalesChannel;
  3. use Shopware\Core\Checkout\Cart\Price\Struct\CalculatedPrice;
  4. use Shopware\Core\Checkout\Cart\Price\Struct\PriceCollection;
  5. use Shopware\Core\Content\Category\CategoryEntity;
  6. use Shopware\Core\Content\Product\ProductEntity;
  7. use Shopware\Core\Content\Property\PropertyGroupCollection;
  8. use Shopware\Core\Framework\DataAbstractionLayer\Pricing\CalculatedListingPrice;
  9. class SalesChannelProductEntity extends ProductEntity
  10. {
  11.     /**
  12.      * @deprecated tag:v6.4.0 - Will be removed
  13.      */
  14.     public const VISIBILITY_FILTERED 'product-visibility';
  15.     /**
  16.      * @var CalculatedListingPrice
  17.      */
  18.     protected $calculatedListingPrice;
  19.     /**
  20.      * @var PriceCollection
  21.      */
  22.     protected $calculatedPrices;
  23.     /**
  24.      * @var CalculatedPrice
  25.      */
  26.     protected $calculatedPrice;
  27.     /**
  28.      * @var PropertyGroupCollection|null
  29.      */
  30.     protected $sortedProperties;
  31.     /**
  32.      * @var bool
  33.      */
  34.     protected $isNew false;
  35.     /**
  36.      * @var int
  37.      */
  38.     protected $calculatedMaxPurchase;
  39.     /**
  40.      * @deprecated tag:v6.4.0 - Only used for backward compatibility
  41.      *
  42.      * @var PropertyGroupCollection|null
  43.      */
  44.     protected $configurator;
  45.     /**
  46.      * @var CategoryEntity|null
  47.      */
  48.     protected $seoCategory;
  49.     public function getCalculatedListingPrice(): CalculatedListingPrice
  50.     {
  51.         return $this->calculatedListingPrice;
  52.     }
  53.     public function setCalculatedListingPrice(CalculatedListingPrice $calculatedListingPrice): void
  54.     {
  55.         $this->calculatedListingPrice $calculatedListingPrice;
  56.     }
  57.     public function setCalculatedPrices(PriceCollection $prices): void
  58.     {
  59.         $this->calculatedPrices $prices;
  60.     }
  61.     public function getCalculatedPrices(): PriceCollection
  62.     {
  63.         return $this->calculatedPrices;
  64.     }
  65.     public function getCalculatedPrice(): CalculatedPrice
  66.     {
  67.         return $this->calculatedPrice;
  68.     }
  69.     public function setCalculatedPrice(CalculatedPrice $calculatedPrice): void
  70.     {
  71.         $this->calculatedPrice $calculatedPrice;
  72.     }
  73.     public function getSortedProperties(): ?PropertyGroupCollection
  74.     {
  75.         return $this->sortedProperties;
  76.     }
  77.     public function setSortedProperties(?PropertyGroupCollection $sortedProperties): void
  78.     {
  79.         $this->sortedProperties $sortedProperties;
  80.     }
  81.     public function hasPriceRange(): bool
  82.     {
  83.         return $this->getCalculatedListingPrice()->hasRange() || $this->getCalculatedPrices()->count() > 1;
  84.     }
  85.     public function isNew(): bool
  86.     {
  87.         return $this->isNew;
  88.     }
  89.     public function setIsNew(bool $isNew): void
  90.     {
  91.         $this->isNew $isNew;
  92.     }
  93.     public function getCalculatedMaxPurchase(): int
  94.     {
  95.         return $this->calculatedMaxPurchase;
  96.     }
  97.     public function setCalculatedMaxPurchase(int $calculatedMaxPurchase): void
  98.     {
  99.         $this->calculatedMaxPurchase $calculatedMaxPurchase;
  100.     }
  101.     /**
  102.      * @deprecated tag:v6.4.0 - Only used for backward compatibility
  103.      */
  104.     public function getConfigurator(): ?PropertyGroupCollection
  105.     {
  106.         return $this->configurator;
  107.     }
  108.     /**
  109.      * @deprecated tag:v6.4.0 - Only used for backward compatibility
  110.      */
  111.     public function setConfigurator(PropertyGroupCollection $configurator): void
  112.     {
  113.         $this->configurator $configurator;
  114.     }
  115.     public function getSeoCategory(): ?CategoryEntity
  116.     {
  117.         return $this->seoCategory;
  118.     }
  119.     public function setSeoCategory(?CategoryEntity $category): void
  120.     {
  121.         $this->seoCategory $category;
  122.     }
  123. }