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 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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 $productCategories;
  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 $weight;
  41. /**
  42. * @ORM\Column(type="float", nullable=true)
  43. */
  44. protected $stock;
  45. /**
  46. * @ORM\Column(type="float", nullable=true)
  47. */
  48. protected $availableQuantity;
  49. /**
  50. * @ORM\Column(type="string", length=31, nullable=true)
  51. */
  52. protected $behaviorOutOfStock;
  53. /**
  54. * @ORM\Column(type="string", length=31)
  55. */
  56. protected $behaviorCountStock;
  57. public function __construct()
  58. {
  59. $this->productCategories = new ArrayCollection();
  60. }
  61. public function getMerchant(): ?Merchant
  62. {
  63. return $this->merchant;
  64. }
  65. public function setMerchant(?Merchant $merchant): self
  66. {
  67. $this->merchant = $merchant;
  68. return $this;
  69. }
  70. /**
  71. * @return Collection|ProductCategory[]
  72. */
  73. public function getProductCategories(): Collection
  74. {
  75. return $this->productCategories;
  76. }
  77. public function addProductCategory(ProductCategory $productCategory): self
  78. {
  79. if (!$this->productCategories->contains($productCategory)) {
  80. $this->productCategories[] = $productCategory;
  81. }
  82. return $this;
  83. }
  84. public function removeProductCategory(ProductCategory $productCategory): self
  85. {
  86. if ($this->productCategories->contains($productCategory)) {
  87. $this->productCategories->removeElement($productCategory);
  88. }
  89. return $this;
  90. }
  91. public function getTaxRate(): ?TaxRate
  92. {
  93. return $this->taxRate;
  94. }
  95. public function setTaxRate(?TaxRate $taxRate): self
  96. {
  97. $this->taxRate = $taxRate;
  98. return $this;
  99. }
  100. public function getUnit(): ?string
  101. {
  102. return $this->unit;
  103. }
  104. public function setUnit(?string $unit): self
  105. {
  106. $this->unit = $unit;
  107. return $this;
  108. }
  109. public function getPrice(): ?float
  110. {
  111. return $this->price;
  112. }
  113. public function setPrice(?float $price): self
  114. {
  115. $this->price = $price;
  116. return $this;
  117. }
  118. public function getStep(): ?float
  119. {
  120. return $this->step;
  121. }
  122. public function setStep(?float $step): self
  123. {
  124. $this->step = $step;
  125. return $this;
  126. }
  127. public function getWeight(): ?float
  128. {
  129. return $this->weight;
  130. }
  131. public function setWeight(?float $weight): self
  132. {
  133. $this->weight = $weight;
  134. return $this;
  135. }
  136. public function getStock(): ?float
  137. {
  138. return $this->stock;
  139. }
  140. public function setStock(?float $stock): self
  141. {
  142. $this->stock = $stock;
  143. return $this;
  144. }
  145. public function getAvailableQuantity(): ?float
  146. {
  147. return $this->availableQuantity;
  148. }
  149. public function setAvailableQuantity(?float $availableQuantity): self
  150. {
  151. $this->availableQuantity = $availableQuantity;
  152. return $this;
  153. }
  154. public function getBehaviorOutOfStock(): ?string
  155. {
  156. return $this->behaviorOutOfStock;
  157. }
  158. public function setBehaviorOutOfStock(?string $behaviorOutOfStock): self
  159. {
  160. $this->behaviorOutOfStock = $behaviorOutOfStock;
  161. return $this;
  162. }
  163. public function getBehaviorCountStock(): ?string
  164. {
  165. return $this->behaviorCountStock;
  166. }
  167. public function setBehaviorCountStock(string $behaviorCountStock): self
  168. {
  169. $this->behaviorCountStock = $behaviorCountStock;
  170. return $this;
  171. }
  172. }