src/Entity/ForumPost.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ForumPostRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. /**
  7.  * @ORM\Entity(repositoryClass=ForumPostRepository::class)
  8.  */
  9. class ForumPost
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      * @Groups("post")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="text", nullable=true)
  20.      * @Groups("post")
  21.      */
  22.     private $content;
  23.     /**
  24.      * @ORM\Column(type="string", nullable=true)
  25.      * @Groups("post")
  26.      */
  27.     private $createdAt;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity=Forum::class, inversedBy="post")
  30.      */
  31.     private $forum;
  32.     /**
  33.      * @ORM\ManyToOne(targetEntity=ForumTopic::class, inversedBy="posts")
  34.      * @Groups("post")
  35.      */
  36.     private $forumTopic;
  37.     /**
  38.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="forumPosts")
  39.      * @Groups("post")
  40.      */
  41.     private $user;
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getContent(): ?string
  47.     {
  48.         return $this->content;
  49.     }
  50.     public function setContent(?string $content): self
  51.     {
  52.         $this->content $content;
  53.         return $this;
  54.     }
  55.     public function getForum(): ?Forum
  56.     {
  57.         return $this->forum;
  58.     }
  59.     public function setForum(?Forum $forum): self
  60.     {
  61.         $this->forum $forum;
  62.         return $this;
  63.     }
  64.     public function getForumTopic(): ?ForumTopic
  65.     {
  66.         return $this->forumTopic;
  67.     }
  68.     public function setForumTopic(?ForumTopic $forumTopic): self
  69.     {
  70.         $this->forumTopic $forumTopic;
  71.         return $this;
  72.     }
  73.     public function getUser(): ?User
  74.     {
  75.         return $this->user;
  76.     }
  77.     public function setUser(?User $user): self
  78.     {
  79.         $this->user $user;
  80.         return $this;
  81.     }
  82.     public function getCreatedAt(): ?string
  83.     {
  84.         return $this->createdAt;
  85.     }
  86.     public function setCreatedAt(?string $createdAt): self
  87.     {
  88.         $this->createdAt $createdAt;
  89.         return $this;
  90.     }
  91. }