src/Entity/OrderProductSurface.php line 69

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OrderProductSurfaceRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use JsonSerializable;
  6. #[ORM\Entity(repositoryClass: OrderProductSurfaceRepository::class)]
  7. class OrderProductSurface implements JsonSerializable
  8. {
  9. #[ORM\Id]
  10. #[ORM\GeneratedValue]
  11. #[ORM\Column(type: 'integer')]
  12. private $id;
  13. #[ORM\ManyToOne(targetEntity: OrderProduct::class, inversedBy: 'surfaces')]
  14. #[ORM\JoinColumn(nullable: false)]
  15. private $orderProduct;
  16. #[ORM\Column(type: 'integer')]
  17. private $qte;
  18. #[ORM\ManyToOne(targetEntity: SurfaceReboisement::class, inversedBy: 'orderProductSurfaces')]
  19. #[ORM\JoinColumn(nullable: false)]
  20. private $surface;
  21. public function getId(): ?int
  22. {
  23. return $this->id;
  24. }
  25. public function getOrderProduct(): ?OrderProduct
  26. {
  27. return $this->orderProduct;
  28. }
  29. public function setOrderProduct(?OrderProduct $orderProduct): self
  30. {
  31. $this->orderProduct = $orderProduct;
  32. return $this;
  33. }
  34. public function getQte(): ?int
  35. {
  36. return $this->qte;
  37. }
  38. public function setQte(int $qte): self
  39. {
  40. $this->qte = $qte;
  41. return $this;
  42. }
  43. public function getSurface(): ?SurfaceReboisement
  44. {
  45. return $this->surface;
  46. }
  47. public function setSurface(?SurfaceReboisement $surface): self
  48. {
  49. $this->surface = $surface;
  50. return $this;
  51. }
  52. public function jsonSerialize()
  53. {
  54. $vars = get_object_vars($this);
  55. unset($vars["orderProduct"]);
  56. return $vars;
  57. }
  58. }