src/Entity/Blog.php line 15

  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Trait\MainTranslationTrait;
  4. use App\Entity\Translation\BlogTranslation;
  5. use App\Repository\BlogRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. use Gedmo\Translatable\Translatable;
  9. #[ORM\Table(name'blog')]
  10. #[ORM\Entity(repositoryClassBlogRepository::class)]
  11. #[Gedmo\TranslationEntity(class: BlogTranslation::class)]
  12. class Blog implements Translatable
  13. {
  14.     use MainTranslationTrait;
  15.     const TRANSLATION_ENTITY BlogTranslation::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'string',uniquetrue)]
  24.     #[Gedmo\Slug(fields: ['title'])]
  25.     private string $slug;
  26.     #[ORM\Column(type'text'nullabletrue)]
  27.     #[Gedmo\Translatable]
  28.     private ?string $body null;
  29.     #[ORM\Column(type'string'nullabletrue)]
  30.     private ?string $image null;
  31.     #[ORM\Column(type'string',length160nullabletrue)]
  32.     #[Gedmo\Translatable]
  33.     private ?string $metaKeywords null;
  34.     #[ORM\Column(type'string',length160nullabletrue)]
  35.     #[Gedmo\Translatable]
  36.     private ?string $metaDescription null;
  37.     #[ORM\Column(type'string'nullabletrue)]
  38.     private ?string $imageList null;
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function __toString(): string
  44.     {
  45.         return $this->title ?? "";
  46.     }
  47.     public function getTitle(): ?string
  48.     {
  49.         return $this->title;
  50.     }
  51.     public function setTitle(?string $title): void
  52.     {
  53.         $this->title $title;
  54.     }
  55.     public function getSlug(): string
  56.     {
  57.         return $this->slug;
  58.     }
  59.     public function setSlug(string $slug): void
  60.     {
  61.         $this->slug $slug;
  62.     }
  63.     public function getBody(): ?string
  64.     {
  65.         return $this->body;
  66.     }
  67.     public function setBody(?string $body): void
  68.     {
  69.         $this->body $body;
  70.     }
  71.     public function getImage(): ?string
  72.     {
  73.         return $this->image;
  74.     }
  75.     public function setImage(?string $image): void
  76.     {
  77.         $this->image $image;
  78.     }
  79.     public function getImageList(): ?string
  80.     {
  81.         return $this->imageList;
  82.     }
  83.     public function setImageList(?string $imageList): void
  84.     {
  85.         $this->imageList $imageList;
  86.     }
  87.     public function getMetaKeywords(): ?string
  88.     {
  89.         return $this->metaKeywords;
  90.     }
  91.     public function setMetaKeywords(?string $metaKeywords): void
  92.     {
  93.         $this->metaKeywords $metaKeywords;
  94.     }
  95.     public function getMetaDescription(): ?string
  96.     {
  97.         return $this->metaDescription;
  98.     }
  99.     public function setMetaDescription(?string $metaDescription): void
  100.     {
  101.         $this->metaDescription $metaDescription;
  102.     }
  103. }