<?php
namespace App\Entity;
use App\Entity\Traits\BaseDateAtTrait;
use App\Repository\ChatRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ChatRepository::class)]
#[ORM\HasLifecycleCallbacks]
class Chat
{
use BaseDateAtTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'text')]
private $message;
#[ORM\OneToOne(targetEntity: Workroom::class, inversedBy: 'chat', cascade: ['persist', 'remove'])]
private $workroom;
#[ORM\Column(type: 'integer', nullable: true)]
private $counter;
public function getId(): ?int
{
return $this->id;
}
public function getMessage(): ?string
{
return $this->message;
}
/**
* @return $this
*/
public function setMessage(string $message): self
{
$this->message = $message;
return $this;
}
public function getWorkroom(): ?Workroom
{
return $this->workroom;
}
/**
* @return $this
*/
public function setWorkroom(?Workroom $workroom): self
{
$this->workroom = $workroom;
return $this;
}
public function getCounter(): ?int
{
return $this->counter;
}
public function setCounter(?int $counter): self
{
$this->counter = $counter;
return $this;
}
}