src/Entity/Message.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MessageRepository;
  4. use App\Entity\Traits\Timestampable;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use JMS\Serializer\Annotation\Groups;
  8. #[ORM\HasLifecycleCallbacks]
  9. #[ORM\Entity(repositoryClassMessageRepository::class)]
  10. class Message
  11. {
  12.     use Timestampable;
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     #[Groups(['chatView''singleMessage'])]
  17.     private ?int $id null;
  18.     #[ORM\Column(typeTypes::TEXT)]
  19.     #[Groups(['chatView''chatAllList''singleMessage'])]
  20.     private ?string $content null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     #[Groups(['chatView'])]
  23.     private ?string $fileName null;
  24.     #[ORM\ManyToOne(inversedBy'messages')]
  25.     #[ORM\JoinColumn(nullablefalse)]
  26.     #[Groups(['chatView''chatAllList''singleMessage'])]
  27.     private ?UserYear $author null;
  28.     #[ORM\ManyToOne(inversedBy'messages')]
  29.     #[ORM\JoinColumn(nullablefalse)]
  30.     private ?Chat $chat null;
  31.     #[ORM\Column]
  32.     #[Groups(['chatView''singleMessage'])]
  33.     private ?bool $isReaded null;
  34.     #[ORM\Column]
  35.     #[Groups(['chatView''singleMessage'])]
  36.     private ?bool $isDeleted null;
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function __toString()
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getContent(): ?string
  46.     {
  47.         return $this->content;
  48.     }
  49.     public function setContent(string $content): static
  50.     {
  51.         $this->content $content;
  52.         return $this;
  53.     }
  54.     public function getFileName(): ?string
  55.     {
  56.         return $this->fileName;
  57.     }
  58.     public function setFileName(?string $fileName): static
  59.     {
  60.         $this->fileName $fileName;
  61.         return $this;
  62.     }
  63.     public function getAuthor(): ?UserYear
  64.     {
  65.         return $this->author;
  66.     }
  67.     public function setAuthor(?UserYear $author): static
  68.     {
  69.         $this->author $author;
  70.         return $this;
  71.     }
  72.     public function getChat(): ?Chat
  73.     {
  74.         return $this->chat;
  75.     }
  76.     public function setChat(?Chat $chat): static
  77.     {
  78.         $this->chat $chat;
  79.         return $this;
  80.     }
  81.     public function isIsReaded(): ?bool
  82.     {
  83.         return $this->isReaded;
  84.     }
  85.     public function setIsReaded(bool $isReaded): static
  86.     {
  87.         $this->isReaded $isReaded;
  88.         return $this;
  89.     }
  90.     public function isIsDeleted(): ?bool
  91.     {
  92.         return $this->isDeleted;
  93.     }
  94.     public function setIsDeleted(bool $isDeleted): static
  95.     {
  96.         $this->isDeleted $isDeleted;
  97.         return $this;
  98.     }
  99. }