src/Entity/AuxCountry.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AuxCountryRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=AuxCountryRepository::class)
  9.  */
  10. class AuxCountry
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=50)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=2)
  24.      */
  25.     private $iso_code;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=AuxCity::class, mappedBy="aux_country")
  28.      */
  29.     private $auxCities;
  30.     /**
  31.      * @ORM\Column(type="string", length=50)
  32.      */
  33.     private $name_eng;
  34.     public function __construct()
  35.     {
  36.         $this->auxCities = new ArrayCollection();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getName(): ?string
  43.     {
  44.         return $this->name;
  45.     }
  46.     public function setName(string $name): self
  47.     {
  48.         $this->name $name;
  49.         return $this;
  50.     }
  51.     public function getIsoCode(): ?string
  52.     {
  53.         return $this->iso_code;
  54.     }
  55.     public function setIsoCode(string $iso_code): self
  56.     {
  57.         $this->iso_code $iso_code;
  58.         return $this;
  59.     }
  60.     /**
  61.      * @return Collection<int, AuxCity>
  62.      */
  63.     public function getAuxCities(): Collection
  64.     {
  65.         return $this->auxCities;
  66.     }
  67.     public function addAuxCity(AuxCity $auxCity): self
  68.     {
  69.         if (!$this->auxCities->contains($auxCity)) {
  70.             $this->auxCities[] = $auxCity;
  71.             $auxCity->setAuxCountry($this);
  72.         }
  73.         return $this;
  74.     }
  75.     public function removeAuxCity(AuxCity $auxCity): self
  76.     {
  77.         if ($this->auxCities->removeElement($auxCity)) {
  78.             // set the owning side to null (unless already changed)
  79.             if ($auxCity->getAuxCountry() === $this) {
  80.                 $auxCity->setAuxCountry(null);
  81.             }
  82.         }
  83.         return $this;
  84.     }
  85.     public function getNameEng(): ?string
  86.     {
  87.         return $this->name_eng;
  88.     }
  89.     public function setNameEng(string $name_eng): self
  90.     {
  91.         $this->name_eng $name_eng;
  92.         return $this;
  93.     }
  94. }