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. use Symfony\UX\Turbo\Attribute\Broadcast;
  7. #[ORM\Entity(repositoryClassMessageRepository::class)]
  8. #[Broadcast]
  9. class Message
  10. {
  11.     use IdentifiableTrait;
  12.     #[ORM\ManyToOne(inversedBy'senderMessages')]
  13.     #[ORM\JoinColumn(nullablefalse)]
  14.     private ?User $sender null;
  15.     #[ORM\ManyToOne(inversedBy'messages')]
  16.     #[ORM\JoinColumn(nullablefalse)]
  17.     private ?MessageReceiver $receiver null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $subject null;
  20.     #[ORM\Column(typeTypes::TEXT)]
  21.     private ?string $body null;
  22.     #[ORM\Column]
  23.     private ?\DateTimeImmutable $created_at null;
  24.     #[ORM\ManyToOne(inversedBy'messages')]
  25.     #[ORM\JoinColumn(nullablefalse)]
  26.     private ?MessageStatus $status null;
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getSender(): ?User
  32.     {
  33.         return $this->sender;
  34.     }
  35.     public function setSender(?User $sender): self
  36.     {
  37.         $this->sender $sender;
  38.         return $this;
  39.     }
  40.     public function getReceiver(): ?MessageReceiver
  41.     {
  42.         return $this->receiver;
  43.     }
  44.     public function setReceiver(?MessageReceiver $receiver): self
  45.     {
  46.         $this->receiver $receiver;
  47.         return $this;
  48.     }
  49.     public function getBody(): ?string
  50.     {
  51.         return $this->body;
  52.     }
  53.     public function setBody(string $body): self
  54.     {
  55.         $this->body $body;
  56.         return $this;
  57.     }
  58.     public function getSubject(): ?string
  59.     {
  60.         return $this->subject;
  61.     }
  62.     public function setSubject(string $subject): self
  63.     {
  64.         $this->subject $subject;
  65.         return $this;
  66.     }
  67.     public function getCreatedAt(): ?\DateTimeImmutable
  68.     {
  69.         return $this->created_at;
  70.     }
  71.     public function setCreatedAt(\DateTimeImmutable $created_at): self
  72.     {
  73.         $this->created_at $created_at;
  74.         return $this;
  75.     }
  76.     public function getStatus(): ?MessageStatus
  77.     {
  78.         return $this->status;
  79.     }
  80.     public function setStatus(?MessageStatus $status): self
  81.     {
  82.         $this->status $status;
  83.         return $this;
  84.     }
  85. }