src/Entity/Heroes.php line 15

  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Trait\MainTranslationTrait;
  4. use App\Entity\Translation\HeroesTranslation;
  5. use App\Repository\HeroesRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. use Gedmo\Translatable\Translatable;
  9. #[ORM\Table(name'heroes')]
  10. #[ORM\Entity(repositoryClassHeroesRepository::class)]
  11. #[Gedmo\TranslationEntity(class: HeroesTranslation::class)]
  12. class Heroes implements Translatable
  13. {
  14.     use MainTranslationTrait;
  15.     const TRANSLATION_ENTITY HeroesTranslation::class;
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     private ?int $id null;
  20.     public function getId(): ?int
  21.     {
  22.         return $this->id;
  23.     }
  24.     #[ORM\Column(type'string'nullabletrue)]
  25.     #[Gedmo\Translatable]
  26.     private ?string $title null;
  27.     #[ORM\Column(type'text'nullabletrue)]
  28.     #[Gedmo\Translatable]
  29.     private ?string $description null;
  30.     #[ORM\Column(type'string'nullabletrue)]
  31.     private ?string $image null;
  32.     #[ORM\Column(type'string'nullabletrue)]
  33.     private ?string $imageMedium null;
  34.     #[ORM\Column(type'string'nullabletrue)]
  35.     private ?string $imageSmall null;
  36.     public function __toString(): string
  37.     {
  38.         return $this->title ?? "";
  39.     }
  40.     public function getTitle(): ?string
  41.     {
  42.         return $this->title;
  43.     }
  44.     public function setTitle(?string $title): static
  45.     {
  46.         $this->title $title;
  47.         return $this;
  48.     }
  49.     public function getDescription(): ?string
  50.     {
  51.         return $this->description;
  52.     }
  53.     public function setDescription(?string $description): void
  54.     {
  55.         $this->description $description;
  56.     }
  57.     public function getImage(): ?string
  58.     {
  59.         return $this->image;
  60.     }
  61.     public function setImage(?string $image): void
  62.     {
  63.         $this->image $image;
  64.     }
  65.     public function getImageMedium(): ?string
  66.     {
  67.         return $this->imageMedium;
  68.     }
  69.     public function setImageMedium(?string $imageMedium): void
  70.     {
  71.         $this->imageMedium $imageMedium;
  72.     }
  73.     public function getImageSmall(): ?string
  74.     {
  75.         return $this->imageSmall;
  76.     }
  77.     public function setImageSmall(?string $imageSmall): void
  78.     {
  79.         $this->imageSmall $imageSmall;
  80.     }
  81. }