src/Entity/City.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\ToStringNameTrait;
  4. use App\Repository\CityRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=CityRepository::class)
  8.  */
  9. class City
  10. {
  11.     use ToStringNameTrait;
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column
  16.      */
  17.     private ?int $id null;
  18.     /**
  19.      * @ORM\Column(length=255)
  20.      */
  21.     private ?string $name null;
  22.     /**
  23.      * @ORM\Column(length=255)
  24.      */
  25.     private ?string $citName null;
  26.     /**
  27.      * @ORM\ManyToOne(inversedBy="cities")
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private ?County $county null;
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getName(): ?string
  36.     {
  37.         return $this->name;
  38.     }
  39.     public function setName(string $name): static
  40.     {
  41.         $this->name $name;
  42.         return $this;
  43.     }
  44.     public function getCitName(): ?string
  45.     {
  46.         return $this->citName;
  47.     }
  48.     public function setCitName(string $citName): static
  49.     {
  50.         $this->citName $citName;
  51.         return $this;
  52.     }
  53.     public function getCounty(): ?County
  54.     {
  55.         return $this->county;
  56.     }
  57.     public function setCounty(?County $county): static
  58.     {
  59.         $this->county $county;
  60.         return $this;
  61.     }
  62. }