<?php
namespace App\Entity;
use App\Repository\SessionRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: SessionRepository::class)]
class Session
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(length: 255)]
private ?string $email = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $message = null;
#[ORM\ManyToOne(inversedBy: 'sessions')]
private ?ReviewForm $reviewForm = null;
#[ORM\Column]
private ?int $status = null;
#[ORM\OneToMany(targetEntity: Reponse::class, mappedBy: 'session')]
private Collection $reponses;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $createdAt = null;
#[ORM\ManyToOne(inversedBy: 'sessions')]
private ?Employee $employee = null;
#[ORM\Column(length: 50)]
private ?string $lang = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $birthdate = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $employeeFunction = null;
public function __construct()
{
$this->reponses = 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 getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): static
{
$this->email = $email;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(?string $message): static
{
$this->message = $message;
return $this;
}
public function getReviewForm(): ?ReviewForm
{
return $this->reviewForm;
}
public function setReviewForm(?ReviewForm $reviewForm): static
{
$this->reviewForm = $reviewForm;
return $this;
}
public function getStatus(): ?int
{
return $this->status;
}
public function setStatus(int $status): static
{
$this->status = $status;
return $this;
}
/**
* @return Collection<int, Reponse>
*/
public function getReponses(): Collection
{
return $this->reponses;
}
public function addReponse(Reponse $reponse): static
{
if (!$this->reponses->contains($reponse)) {
$this->reponses->add($reponse);
$reponse->setSession($this);
}
return $this;
}
public function removeReponse(Reponse $reponse): static
{
if ($this->reponses->removeElement($reponse)) {
// set the owning side to null (unless already changed)
if ($reponse->getSession() === $this) {
$reponse->setSession(null);
}
}
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
public function getEmployee(): ?Employee
{
return $this->employee;
}
public function setEmployee(?Employee $employee): static
{
$this->employee = $employee;
return $this;
}
public function getLang(): ?string
{
return $this->lang;
}
public function setLang(string $lang): static
{
$this->lang = $lang;
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->employeeFunction;
}
public function setEmployeeFunction(?string $employeeFunction): static
{
$this->employeeFunction = $employeeFunction;
return $this;
}
}