<?php
namespace App\Entity;
use App\Repository\ServiceRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ServiceRepository::class)
*/
class Service
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $etat;
/**
* @ORM\ManyToMany(targetEntity=Hotel::class, inversedBy="services")
*/
private $hotel;
public function __construct()
{
$this->hotel = 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;
}
public function isEtat(): ?bool
{
return $this->etat;
}
public function setEtat(?bool $etat): self
{
$this->etat = $etat;
return $this;
}
/**
* @return Collection<int, Hotel>
*/
public function getHotel(): Collection
{
return $this->hotel;
}
public function addHotel(Hotel $hotel): self
{
if (!$this->hotel->contains($hotel)) {
$this->hotel[] = $hotel;
}
return $this;
}
public function removeHotel(Hotel $hotel): self
{
$this->hotel->removeElement($hotel);
return $this;
}
}