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.

152 lines
3.3KB

  1. <?php
  2. namespace Lc\ShopBundle\Model;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Lc\ShopBundle\Context\SortableInterface;
  5. /**
  6. * @ORM\MappedSuperclass()
  7. */
  8. abstract class Product extends AbstractEntity implements SortableInterface
  9. {
  10. use SortableTrait;
  11. /**
  12. * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\ProductFamilyInterface", inversedBy="products")
  13. * @ORM\JoinColumn(nullable=false)
  14. */
  15. protected $productFamily;
  16. /**
  17. * @ORM\Column(type="string", length=255, nullable=true)
  18. */
  19. protected $title;
  20. /**
  21. * @ORM\Column(type="float", nullable=true)
  22. */
  23. protected $price;
  24. /**
  25. * @ORM\Column(type="string", length=31, nullable=true)
  26. */
  27. protected $unit;
  28. /**
  29. * @ORM\Column(type="float", nullable=true)
  30. */
  31. protected $step;
  32. /**
  33. * @ORM\Column(type="float", nullable=true)
  34. */
  35. protected $weight;
  36. /**
  37. * @ORM\Column(type="float", nullable=true)
  38. */
  39. protected $availableQuantity;
  40. /**
  41. * @ORM\Column(type="float", nullable=true)
  42. */
  43. protected $stock;
  44. public function getProductFamily(): ?ProductFamily
  45. {
  46. return $this->productFamily;
  47. }
  48. public function setProductFamily(?ProductFamily $productFamily): self
  49. {
  50. $this->productFamily = $productFamily;
  51. return $this;
  52. }
  53. public function getPrice(): ?float
  54. {
  55. return $this->price;
  56. }
  57. public function setPrice(?float $price): self
  58. {
  59. $this->price = $price;
  60. return $this;
  61. }
  62. public function getUnit(): ?string
  63. {
  64. return $this->unit;
  65. }
  66. public function setUnit(?string $unit): self
  67. {
  68. $this->unit = $unit;
  69. return $this;
  70. }
  71. public function getStep(): ?float
  72. {
  73. return $this->step;
  74. }
  75. public function setStep(?float $step): self
  76. {
  77. $this->step = $step;
  78. return $this;
  79. }
  80. public function getWeight(): ?float
  81. {
  82. return $this->weight;
  83. }
  84. public function setWeight(?float $weight): self
  85. {
  86. $this->weight = $weight;
  87. return $this;
  88. }
  89. public function getAvailableQuantity(): ?float
  90. {
  91. return $this->availableQuantity;
  92. }
  93. public function setAvailableQuantity(?float $availableQuantity): self
  94. {
  95. $this->availableQuantity = $availableQuantity;
  96. return $this;
  97. }
  98. public function getStock(): ?float
  99. {
  100. return $this->stock;
  101. }
  102. public function setStock(?float $stock): self
  103. {
  104. $this->stock = $stock;
  105. return $this;
  106. }
  107. public function getTitle(): ?string
  108. {
  109. return $this->title;
  110. }
  111. public function setTitle(?string $title): self
  112. {
  113. $this->title = $title;
  114. return $this;
  115. }
  116. }