src/Entity/Chat.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\BaseDateAtTrait;
  4. use App\Repository\ChatRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassChatRepository::class)]
  7. #[ORM\HasLifecycleCallbacks]
  8. class Chat
  9. {
  10.     use BaseDateAtTrait;
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\Column(type'text')]
  16.     private $message;
  17.     #[ORM\OneToOne(targetEntityWorkroom::class, inversedBy'chat'cascade: ['persist''remove'])]
  18.     private $workroom;
  19.     #[ORM\Column(type'integer'nullabletrue)]
  20.     private $counter;
  21.     public function getId(): ?int
  22.     {
  23.         return $this->id;
  24.     }
  25.     public function getMessage(): ?string
  26.     {
  27.         return $this->message;
  28.     }
  29.     /**
  30.      * @return $this
  31.      */
  32.     public function setMessage(string $message): self
  33.     {
  34.         $this->message $message;
  35.         return $this;
  36.     }
  37.     public function getWorkroom(): ?Workroom
  38.     {
  39.         return $this->workroom;
  40.     }
  41.     /**
  42.      * @return $this
  43.      */
  44.     public function setWorkroom(?Workroom $workroom): self
  45.     {
  46.         $this->workroom $workroom;
  47.         return $this;
  48.     }
  49.     public function getCounter(): ?int
  50.     {
  51.         return $this->counter;
  52.     }
  53.     public function setCounter(?int $counter): self
  54.     {
  55.         $this->counter $counter;
  56.         return $this;
  57.     }
  58. }