src/Entity/Chat.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ChatRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassChatRepository::class)]
  7. class Chat
  8. {
  9.     public const DISPLAY_RIGHT 1;
  10.     public const DISPLAY_LEFT 0;
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(typeTypes::TEXT)]
  16.     private ?string $message null;
  17.     #[ORM\Column]
  18.     private ?int $sendedBy null;
  19.     #[ORM\Column]
  20.     private ?\DateTimeImmutable $addedAt null;
  21.     #[ORM\Column(nullabletrue)]
  22.     private ?\DateTimeImmutable $updatedAt null;
  23.     #[ORM\Column]
  24.     private ?int $isActive 1;
  25.     #[ORM\ManyToOne(inversedBy'chat')]
  26.     private ?Ticket $ticket null;
  27.     #[ORM\ManyToOne(inversedBy'chat')]
  28.     private ?User $user null;
  29.     public function __toString(): string
  30.     {
  31.         return $this->message;
  32.     }
  33.     public function __construct()
  34.     {
  35.         $this->setAddedAt(new \DateTimeImmutable());
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getMessage(): ?string
  42.     {
  43.         return $this->message;
  44.     }
  45.     public function setMessage(string $message): self
  46.     {
  47.         $this->message $message;
  48.         return $this;
  49.     }
  50.     public function getSendedBy(): ?int
  51.     {
  52.         return $this->sendedBy;
  53.     }
  54.     public function setSendedBy(int $sendedBy): self
  55.     {
  56.         $this->sendedBy $sendedBy;
  57.         return $this;
  58.     }
  59.     public function getAddedAt(): ?\DateTimeImmutable
  60.     {
  61.         return $this->addedAt;
  62.     }
  63.     public function setAddedAt(\DateTimeImmutable $addedAt): self
  64.     {
  65.         $this->addedAt $addedAt;
  66.         return $this;
  67.     }
  68.     public function getUpdatedAt(): ?\DateTimeImmutable
  69.     {
  70.         return $this->updatedAt;
  71.     }
  72.     public function setUpdatedAt(?\DateTimeImmutable $updatedAt): self
  73.     {
  74.         $this->updatedAt $updatedAt;
  75.         return $this;
  76.     }
  77.     public function getIsActive(): ?int
  78.     {
  79.         return $this->isActive;
  80.     }
  81.     public function setIsActive(int $isActive): self
  82.     {
  83.         $this->isActive $isActive;
  84.         return $this;
  85.     }
  86.     public function getTicket(): ?Ticket
  87.     {
  88.         return $this->ticket;
  89.     }
  90.     public function setTicket(?Ticket $ticket): self
  91.     {
  92.         $this->ticket $ticket;
  93.         return $this;
  94.     }
  95.     public function getUser(): ?User
  96.     {
  97.         return $this->user;
  98.     }
  99.     public function setUser(?User $user): self
  100.     {
  101.         $this->user $user;
  102.         return $this;
  103.     }
  104. }