<?php
namespace App\Entity;
use App\Repository\TicketReplyRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: TicketReplyRepository::class)]
class TicketReply
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;
#[ORM\Column(type: 'text')]
#[Assert\NotBlank(message: 'Die Antwort darf nicht leer sein.')]
private ?string $content = null;
#[ORM\Column(type: 'datetime')]
private ?\DateTimeInterface $createdAt = null;
#[ORM\ManyToOne(targetEntity: Ticket::class, inversedBy: 'replies')]
#[ORM\JoinColumn(nullable: false)]
private ?Ticket $ticket = null;
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: false)]
private ?User $author = null;
#[ORM\Column(type: 'boolean')]
private bool $userIsRead = false;
#[ORM\Column(type: 'boolean')]
private bool $adminIsRead = false;
public function __construct()
{
// Set creation time
$this->createdAt = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): self
{
$this->content = $content;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getTicket(): ?Ticket
{
return $this->ticket;
}
public function setTicket(?Ticket $ticket): self
{
$this->ticket = $ticket;
return $this;
}
public function getAuthor(): ?User
{
return $this->author;
}
public function setAuthor(?User $author): self
{
$this->author = $author;
return $this;
}
public function getUserIsRead(): bool
{
return $this->userIsRead;
}
public function setUserIsRead(bool $userIsRead): self
{
$this->userIsRead = $userIsRead;
return $this;
}
public function getAdminIsRead(): bool
{
return $this->adminIsRead;
}
public function setAdminIsRead(bool $adminIsRead): self
{
$this->adminIsRead = $adminIsRead;
return $this;
}
}