src/Entity/TrancheAge.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TrancheAgeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=TrancheAgeRepository::class)
  9. */
  10. class TrancheAge
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(type="integer")
  20. */
  21. private $min;
  22. /**
  23. * @ORM\Column(type="integer")
  24. */
  25. private $max;
  26. /**
  27. * @ORM\OneToMany(targetEntity=Sejour::class, mappedBy="trancheAge1")
  28. */
  29. private $sejoursMin;
  30. /**
  31. * @ORM\OneToMany(targetEntity=Sejour::class, mappedBy="trancheAge2")
  32. */
  33. private $sejoursMax;
  34. public function __construct()
  35. {
  36. $this->sejoursMin = new ArrayCollection();
  37. $this->sejoursMax = new ArrayCollection();
  38. }
  39. public function getId(): ?int
  40. {
  41. return $this->id;
  42. }
  43. public function getMin(): ?int
  44. {
  45. return $this->min;
  46. }
  47. public function setMin(int $min): self
  48. {
  49. $this->min = $min;
  50. return $this;
  51. }
  52. public function getMax(): ?int
  53. {
  54. return $this->max;
  55. }
  56. public function setMax(int $max): self
  57. {
  58. $this->max = $max;
  59. return $this;
  60. }
  61. /**
  62. * @return Collection|Sejour[]
  63. */
  64. public function getSejoursMin(): Collection
  65. {
  66. return $this->sejoursMin;
  67. }
  68. public function addSejoursMin(Sejour $sejoursMin): self
  69. {
  70. if (!$this->sejoursMin->contains($sejoursMin)) {
  71. $this->sejoursMin[] = $sejoursMin;
  72. $sejoursMin->setTrancheAge1($this);
  73. }
  74. return $this;
  75. }
  76. public function removeSejoursMin(Sejour $sejoursMin): self
  77. {
  78. if ($this->sejoursMin->removeElement($sejoursMin)) {
  79. // set the owning side to null (unless already changed)
  80. if ($sejoursMin->getTrancheAge1() === $this) {
  81. $sejoursMin->setTrancheAge1(null);
  82. }
  83. }
  84. return $this;
  85. }
  86. /**
  87. * @return Collection|Sejour[]
  88. */
  89. public function getSejoursMax(): Collection
  90. {
  91. return $this->sejoursMax;
  92. }
  93. public function addSejoursMax(Sejour $sejoursMax): self
  94. {
  95. if (!$this->sejoursMax->contains($sejoursMax)) {
  96. $this->sejoursMax[] = $sejoursMax;
  97. $sejoursMax->setTrancheAge2($this);
  98. }
  99. return $this;
  100. }
  101. public function removeSejoursMax(Sejour $sejoursMax): self
  102. {
  103. if ($this->sejoursMax->removeElement($sejoursMax)) {
  104. // set the owning side to null (unless already changed)
  105. if ($sejoursMax->getTrancheAge2() === $this) {
  106. $sejoursMax->setTrancheAge2(null);
  107. }
  108. }
  109. return $this;
  110. }
  111. }