src/Entity/News.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\DBAL\Types\Types;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use App\Repository\NewsRepository;
  7. use Gedmo\Timestampable\Traits\TimestampableEntity;
  8. #[ORM\Entity(repositoryClassNewsRepository::class)]
  9. class News
  10. {
  11.     use TimestampableEntity;
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $title null;
  18.     #[ORM\Column(typeTypes::TEXT)]
  19.     private ?string $content null;
  20.     #[ORM\Column(length255)]
  21.     #[Gedmo\Slug(fields: ['title'])]
  22.     protected ?string $slug null;
  23.     #[ORM\OneToOne(cascade: ['persist''remove'])]
  24.     private ?Image $image null;
  25.     #[ORM\Column]
  26.     private ?bool $featured null;
  27.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  28.     private ?string $hours null;
  29.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  30.     private ?\DateTimeInterface $beginsAt null;
  31.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  32.     private ?\DateTimeInterface $endsAt null;
  33.     public function __toString(){
  34.         return $this->title;
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getTitle(): ?string
  41.     {
  42.         return $this->title;
  43.     }
  44.     public function setTitle(string $title): self
  45.     {
  46.         $this->title $title;
  47.         return $this;
  48.     }
  49.     public function getSlug(): ?string
  50.     {
  51.         return $this->slug;
  52.     }
  53.     public function setSlug(string $slug): self
  54.     {
  55.         $this->slug $slug;
  56.         return $this;
  57.     }
  58.     public function getContent(): ?string
  59.     {
  60.         return $this->content;
  61.     }
  62.     public function setContent(string $content): self
  63.     {
  64.         $this->content $content;
  65.         return $this;
  66.     }
  67.     public function getImage(): ?Image
  68.     {
  69.         return $this->image;
  70.     }
  71.     public function setImage(?Image $image): self
  72.     {
  73.         $this->image $image;
  74.         return $this;
  75.     }
  76.     public function isFeatured(): ?bool
  77.     {
  78.         return $this->featured;
  79.     }
  80.     public function setFeatured(bool $featured): self
  81.     {
  82.         $this->featured $featured;
  83.         return $this;
  84.     }
  85.     public function getBeginsAt(): ?\DateTimeInterface
  86.     {
  87.         return $this->beginsAt;
  88.     }
  89.     public function setBeginsAt(\DateTimeInterface $beginsAt): self
  90.     {
  91.         $this->beginsAt $beginsAt;
  92.         return $this;
  93.     }
  94.     public function getEndsAt(): ?\DateTimeInterface
  95.     {
  96.         return $this->endsAt;
  97.     }
  98.     public function setEndsAt(\DateTimeInterface $endsAt): self
  99.     {
  100.         $this->endsAt $endsAt;
  101.         return $this;
  102.     }
  103.     public function getHours(): ?string
  104.     {
  105.         return $this->hours;
  106.     }
  107.     public function setHours(?string $hours): self
  108.     {
  109.         $this->hours $hours;
  110.         return $this;
  111.     }
  112. }