src/Entity/Tgi.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TgiRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassTgiRepository::class)]
  8. class Tgi
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length40)]
  15.     private ?string $gouvId null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $name null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $address1 null;
  20.     #[ORM\Column(length255nullabletrue)]
  21.     private ?string $address2 null;
  22.     #[ORM\Column(length10)]
  23.     private ?string $zipCode null;
  24.     #[ORM\Column(length255)]
  25.     private ?string $city null;
  26.     #[ORM\Column]
  27.     private ?bool $deleted null;
  28.     #[ORM\OneToMany(mappedBy'tgi'targetEntityCity::class)]
  29.     private Collection $cities;
  30.     public function __construct()
  31.     {
  32.         $this->cities = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getGouvId(): ?string
  39.     {
  40.         return $this->gouvId;
  41.     }
  42.     public function setGouvId(string $gouvId): static
  43.     {
  44.         $this->gouvId $gouvId;
  45.         return $this;
  46.     }
  47.     public function getName(): ?string
  48.     {
  49.         return $this->name;
  50.     }
  51.     public function setName(string $name): static
  52.     {
  53.         $this->name $name;
  54.         return $this;
  55.     }
  56.     public function getAddress1(): ?string
  57.     {
  58.         return $this->address1;
  59.     }
  60.     public function setAddress1(string $address1): static
  61.     {
  62.         $this->address1 $address1;
  63.         return $this;
  64.     }
  65.     public function getAddress2(): ?string
  66.     {
  67.         return $this->address2;
  68.     }
  69.     public function setAddress2(?string $address2): static
  70.     {
  71.         $this->address2 $address2;
  72.         return $this;
  73.     }
  74.     public function getZipCode(): ?string
  75.     {
  76.         return $this->zipCode;
  77.     }
  78.     public function setZipCode(string $zipCode): static
  79.     {
  80.         $this->zipCode $zipCode;
  81.         return $this;
  82.     }
  83.     public function getCity(): ?string
  84.     {
  85.         return $this->city;
  86.     }
  87.     public function setCity(string $city): static
  88.     {
  89.         $this->city $city;
  90.         return $this;
  91.     }
  92.     public function isDeleted(): ?bool
  93.     {
  94.         return $this->deleted;
  95.     }
  96.     public function setDeleted(bool $deleted): static
  97.     {
  98.         $this->deleted $deleted;
  99.         return $this;
  100.     }
  101.     /**
  102.      * @return Collection<int, City>
  103.      */
  104.     public function getCities(): Collection
  105.     {
  106.         return $this->cities;
  107.     }
  108.     public function addCity(City $city): static
  109.     {
  110.         if (!$this->cities->contains($city)) {
  111.             $this->cities->add($city);
  112.             $city->setTgi($this);
  113.         }
  114.         return $this;
  115.     }
  116.     public function removeCity(City $city): static
  117.     {
  118.         if ($this->cities->removeElement($city)) {
  119.             // set the owning side to null (unless already changed)
  120.             if ($city->getTgi() === $this) {
  121.                 $city->setTgi(null);
  122.             }
  123.         }
  124.         return $this;
  125.     }
  126. }