src/Entity/Geo/District.php line 16

  1. <?php
  2. namespace App\Entity\Geo;
  3. use App\Entity\Traits\ActiveTrait;
  4. use App\Entity\Traits\TrackerFields;
  5. use App\Entity\Traits\UserCreatedInterface;
  6. use App\Entity\Traits\UserUpdatedInterface;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. #[ORM\Table(name'federal_district')]
  11. #[ORM\Entity(repositoryClass'App\Repository\Geo\DistrictRepository')]
  12. #[ORM\HasLifecycleCallbacks]
  13. class District implements UserCreatedInterfaceUserUpdatedInterface
  14. {
  15.     use TrackerFields;
  16.     use ActiveTrait;
  17.     /**
  18.      * @var ?int
  19.      */
  20.     #[ORM\Id]
  21.     #[ORM\GeneratedValue(strategy'AUTO')]
  22.     #[ORM\Column(type'integer')]
  23.     private $id;
  24.     /**
  25.      * @var ?string
  26.      */
  27.     #[ORM\Column(type'string')]
  28.     private $caption;
  29.     /**
  30.      * @var ?string
  31.      */
  32.     #[ORM\Column(type'string'nullabletrue)]
  33.     private $short_caption;
  34.     /**
  35.      * @var int
  36.      */
  37.     #[ORM\Column(type'integer'nullablefalseoptions: ['default' => 10])]
  38.     private $weight 10;
  39.     /**
  40.      * @var ArrayCollection
  41.      */
  42.     #[ORM\OneToMany(targetEntity'App\Entity\Geo\Region'mappedBy'district')]
  43.     private $regions;
  44.     /**
  45.      * @return int|null
  46.      */
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     /**
  52.      * @param int|null $id
  53.      */
  54.     public function setId(?int $id): void
  55.     {
  56.         $this->id $id;
  57.     }
  58.     /**
  59.      * @return string|null
  60.      */
  61.     public function getCaption(): ?string
  62.     {
  63.         return $this->caption;
  64.     }
  65.     /**
  66.      * @param string|null $caption
  67.      */
  68.     public function setCaption(?string $caption): void
  69.     {
  70.         $this->caption $caption;
  71.     }
  72.     /**
  73.      * @return string|null
  74.      */
  75.     public function getShortCaption(): ?string
  76.     {
  77.         return $this->short_caption;
  78.     }
  79.     /**
  80.      * @param string|null $short_caption
  81.      */
  82.     public function setShortCaption(?string $short_caption): void
  83.     {
  84.         $this->short_caption $short_caption;
  85.     }
  86.     /**
  87.      * @return int
  88.      */
  89.     public function getWeight(): int
  90.     {
  91.         return $this->weight;
  92.     }
  93.     /**
  94.      * @param int $weight
  95.      */
  96.     public function setWeight(int $weight): void
  97.     {
  98.         $this->weight $weight;
  99.     }
  100.     /**
  101.      * @return Collection
  102.      */
  103.     public function getRegions(): Collection
  104.     {
  105.         return $this->regions;
  106.     }
  107.     /**
  108.      * @param Collection $regions
  109.      */
  110.     public function setRegions(Collection $regions): void
  111.     {
  112.         $this->regions $regions;
  113.     }
  114. }