<?phpnamespace App\Entity;use App\Repository\TrancheAgeRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=TrancheAgeRepository::class) */class TrancheAge{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="integer") */ private $min; /** * @ORM\Column(type="integer") */ private $max; /** * @ORM\OneToMany(targetEntity=Sejour::class, mappedBy="trancheAge1") */ private $sejoursMin; /** * @ORM\OneToMany(targetEntity=Sejour::class, mappedBy="trancheAge2") */ private $sejoursMax; public function __construct() { $this->sejoursMin = new ArrayCollection(); $this->sejoursMax = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getMin(): ?int { return $this->min; } public function setMin(int $min): self { $this->min = $min; return $this; } public function getMax(): ?int { return $this->max; } public function setMax(int $max): self { $this->max = $max; return $this; } /** * @return Collection|Sejour[] */ public function getSejoursMin(): Collection { return $this->sejoursMin; } public function addSejoursMin(Sejour $sejoursMin): self { if (!$this->sejoursMin->contains($sejoursMin)) { $this->sejoursMin[] = $sejoursMin; $sejoursMin->setTrancheAge1($this); } return $this; } public function removeSejoursMin(Sejour $sejoursMin): self { if ($this->sejoursMin->removeElement($sejoursMin)) { // set the owning side to null (unless already changed) if ($sejoursMin->getTrancheAge1() === $this) { $sejoursMin->setTrancheAge1(null); } } return $this; } /** * @return Collection|Sejour[] */ public function getSejoursMax(): Collection { return $this->sejoursMax; } public function addSejoursMax(Sejour $sejoursMax): self { if (!$this->sejoursMax->contains($sejoursMax)) { $this->sejoursMax[] = $sejoursMax; $sejoursMax->setTrancheAge2($this); } return $this; } public function removeSejoursMax(Sejour $sejoursMax): self { if ($this->sejoursMax->removeElement($sejoursMax)) { // set the owning side to null (unless already changed) if ($sejoursMax->getTrancheAge2() === $this) { $sejoursMax->setTrancheAge2(null); } } return $this; }}