<?php
namespace App\Entity\Client;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Request\RequestForm;
use Doctrine\Common\Collections\Collection;
use App\Repository\Client\SupportUserRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Gedmo\Timestampable\Traits\TimestampableEntity;
#[ORM\Entity(repositoryClass: SupportUserRepository::class)]
class SupportUser
{
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $email = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $name = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $token = null;
#[ORM\ManyToOne(inversedBy: 'supportUsers')]
private ?Client $client = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $deletedAt = null;
#[ORM\OneToMany(mappedBy: 'supportUser', targetEntity: RequestForm::class)]
private Collection $requestForms;
#[ORM\Column(nullable: true)]
private ?bool $isEnable = null;
public function __construct()
{
$this->requestForms = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): static
{
$this->email = $email;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): static
{
$this->name = $name;
return $this;
}
public function getToken(): ?string
{
return $this->token;
}
public function setToken(?string $token): static
{
$this->token = $token;
return $this;
}
public function getClient(): ?Client
{
return $this->client;
}
public function setClient(?Client $client): static
{
$this->client = $client;
return $this;
}
public function getDeletedAt(): ?\DateTimeInterface
{
return $this->deletedAt;
}
public function setDeletedAt(?\DateTimeInterface $deletedAt): static
{
$this->deletedAt = $deletedAt;
return $this;
}
/**
* @return Collection<int, RequestForm>
*/
public function getRequestForms(): Collection
{
return $this->requestForms;
}
public function addRequestForm(RequestForm $requestForm): static
{
if (!$this->requestForms->contains($requestForm)) {
$this->requestForms->add($requestForm);
$requestForm->setSupportUser($this);
}
return $this;
}
public function removeRequestForm(RequestForm $requestForm): static
{
if ($this->requestForms->removeElement($requestForm)) {
// set the owning side to null (unless already changed)
if ($requestForm->getSupportUser() === $this) {
$requestForm->setSupportUser(null);
}
}
return $this;
}
public function isIsEnable(): ?bool
{
return $this->isEnable;
}
public function setIsEnable(?bool $isEnable): static
{
$this->isEnable = $isEnable;
return $this;
}
}