src/Entity/Countries.php line 15

  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Trait\MainTranslationTrait;
  4. use App\Entity\Translation\CountriesTranslation;
  5. use App\Repository\CountriesRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. use Gedmo\Translatable\Translatable;
  9. #[ORM\Table(name'countries')]
  10. #[ORM\Entity(repositoryClassCountriesRepository::class)]
  11. #[Gedmo\TranslationEntity(class: CountriesTranslation::class)]
  12. class Countries implements Translatable
  13. {
  14.     use MainTranslationTrait;
  15.     const TRANSLATION_ENTITY CountriesTranslation::class;
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     private ?int $id null;
  20.     #[ORM\Column(type'string'nullabletrue)]
  21.     #[Gedmo\Translatable]
  22.     private ?string $title null;
  23.     #[ORM\Column(type'integer'nullabletrue)]
  24.     private ?int $sortOrder null;
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function __toString(): string
  30.     {
  31.         return $this->title ?? "";
  32.     }
  33.     public function getTitle(): ?string
  34.     {
  35.         return $this->title;
  36.     }
  37.     public function setTitle(?string $title): void
  38.     {
  39.         $this->title $title;
  40.     }
  41.     public function getSortOrder(): ?int
  42.     {
  43.         return $this->sortOrder;
  44.     }
  45.     public function setSortOrder(?int $sortOrder): void
  46.     {
  47.         $this->sortOrder $sortOrder;
  48.     }
  49. }