<?php
namespace App\Entity;
use App\Repository\ZoneRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ZoneRepository::class)
*/
class Zone
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $titre;
/**
* @ORM\OneToMany(targetEntity=TarifZone::class, mappedBy="zoneDepart")
*/
private $tarifZones;
/**
* @ORM\ManyToOne(targetEntity=SocieteLivraison::class, inversedBy="zones")
* @ORM\JoinColumn(nullable=false)
*/
private $societeLivraison;
/**
* @ORM\ManyToOne(targetEntity=Quartier::class, inversedBy="zones")
*/
private $quartier;
/**
* @ORM\ManyToMany(targetEntity=ZoneQuartier::class, mappedBy="zone")
*/
private $zoneQuartiers;
/**
* @ORM\ManyToOne(targetEntity=Ville::class, inversedBy="zones")
*/
private $ville;
public function __construct()
{
$this->tarifZones = new ArrayCollection();
$this->zoneQuartiers = 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 getSocieteLivraison(): ?User
{
return $this->societeLivraison;
}
public function setSocieteLivraison(?SocieteLivraison $societeLivraison): self
{
$this->societeLivraison = $societeLivraison;
return $this;
}
public function getQuartier(): ?Quartier
{
return $this->quartier;
}
public function setQuartier(?Quartier $quartier): self
{
$this->quartier = $quartier;
return $this;
}
/**
* @return Collection<int, ZoneQuartier>
*/
public function getZoneQuartiers(): Collection
{
return $this->zoneQuartiers;
}
public function addZoneQuartier(ZoneQuartier $zoneQuartier): self
{
if (!$this->zoneQuartiers->contains($zoneQuartier)) {
$this->zoneQuartiers[] = $zoneQuartier;
$zoneQuartier->addZone($this);
}
return $this;
}
public function removeZoneQuartier(ZoneQuartier $zoneQuartier): self
{
if ($this->zoneQuartiers->removeElement($zoneQuartier)) {
$zoneQuartier->removeZone($this);
}
return $this;
}
public function getVille(): ?Ville
{
return $this->ville;
}
public function setVille(?Ville $ville): self
{
$this->ville = $ville;
return $this;
}
}