src/Entity/Common/Country.php line 13

  1. <?php
  2. namespace App\Entity\Common;
  3. use App\Entity\Traits\ActiveTrait;
  4. use App\Entity\Traits\DeletedTrait;
  5. use App\Model\Translation\TranslatableTrait;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
  8. #[ORM\Table(name'country')]
  9. #[ORM\Entity(repositoryClass'App\Repository\Common\CountryRepository')]
  10. class Country implements TranslatableInterface
  11. {
  12.     use DeletedTrait;
  13.     use ActiveTrait;
  14.     use TranslatableTrait;
  15.     public const C_RUSSIA 173;
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue(strategy'AUTO')]
  18.     #[ORM\Column(type'integer')]
  19.     private int $id;
  20.     #[ORM\Column(type'string'nullabletrue)]
  21.     private ?string $caption null;
  22.     #[ORM\Column(type'string')]
  23.     private string $full_caption;
  24.     #[ORM\Column(type'string')]
  25.     private string $capital;
  26.     #[ORM\Column(type'string')]
  27.     private string $region;
  28.     /**
  29.      * @return int
  30.      */
  31.     public function getId(): int
  32.     {
  33.         return $this->id;
  34.     }
  35.     /**
  36.      * @param int $id
  37.      */
  38.     public function setId(int $id): void
  39.     {
  40.         $this->id $id;
  41.     }
  42.     /**
  43.      * @return string
  44.      */
  45.     public function getFullCaption(): string
  46.     {
  47.         return $this->full_caption;
  48.     }
  49.     /**
  50.      * @param string $full_caption
  51.      */
  52.     public function setFullCaption(string $full_caption): void
  53.     {
  54.         $this->full_caption $full_caption;
  55.     }
  56.     /**
  57.      * @return string
  58.      */
  59.     public function getCapital(): string
  60.     {
  61.         return $this->capital;
  62.     }
  63.     /**
  64.      * @param string $capital
  65.      */
  66.     public function setCapital(string $capital): void
  67.     {
  68.         $this->capital $capital;
  69.     }
  70.     public function getCaption()
  71.     {
  72.         return $this->translate()->getCaption();
  73.     }
  74.     /**
  75.      * @return string
  76.      */
  77.     public function getRegion(): string
  78.     {
  79.         return $this->region;
  80.     }
  81.     /**
  82.      * @param string $region
  83.      */
  84.     public function setRegion(string $region): void
  85.     {
  86.         $this->region $region;
  87.     }
  88. }