src/Entity/City.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\DBAL\Types\Types;
  4. use Doctrine\ORM\Mapping\Index;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Repository\CityRepository;
  7. use Gedmo\Translatable\Translatable;
  8. use App\Entity\Translation\CityTranslation;
  9. use App\Entity\Translation\PageTranslation;
  10. use Gedmo\Mapping\Annotation\TranslationEntity;
  11. use Doctrine\Common\Collections\ArrayCollection;
  12. use Gedmo\Mapping\Annotation\Locale as GedmoLocale;
  13. use Gedmo\Mapping\Annotation\Translatable as GedmoTranslatable;
  14. #[ORM\Entity(repositoryClassCityRepository::class)]
  15. // #[TranslationEntity(class: CityTranslation::class)]
  16. #[Index(name"city_fias_id"columns: ["fias_id"])]
  17. #[Index(name"city_postal_code"columns: ["postal_code"])]
  18. class City implements EntityInterface
  19. {
  20.     #[ORM\Id]
  21.     #[ORM\GeneratedValue]
  22.     #[ORM\Column]
  23.     private ?int $id null;
  24.     #[ORM\Column(type'integer')]
  25.     private ?int $region 0;
  26.     #[ORM\Column(length255)]
  27.     private ?string $fias_id null;
  28.     #[ORM\Column(length255)]
  29.     private ?string $postal_code null;
  30.     #[ORM\Column(length255)]
  31.     private ?string $type null;
  32.     #[ORM\Column(length255)]
  33.     private ?string $name null;
  34.     #[ORM\Column(typeTypes::SMALLINT)]
  35.     private ?int $prior null;
  36.     #[ORM\Column]
  37.     private ?bool $visible null;
  38.     #[ORM\Column]
  39.     private ?bool $top null;
  40.     #[ORM\Column]
  41.     private ?bool $top2 null;
  42.     // #[GedmoLocale]
  43.     // private $locale;
  44.     // #[ORM\OneToMany(targetEntity: CityTranslation::class, mappedBy: 'object', cascade: ['persist', 'remove'])]
  45.     // private $translations;
  46.     // public function __construct()
  47.     // {
  48.     //     $this->translations = new ArrayCollection();
  49.     // }
  50.     // public function setLocale($locale)
  51.     // {
  52.     //     $this->locale = $locale;
  53.     // }
  54.     // public function getTranslations()
  55.     // {
  56.     //     return $this->translations;
  57.     // }
  58.     // public function addTranslation(CityTranslation $t)
  59.     // {
  60.     //     if (!$this->translations->contains($t)) {
  61.     //         $this->translations[] = $t;
  62.     //         $t->setObject($this);
  63.     //     }
  64.     // }
  65.     public function getId(): ?int
  66.     {
  67.         return $this->id;
  68.     }
  69.     public function getRegion(): int
  70.     {
  71.         return $this->region;
  72.     }
  73.     public function setRegion(int $region): self
  74.     {
  75.         $this->region $region;
  76.         return $this;
  77.     }
  78.     public function getFiasId(): ?string
  79.     {
  80.         return $this->fias_id;
  81.     }
  82.     public function setFiasId(string $fias_id): self
  83.     {
  84.         $this->fias_id $fias_id;
  85.         return $this;
  86.     }
  87.     public function getPostalCode(): ?string
  88.     {
  89.         return $this->postal_code;
  90.     }
  91.     public function setPostalCode(string $postal_code): self
  92.     {
  93.         $this->postal_code $postal_code;
  94.         return $this;
  95.     }
  96.     public function getType(): ?string
  97.     {
  98.         return $this->type;
  99.     }
  100.     public function setType(string $type): self
  101.     {
  102.         $this->type $type;
  103.         return $this;
  104.     }
  105.     public function getName(): ?string
  106.     {
  107.         return $this->name;
  108.     }
  109.     public function setName(string $name): self
  110.     {
  111.         $this->name $name;
  112.         return $this;
  113.     }
  114.     public function getPrior(): ?int
  115.     {
  116.         return $this->prior;
  117.     }
  118.     public function setPrior(int $prior): self
  119.     {
  120.         $this->prior $prior;
  121.         return $this;
  122.     }
  123.     public function isVisible(): ?bool
  124.     {
  125.         return $this->visible;
  126.     }
  127.     public function setVisible(bool $visible): self
  128.     {
  129.         $this->visible $visible;
  130.         return $this;
  131.     }
  132.     public function isTop(): ?bool
  133.     {
  134.         return $this->top;
  135.     }
  136.     public function setTop(bool $top): self
  137.     {
  138.         $this->top $top;
  139.         return $this;
  140.     }
  141.     public function isTop2(): ?bool
  142.     {
  143.         return $this->top2;
  144.     }
  145.     public function setTop2(bool $top2): self
  146.     {
  147.         $this->top2 $top2;
  148.         return $this;
  149.     }
  150. }