You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ProductFamily.php 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <?php
  2. namespace Lc\ShopBundle\Model;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\MappedSuperclass()
  8. */
  9. abstract class ProductFamily extends AbstractDocumentEntity
  10. {
  11. /**
  12. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface", inversedBy="productFamilies")
  13. * @ORM\JoinColumn(nullable=false)
  14. */
  15. protected $merchant;
  16. /**
  17. * @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\ProductCategoryInterface", inversedBy="productFamilies")
  18. */
  19. protected $productCategory;
  20. /**
  21. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\TaxRateInterface")
  22. * @ORM\JoinColumn(nullable=true)
  23. */
  24. protected $taxRate;
  25. /**
  26. * @ORM\Column(type="float", nullable=true)
  27. */
  28. protected $price;
  29. /**
  30. * @ORM\Column(type="string", length=31, nullable=true)
  31. */
  32. protected $unit;
  33. /**
  34. * @ORM\Column(type="float", nullable=true)
  35. */
  36. protected $step;
  37. /**
  38. * @ORM\Column(type="float", nullable=true)
  39. */
  40. protected $stock;
  41. /**
  42. * @ORM\Column(type="float", nullable=true)
  43. */
  44. protected $availableQuantity;
  45. /**
  46. * @ORM\Column(type="string", length=31, nullable=true)
  47. */
  48. protected $behaviorOutOfStock;
  49. /**
  50. * @ORM\Column(type="string", length=31)
  51. */
  52. protected $behaviorCountStock;
  53. public function __construct()
  54. {
  55. $this->productCategory = new ArrayCollection();
  56. }
  57. public function getMerchant(): ?Merchant
  58. {
  59. return $this->merchant;
  60. }
  61. public function setMerchant(?Merchant $merchant): self
  62. {
  63. $this->merchant = $merchant;
  64. return $this;
  65. }
  66. /**
  67. * @return Collection|ProductCategory[]
  68. */
  69. public function getProductCategory(): Collection
  70. {
  71. return $this->productCategory;
  72. }
  73. public function addProductCategory(ProductCategory $productCategory): self
  74. {
  75. if (!$this->productCategory->contains($productCategory)) {
  76. $this->productCategory[] = $productCategory;
  77. }
  78. return $this;
  79. }
  80. public function removeProductCategory(ProductCategory $productCategory): self
  81. {
  82. if ($this->productCategory->contains($productCategory)) {
  83. $this->productCategory->removeElement($productCategory);
  84. }
  85. return $this;
  86. }
  87. public function getTaxRate(): ?TaxRate
  88. {
  89. return $this->taxRate;
  90. }
  91. public function setTaxRate(?TaxRate $taxRate): self
  92. {
  93. $this->taxRate = $taxRate;
  94. return $this;
  95. }
  96. public function getUnit(): ?string
  97. {
  98. return $this->unit;
  99. }
  100. public function setUnit(?string $unit): self
  101. {
  102. $this->unit = $unit;
  103. return $this;
  104. }
  105. public function getPrice(): ?float
  106. {
  107. return $this->price;
  108. }
  109. public function setPrice(?float $price): self
  110. {
  111. $this->price = $price;
  112. return $this;
  113. }
  114. public function getStep(): ?float
  115. {
  116. return $this->price;
  117. }
  118. public function setStep(?float $price): self
  119. {
  120. $this->price = $price;
  121. return $this;
  122. }
  123. public function getStock(): ?float
  124. {
  125. return $this->stock;
  126. }
  127. public function setStock(?float $stock): self
  128. {
  129. $this->stock = $stock;
  130. return $this;
  131. }
  132. public function getAvailableQuantity(): ?float
  133. {
  134. return $this->availableQuantity;
  135. }
  136. public function setAvailableQuantity(?float $availableQuantity): self
  137. {
  138. $this->availableQuantity = $availableQuantity;
  139. return $this;
  140. }
  141. public function getBehaviorOutOfStock(): ?string
  142. {
  143. return $this->behaviorOutOfStock;
  144. }
  145. public function setBehaviorOutOfStock(?string $behaviorOutOfStock): self
  146. {
  147. $this->behaviorOutOfStock = $behaviorOutOfStock;
  148. return $this;
  149. }
  150. public function getBehaviorCountStock(): ?string
  151. {
  152. return $this->behaviorCountStock;
  153. }
  154. public function setBehaviorCountStock(string $behaviorCountStock): self
  155. {
  156. $this->behaviorCountStock = $behaviorCountStock;
  157. return $this;
  158. }
  159. }