<?php
namespace App\Entity;
use App\Repository\ClientRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ClientRepository::class)]
class Client
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $createdAt = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $address = null;
#[ORM\OneToMany(targetEntity: Employee::class, mappedBy: 'client')]
private Collection $employees;
#[ORM\Column]
private ?bool $deleted = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $emailAddress = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $tva = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $phone = null;
#[ORM\OneToMany(targetEntity: ReviewForm::class, mappedBy: 'clientId')]
private Collection $review_form_id;
public function __construct()
{
$this->employees = new ArrayCollection();
$this->review_form_id = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(?string $address): static
{
$this->address = $address;
return $this;
}
/**
* @return Collection<int, Employee>
*/
public function getEmployees(): Collection
{
return $this->employees;
}
public function addEmployee(Employee $employee): static
{
if (!$this->employees->contains($employee)) {
$this->employees->add($employee);
$employee->setClient($this);
}
return $this;
}
public function removeEmployee(Employee $employee): static
{
if ($this->employees->removeElement($employee)) {
// set the owning side to null (unless already changed)
if ($employee->getClient() === $this) {
$employee->setClient(null);
}
}
return $this;
}
public function isDeleted(): ?bool
{
return $this->deleted;
}
public function setDeleted(bool $deleted): static
{
$this->deleted = $deleted;
return $this;
}
public function getEmailAddress(): ?string
{
return $this->emailAddress;
}
public function setEmailAddress(?string $emailAddress): static
{
$this->emailAddress = $emailAddress;
return $this;
}
public function getTva(): ?string
{
return $this->tva;
}
public function setTva(?string $tva): static
{
$this->tva = $tva;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): static
{
$this->phone = $phone;
return $this;
}
/**
* @return Collection<int, ReviewForm>
*/
public function getReviewFormId(): Collection
{
return $this->review_form_id;
}
public function addReviewFormId(ReviewForm $reviewFormId): static
{
if (!$this->review_form_id->contains($reviewFormId)) {
$this->review_form_id->add($reviewFormId);
$reviewFormId->setClientId($this);
}
return $this;
}
public function removeReviewFormId(ReviewForm $reviewFormId): static
{
if ($this->review_form_id->removeElement($reviewFormId)) {
// set the owning side to null (unless already changed)
if ($reviewFormId->getClientId() === $this) {
$reviewFormId->setClientId(null);
}
}
return $this;
}
}