<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\ZoneRepository")
*/
class Zone
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $codezone;
/**
* @ORM\Column(type="string", length=255)
*/
private $libzone;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Pays", mappedBy="zone")
*/
private $pays;
public function __construct()
{
$this->pays = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCodezone(): ?string
{
return $this->codezone;
}
public function setCodezone(string $codezone): self
{
$this->codezone = $codezone;
return $this;
}
public function getLibzone(): ?string
{
return $this->libzone;
}
public function setLibzone(string $libzone): self
{
$this->libzone = $libzone;
return $this;
}
/**
* @return Collection|Pays[]
*/
public function getPays(): Collection
{
return $this->pays;
}
public function addPay(Pays $pay): self
{
if (!$this->pays->contains($pay)) {
$this->pays[] = $pay;
$pay->setZone($this);
}
return $this;
}
public function removePay(Pays $pay): self
{
if ($this->pays->contains($pay)) {
$this->pays->removeElement($pay);
// set the owning side to null (unless already changed)
if ($pay->getZone() === $this) {
$pay->setZone(null);
}
}
return $this;
}
}