<?php
namespace App\Entity;
use App\Repository\TypeTarifsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TypeTarifsRepository::class)
*/
class TypeTarifs
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $titre;
/**
* @ORM\Column(type="text")
*/
private $description;
/**
* @ORM\ManyToOne(targetEntity=Zone::class, inversedBy="typeTarifs")
*/
private $zone;
/**
* @ORM\OneToMany(targetEntity=Tarif::class, mappedBy="typeTarifs")
*/
private $tarifs;
public function __construct()
{
$this->tarifs = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function getZone(): ?Zone
{
return $this->zone;
}
public function setZone(?Zone $zone): self
{
$this->zone = $zone;
return $this;
}
/**
* @return Collection<int, Tarif>
*/
public function getTarifs(): Collection
{
return $this->tarifs;
}
public function addTarif(Tarif $tarif): self
{
if (!$this->tarifs->contains($tarif)) {
$this->tarifs[] = $tarif;
$tarif->setTypeTarifs($this);
}
return $this;
}
public function removeTarif(Tarif $tarif): self
{
if ($this->tarifs->removeElement($tarif)) {
// set the owning side to null (unless already changed)
if ($tarif->getTypeTarifs() === $this) {
$tarif->setTypeTarifs(null);
}
}
return $this;
}
}