src/Entity/Zone.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ZoneRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ZoneRepository::class)
  9.  */
  10. class Zone
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $titre;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=TarifZone::class, mappedBy="zoneDepart")
  24.      */
  25.     private $tarifZones;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=SocieteLivraison::class, inversedBy="zones")
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private $societeLivraison;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity=Quartier::class, inversedBy="zones")
  33.      */
  34.     private $quartier;
  35.     /**
  36.      * @ORM\ManyToMany(targetEntity=ZoneQuartier::class, mappedBy="zone")
  37.      */
  38.     private $zoneQuartiers;
  39.     /**
  40.      * @ORM\ManyToOne(targetEntity=Ville::class, inversedBy="zones")
  41.      */
  42.     private $ville;
  43.   
  44.  
  45.     public function __construct()
  46.     {
  47.         $this->tarifZones = new ArrayCollection();
  48.         $this->zoneQuartiers = new ArrayCollection();
  49.     }
  50.     public function getId(): ?int
  51.     {
  52.         return $this->id;
  53.     }
  54.     public function getTitre(): ?string
  55.     {
  56.         return $this->titre;
  57.     }
  58.     public function setTitre(string $titre): self
  59.     {
  60.         $this->titre $titre;
  61.         return $this;
  62.     }
  63.     public function getSocieteLivraison(): ?User
  64.     {
  65.         return $this->societeLivraison;
  66.     }
  67.     public function setSocieteLivraison(?SocieteLivraison $societeLivraison): self
  68.     {
  69.         $this->societeLivraison $societeLivraison;
  70.         return $this;
  71.     }
  72.     public function getQuartier(): ?Quartier
  73.     {
  74.         return $this->quartier;
  75.     }
  76.     public function setQuartier(?Quartier $quartier): self
  77.     {
  78.         $this->quartier $quartier;
  79.         return $this;
  80.     }
  81.     /**
  82.      * @return Collection<int, ZoneQuartier>
  83.      */
  84.     public function getZoneQuartiers(): Collection
  85.     {
  86.         return $this->zoneQuartiers;
  87.     }
  88.     public function addZoneQuartier(ZoneQuartier $zoneQuartier): self
  89.     {
  90.         if (!$this->zoneQuartiers->contains($zoneQuartier)) {
  91.             $this->zoneQuartiers[] = $zoneQuartier;
  92.             $zoneQuartier->addZone($this);
  93.         }
  94.         return $this;
  95.     }
  96.     public function removeZoneQuartier(ZoneQuartier $zoneQuartier): self
  97.     {
  98.         if ($this->zoneQuartiers->removeElement($zoneQuartier)) {
  99.             $zoneQuartier->removeZone($this);
  100.         }
  101.         return $this;
  102.     }
  103.     public function getVille(): ?Ville
  104.     {
  105.         return $this->ville;
  106.     }
  107.     public function setVille(?Ville $ville): self
  108.     {
  109.         $this->ville $ville;
  110.         return $this;
  111.     }
  112.   
  113. }