src/Entity/Post.php line 22

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4.  * This file is part of the ArtHotel Naquera website.
  5.  *
  6.  * For the full copyright and license information,
  7.  * please read the LICENSE.md file that was distributed with this source code.
  8.  *
  9.  * Copyright (c) 2023.
  10.  */
  11. namespace App\Entity;
  12. use App\Repository\PostRepository;
  13. use Doctrine\DBAL\Types\Types;
  14. use Doctrine\ORM\Mapping as ORM;
  15. use Gedmo\Mapping\Annotation as Gedmo;
  16. #[ORM\Entity(repositoryClass: PostRepository::class)]
  17. class Post
  18. {
  19.     #[ORM\Id]
  20.     #[ORM\GeneratedValue]
  21.     #[ORM\Column]
  22.     private ?int $id = null;
  23.     #[ORM\Column(length: 2)]
  24.     private ?string $language = null;
  25.     #[ORM\Column(length: 255)]
  26.     private string $title = '';
  27.     #[ORM\Column(length: 255)]
  28.     private string $subtitle = '';
  29.     #[ORM\Column(length: 50)]
  30.     private string $slug = '';
  31.     #[ORM\Column(length: 255)]
  32.     private string $image = '';
  33.     #[ORM\Column(type: Types::TEXT)]
  34.     private string $text = '';
  35.     #[Gedmo\Timestampable(on: 'create')]
  36.     #[ORM\Column(type: Types::DATETIME_MUTABLE)]
  37.     private \DateTime $createdAt;
  38.     #[ORM\Column(type: Types::BOOLEAN)]
  39.     private bool $published;
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getLanguage(): ?string
  45.     {
  46.         return $this->language;
  47.     }
  48.     public function setLanguage(string $language): self
  49.     {
  50.         $this->language = $language;
  51.         return $this;
  52.     }
  53.     public function getTitle(): string
  54.     {
  55.         return $this->title;
  56.     }
  57.     public function setTitle(string $title): self
  58.     {
  59.         $this->title = $title;
  60.         return $this;
  61.     }
  62.     public function getSubtitle(): string
  63.     {
  64.         return $this->subtitle;
  65.     }
  66.     public function setSubtitle(?string $subtitle): self
  67.     {
  68.         $this->subtitle = $subtitle;
  69.         return $this;
  70.     }
  71.     public function getImage(): string
  72.     {
  73.         return $this->image;
  74.     }
  75.     public function setImage(string $image): self
  76.     {
  77.         $this->image = $image;
  78.         return $this;
  79.     }
  80.     public function getText(): ?string
  81.     {
  82.         return $this->text;
  83.     }
  84.     public function setText(string $text): self
  85.     {
  86.         $this->text = $text;
  87.         return $this;
  88.     }
  89.     public function getCreatedAt(): \DateTime
  90.     {
  91.         return $this->createdAt;
  92.     }
  93.     public function setCreatedAt(\DateTime $createdAt): void
  94.     {
  95.         $this->createdAt = $createdAt;
  96.     }
  97.     public function isPublished(): bool
  98.     {
  99.         return $this->published;
  100.     }
  101.     public function setPublished(bool $published): void
  102.     {
  103.         $this->published = $published;
  104.     }
  105.     public function getSlug(): string
  106.     {
  107.         return $this->slug;
  108.     }
  109.     public function setSlug(string $slug): void
  110.     {
  111.         $this->slug = $slug;
  112.     }
  113. }