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 '';
  28.     #[ORM\Column(length255)]
  29.     private ?string $postal_code '';
  30.     #[ORM\Column(length255)]
  31.     private ?string $type '';
  32.     #[GedmoTranslatable]
  33.     #[ORM\Column(length255)]
  34.     private ?string $name '';
  35.     #[ORM\Column(length255)]
  36.     private ?string $kw '';
  37.     #[ORM\Column(typeTypes::SMALLINT)]
  38.     private ?int $prior 0;
  39.     #[ORM\Column]
  40.     private ?bool $visible true;
  41.     #[ORM\Column]
  42.     private ?bool $top false;
  43.     #[ORM\Column]
  44.     private ?bool $top2 false;
  45.     #[GedmoLocale]
  46.     private $locale;
  47.     #[ORM\OneToMany(targetEntityCityTranslation::class, mappedBy'object'cascade: ['persist''remove'])]
  48.     private $translations;
  49.     public function __construct()
  50.     {
  51.         $this->translations = new ArrayCollection();
  52.     }
  53.     public function setLocale($locale)
  54.     {
  55.         $this->locale $locale;
  56.     }
  57.     public function getTranslations()
  58.     {
  59.         return $this->translations;
  60.     }
  61.     public function addTranslation(CityTranslation $t)
  62.     {
  63.         if (!$this->translations->contains($t)) {
  64.             $this->translations[] = $t;
  65.             $t->setObject($this);
  66.         }
  67.     }
  68.     public function getId(): ?int
  69.     {
  70.         return $this->id;
  71.     }
  72.     public function getRegion(): int
  73.     {
  74.         return $this->region;
  75.     }
  76.     public function setRegion(int $region): self
  77.     {
  78.         $this->region $region;
  79.         return $this;
  80.     }
  81.     public function getFiasId(): ?string
  82.     {
  83.         return $this->fias_id;
  84.     }
  85.     public function setFiasId(string $fias_id): self
  86.     {
  87.         $this->fias_id $fias_id;
  88.         return $this;
  89.     }
  90.     public function getPostalCode(): ?string
  91.     {
  92.         return $this->postal_code;
  93.     }
  94.     public function setPostalCode(string $postal_code): self
  95.     {
  96.         $this->postal_code $postal_code;
  97.         return $this;
  98.     }
  99.     public function getType(): ?string
  100.     {
  101.         return $this->type;
  102.     }
  103.     public function setType(string $type): self
  104.     {
  105.         $this->type $type;
  106.         return $this;
  107.     }
  108.     public function getName(): ?string
  109.     {
  110.         return $this->name;
  111.     }
  112.     public function setName(string $name): self
  113.     {
  114.         $this->name $name;
  115.         return $this;
  116.     }
  117.     public function getKw(): ?string
  118.     {
  119.         return $this->kw;
  120.     }
  121.     public function setKw(string $kw): self
  122.     {
  123.         $this->kw $kw;
  124.         return $this;
  125.     }
  126.     public function getPrior(): ?int
  127.     {
  128.         return $this->prior;
  129.     }
  130.     public function setPrior(int $prior): self
  131.     {
  132.         $this->prior $prior;
  133.         return $this;
  134.     }
  135.     public function isVisible(): ?bool
  136.     {
  137.         return $this->visible;
  138.     }
  139.     public function setVisible(bool $visible): self
  140.     {
  141.         $this->visible $visible;
  142.         return $this;
  143.     }
  144.     public function isTop(): ?bool
  145.     {
  146.         return $this->top;
  147.     }
  148.     public function setTop(bool $top): self
  149.     {
  150.         $this->top $top;
  151.         return $this;
  152.     }
  153.     public function isTop2(): ?bool
  154.     {
  155.         return $this->top2;
  156.     }
  157.     public function setTop2(bool $top2): self
  158.     {
  159.         $this->top2 $top2;
  160.         return $this;
  161.     }
  162. }