<?phpnamespace App\Entity;use App\Repository\TypeHebergementRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=TypeHebergementRepository::class) */class TypeHebergement{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $name; /** * @ORM\OneToMany(targetEntity=Hebergement::class, mappedBy="type") */ private $hebergements; /** * @ORM\OneToMany(targetEntity=Offer::class, mappedBy="type") */ private $offers; public function __construct() { $this->hebergements = new ArrayCollection(); $this->offers = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(?string $name): self { $this->name = $name; return $this; } /** * @return Collection<int, Hebergement> */ public function getHebergements(): Collection { return $this->hebergements; } public function addHebergement(Hebergement $hebergement): self { if (!$this->hebergements->contains($hebergement)) { $this->hebergements[] = $hebergement; $hebergement->setType($this); } return $this; } public function removeHebergement(Hebergement $hebergement): self { if ($this->hebergements->removeElement($hebergement)) { // set the owning side to null (unless already changed) if ($hebergement->getType() === $this) { $hebergement->setType(null); } } return $this; } /** * @return Collection<int, Offer> */ public function getOffers(): Collection { return $this->offers; } public function addOffer(Offer $offer): self { if (!$this->offers->contains($offer)) { $this->offers[] = $offer; $offer->setType($this); } return $this; } public function removeOffer(Offer $offer): self { if ($this->offers->removeElement($offer)) { // set the owning side to null (unless already changed) if ($offer->getType() === $this) { $offer->setType(null); } } return $this; }}