Advertisement
Lien_Gesbor

WholesaleRuleQuantityStep

Mar 26th, 2021
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.46 KB | None | 0 0
  1. class WholesaleRuleQuantityStep extends BaseEntity implements WholesaleRuleQuantityStepInterface, ResourceInterface
  2. {
  3.     /** @var int */
  4.     protected $id;
  5.     /** @var string */
  6.     protected $name;
  7.     /** @var string */
  8.     protected $description;
  9.     /** @var int */
  10.     protected $quantityStep;
  11.     /** @var string */
  12.     protected $scope;
  13.     /** @var bool */
  14.     protected $enabled;
  15.     /** @var WholesaleRulesetInterface */
  16.     protected $ruleset;
  17.  
  18.     /**
  19.      * @var Collection|TaxonInterface[]
  20.      * @Psalm-var Collection<array-key, TaxonInterface>
  21.      */
  22.     protected $taxons;
  23.  
  24.     /**
  25.      * @var Collection|ProductVariantInterface[]
  26.      * @Psalm-var Collection<array-key, ProductVariantInterface>
  27.      */
  28.     protected $products;
  29.  
  30.     /**
  31.      * @var Collection|Product[]
  32.      * @Psalm-var Collection<array-key, Product>
  33.      */
  34.     protected $productVariants;
  35.  
  36.     public function __construct()
  37.     {
  38.         $this->taxons = new ArrayCollection();
  39.         $this->products = new ArrayCollection();
  40.     }
  41.  
  42.     public function getId(): int
  43.     {
  44.         return $this->id;
  45.     }
  46.  
  47.     public function setId(int $id): void
  48.     {
  49.         $this->id = $id;
  50.     }
  51.  
  52.     public function getName(): ?string
  53.     {
  54.         return $this->name;
  55.     }
  56.  
  57.     public function setName(string $name): void
  58.     {
  59.         $this->name = $name;
  60.     }
  61.  
  62.     public function getDescription(): ?string
  63.     {
  64.         return $this->description;
  65.     }
  66.  
  67.     public function setDescription(string $description): void
  68.     {
  69.         $this->description = $description;
  70.     }
  71.  
  72.     public function getQuantityStep(): ?int
  73.     {
  74.         return $this->quantityStep;
  75.     }
  76.  
  77.     public function setQuantityStep(int $quantityStep): void
  78.     {
  79.         $this->quantityStep = $quantityStep;
  80.     }
  81.  
  82.     public function getScope(): ?string
  83.     {
  84.         return $this->scope;
  85.     }
  86.  
  87.     public function setScope(string $scope): void
  88.     {
  89.         $this->scope = $scope;
  90.     }
  91.  
  92.     public function isEnabled(): ?bool
  93.     {
  94.         return $this->enabled;
  95.     }
  96.  
  97.     public function setEnabled(bool $enabledStatus): void
  98.     {
  99.         $this->enabled = $enabledStatus;
  100.     }
  101.  
  102.     public function getRuleset(): WholesaleRulesetInterface
  103.     {
  104.         return $this->getRuleset();
  105.     }
  106.  
  107.     public function setRuleset(WholesaleRulesetInterface $ruleset): void
  108.     {
  109.         $this->ruleset = $ruleset;
  110.     }
  111.  
  112.     public function getTaxons(): ?Collection
  113.     {
  114.         return $this->taxons;
  115.     }
  116.  
  117.     public function addTaxon(TaxonInterface $taxon): void
  118.     {
  119.         if ($this->taxons->contains($taxon)) {
  120.             return;
  121.         }
  122.         $this->taxons->add($taxon);
  123.     }
  124.  
  125.     public function removeTaxon(TaxonInterface $taxon): void
  126.     {
  127.         if (!$this->taxons->contains($taxon)) {
  128.             return;
  129.         }
  130.         $this->taxons->removeElement($taxon);
  131.     }
  132.  
  133.     public function hasTaxon(TaxonInterface $taxon): bool
  134.     {
  135.         return $this->taxons->contains($taxon);
  136.     }
  137.  
  138.     public function getProducts(): ?Collection
  139.     {
  140.         return $this->products;
  141.     }
  142.  
  143.     public function addProduct(Product $product): void
  144.     {
  145.         if ($this->products->contains($product)) {
  146.             return;
  147.         }
  148.         $this->products->add($product);
  149.     }
  150.  
  151.     public function removeProduct(Product $product): void
  152.     {
  153.         if (!$this->products->contains($product)) {
  154.             return;
  155.         }
  156.         $this->products->removeElement($product);
  157.     }
  158.  
  159.     public function hasProduct(Product $product): bool
  160.     {
  161.         return $this->products->contains($product);
  162.     }
  163.  
  164.     public function getProductVariants(ProductVariantInterface $productVariant): ?Collection
  165.     {
  166.         return $this->productVariants;
  167.     }
  168.  
  169.     public function addProductVariant(ProductVariantInterface $productVariant): void
  170.     {
  171.         if ($this->productVariants->contains($productVariant)) {
  172.             return;
  173.         }
  174.         $this->productVariants->add($productVariant);
  175.     }
  176.  
  177.     public function removeProductVariant(ProductVariantInterface $productVariant): void
  178.     {
  179.         if (!$this->productVariants->contains($productVariant)) {
  180.             return;
  181.         }
  182.         $this->productVariants->removeElement($productVariant);
  183.     }
  184.  
  185.     public function hasProductVariant(ProductVariantInterface $productVariant): bool
  186.     {
  187.         return $this->productVariants->contains($productVariant);
  188.     }
  189. }
  190.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement