src/Entity/Message.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MessageRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=MessageRepository::class)
  8.  */
  9. class Message
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="text")
  19.      */
  20.     private $content;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="messages")
  23.      * @ORM\JoinColumn(nullable=false)
  24.      */
  25.     private $writer;
  26.     /**
  27.      * @ORM\Column(type="boolean")
  28.      */
  29.     private $unseen;
  30.     /**
  31.      * @ORM\Column(type="datetime_immutable")
  32.      */
  33.     private $sendAt;
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity=Room::class, inversedBy="messages")
  36.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  37.      */
  38.     private $room;
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getContent(): ?string
  44.     {
  45.         return $this->content;
  46.     }
  47.     public function setContent(string $content): self
  48.     {
  49.         $this->content $content;
  50.         return $this;
  51.     }
  52.     public function getWriter(): ?User
  53.     {
  54.         return $this->writer;
  55.     }
  56.     public function setWriter(?User $writer): self
  57.     {
  58.         $this->writer $writer;
  59.         return $this;
  60.     }
  61.     public function getUnseen(): ?bool
  62.     {
  63.         return $this->unseen;
  64.     }
  65.     public function setUnseen(bool $unseen): self
  66.     {
  67.         $this->unseen $unseen;
  68.         return $this;
  69.     }
  70.     public function getSendAt(): ?\DateTimeImmutable
  71.     {
  72.         return $this->sendAt;
  73.     }
  74.     public function setSendAt(\DateTimeImmutable $sendAt): self
  75.     {
  76.         $this->sendAt $sendAt;
  77.         return $this;
  78.     }
  79.     public function getRoom(): ?Room
  80.     {
  81.         return $this->room;
  82.     }
  83.     public function setRoom(?Room $room): self
  84.     {
  85.         $this->room $room;
  86.         return $this;
  87.     }
  88.     public function isUnseen(): ?bool
  89.     {
  90.         return $this->unseen;
  91.     }
  92. }