<?php
namespace App\Entity;
use App\Repository\HebergementRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass=HebergementRepository::class)
*/
class Hebergement
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* Slug immuable et unique (ex: "st-lucie")
* @Gedmo\Slug(fields={"name"}, updatable=true, unique=true)
* @ORM\Column(type="string", length=180, unique=true)
*/
private $slug;
/**
* @ORM\ManyToOne(targetEntity=TypeHebergement::class, inversedBy="hebergements")
*/
private $type;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $star;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $capacity;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $description;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $img;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $banner;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $adress;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $city;
/**
* @ORM\ManyToOne(targetEntity=Destination::class, inversedBy="hebergements")
*/
private $country;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $website;
/**
* @ORM\OneToMany(targetEntity=OfferHebergement::class, mappedBy="hebergement")
*/
private $offerHebergements;
public function __construct()
{
$this->offerHebergements = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getType(): ?TypeHebergement
{
return $this->type;
}
public function setType(?TypeHebergement $type): self
{
$this->type = $type;
return $this;
}
public function getStar(): ?string
{
return $this->star;
}
public function setStar(?string $star): self
{
$this->star = $star;
return $this;
}
public function getCapacity(): ?string
{
return $this->capacity;
}
public function setCapacity(?string $capacity): self
{
$this->capacity = $capacity;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getImg(): ?string
{
return $this->img;
}
public function setImg(?string $img): self
{
$this->img = $img;
return $this;
}
public function getBanner(): ?string
{
return $this->banner;
}
public function setBanner(?string $banner): self
{
$this->banner = $banner;
return $this;
}
public function getAdress(): ?string
{
return $this->adress;
}
public function setAdress(?string $adress): self
{
$this->adress = $adress;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): self
{
$this->city = $city;
return $this;
}
public function getCountry(): ?Destination
{
return $this->country;
}
public function setCountry(?Destination $country): self
{
$this->country = $country;
return $this;
}
public function getWebsite(): ?string
{
return $this->website;
}
public function setWebsite(?string $website): self
{
$this->website = $website;
return $this;
}
/**
* @return Collection<int, OfferHebergement>
*/
public function getOfferHebergements(): Collection
{
return $this->offerHebergements;
}
public function addOfferHebergement(OfferHebergement $offerHebergement): self
{
if (!$this->offerHebergements->contains($offerHebergement)) {
$this->offerHebergements[] = $offerHebergement;
$offerHebergement->setHebergement($this);
}
return $this;
}
public function removeOfferHebergement(OfferHebergement $offerHebergement): self
{
if ($this->offerHebergements->removeElement($offerHebergement)) {
// set the owning side to null (unless already changed)
if ($offerHebergement->getHebergement() === $this) {
$offerHebergement->setHebergement(null);
}
}
return $this;
}
/**
* Get slug immuable et unique (ex: "st-lucie")
*/
public function getSlug()
{
return $this->slug;
}
/**
* Set slug immuable et unique (ex: "st-lucie")
*
* @return self
*/
public function setSlug($slug)
{
$this->slug = $slug;
return $this;
}
/**
* Get the value of name
*/
public function getName()
{
return $this->name;
}
/**
* Set the value of name
*
* @return self
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
}