src/Entity/GroupSessionMessage.php line 12

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