<?php
namespace App\Entity;
use App\Repository\EmployeeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: EmployeeRepository::class)]
class Employee
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $firstname = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $lastname = null;
#[ORM\Column(length: 255)]
private ?string $email = null;
#[ORM\ManyToOne(inversedBy: 'employees')]
private ?ReviewForm $reviewForm = null;
#[ORM\Column]
private ?bool $deleted = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $createdAt = null;
#[ORM\ManyToOne(inversedBy: 'employees')]
private ?Client $client = null;
#[ORM\OneToMany(targetEntity: Session::class, mappedBy: 'employee')]
private Collection $sessions;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $birthdate = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $employee_function = null;
public function __construct()
{
$this->sessions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getFirstname(): ?string
{
return $this->firstname;
}
public function setFirstname(?string $firstname): static
{
$this->firstname = $firstname;
return $this;
}
public function getLastname(): ?string
{
return $this->lastname;
}
public function setLastname(?string $lastname): static
{
$this->lastname = $lastname;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): static
{
$this->email = $email;
return $this;
}
public function getReviewForm(): ?ReviewForm
{
return $this->reviewForm;
}
public function setReviewForm(?ReviewForm $reviewForm): static
{
$this->reviewForm = $reviewForm;
return $this;
}
public function isDeleted(): ?bool
{
return $this->deleted;
}
public function setDeleted(bool $deleted): static
{
$this->deleted = $deleted;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
public function getClient(): ?Client
{
return $this->client;
}
public function setClient(?Client $client): static
{
$this->client = $client;
return $this;
}
/**
* @return Collection<int, Session>
*/
public function getSessions(): Collection
{
return $this->sessions;
}
public function addSession(Session $session): static
{
if (!$this->sessions->contains($session)) {
$this->sessions->add($session);
$session->setEmployee($this);
}
return $this;
}
public function removeSession(Session $session): static
{
if ($this->sessions->removeElement($session)) {
// set the owning side to null (unless already changed)
if ($session->getEmployee() === $this) {
$session->setEmployee(null);
}
}
return $this;
}
public function getBirthdate(): ?\DateTimeInterface
{
return $this->birthdate;
}
public function setBirthdate(?\DateTimeInterface $birthdate): static
{
$this->birthdate = $birthdate;
return $this;
}
public function getEmployeeFunction(): ?string
{
return $this->employee_function;
}
public function setEmployeeFunction(?string $employee_function): static
{
$this->employee_function = $employee_function;
return $this;
}
}