src/ECommerceBundle/Entity/CouponHasProduct.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\ECommerceBundle\Entity;
  3. use App\ProductBundle\Entity\Product;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * Coupon
  8. * @ORM\Table("coupon_has_product")
  9. * @ORM\Entity()
  10. */
  11. class CouponHasProduct
  12. {
  13. /**
  14. * @Assert\NotBlank()
  15. * @ORM\Id
  16. * @ORM\ManyToOne(targetEntity="Coupon", inversedBy="couponHasProducts")
  17. */
  18. private ?Coupon $coupon = null;
  19. /**
  20. * @Assert\NotBlank()
  21. * @ORM\Id
  22. * @ORM\ManyToOne(targetEntity="App\ProductBundle\Entity\Product", inversedBy="couponHasProducts")
  23. */
  24. private ?Product $product = null;
  25. public function getCoupon(): ?Coupon
  26. {
  27. return $this->coupon;
  28. }
  29. public function setCoupon(?Coupon $coupon): self
  30. {
  31. $this->coupon = $coupon;
  32. return $this;
  33. }
  34. public function getProduct(): ?Product
  35. {
  36. return $this->product;
  37. }
  38. public function setProduct(?Product $product): self
  39. {
  40. $this->product = $product;
  41. return $this;
  42. }
  43. }