vendor/roothirsch/tuer24-bundle/src/Entity/Tuer24ProductPrice.php line 12

Open in your IDE?
  1. <?php
  2. namespace Roothirsch\Tuer24Bundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use Gedmo\Timestampable\Traits\TimestampableEntity;
  6. use Roothirsch\PimBundle\Entity\Product;
  7. #[ORM\Entity]
  8. #[ORM\Table(name: 'tuer24_product_price')]
  9. class Tuer24ProductPrice
  10. {
  11. use TimestampableEntity;
  12. #[ORM\Id]
  13. #[ORM\GeneratedValue]
  14. #[ORM\Column(type: 'integer')]
  15. private $id;
  16. #[ORM\ManyToOne(targetEntity: Product::class)]
  17. #[ORM\JoinColumn(nullable: false)]
  18. private $product;
  19. #[ORM\Column(type: 'integer')]
  20. private $companyId;
  21. #[ORM\Column(type: 'decimal', precision: 15, scale: 2)]
  22. #[Assert\NotBlank]
  23. #[Assert\PositiveOrZero]
  24. private $price;
  25. #[ORM\Column(type: 'decimal', precision: 5, scale: 2, nullable: true)]
  26. #[Assert\Range(min: 0, max: 100)]
  27. private $discountPercent;
  28. /**
  29. * Get id
  30. *
  31. * @return int|null
  32. */
  33. public function getId(): ?int
  34. {
  35. return $this->id;
  36. }
  37. /**
  38. * Get product
  39. *
  40. * @return Product|null
  41. */
  42. public function getProduct(): ?Product
  43. {
  44. return $this->product;
  45. }
  46. /**
  47. * Set product
  48. *
  49. * @param Product|null $product
  50. * @return $this
  51. */
  52. public function setProduct(?Product $product): self
  53. {
  54. $this->product = $product;
  55. return $this;
  56. }
  57. /**
  58. * Get company
  59. *
  60. * @return int|null
  61. */
  62. public function getCompanyId(): ?int
  63. {
  64. return $this->companyId;
  65. }
  66. /**
  67. * Set company
  68. *
  69. * @param int $companyId
  70. * @return $this
  71. */
  72. public function setCompanyId(int $companyId): self
  73. {
  74. $this->companyId = $companyId;
  75. return $this;
  76. }
  77. /**
  78. * Get price
  79. *
  80. * @return float|null
  81. */
  82. public function getPrice(): ?float
  83. {
  84. return $this->price;
  85. }
  86. /**
  87. * Set price
  88. *
  89. * @param float $price
  90. * @return $this
  91. */
  92. public function setPrice(float $price): self
  93. {
  94. $this->price = $price;
  95. return $this;
  96. }
  97. /**
  98. * Get discount percent
  99. *
  100. * @return float|null
  101. */
  102. public function getDiscountPercent(): ?float
  103. {
  104. return $this->discountPercent;
  105. }
  106. /**
  107. * Set discount percent
  108. *
  109. * @param float|null $discountPercent
  110. * @return $this
  111. */
  112. public function setDiscountPercent(?float $discountPercent): self
  113. {
  114. $this->discountPercent = $discountPercent;
  115. return $this;
  116. }
  117. }