<?php
namespace App\Entity\Gestiform\Users;
use App\Entity\Common\Document;
use App\Entity\Common\HistoriqueEmail;
use App\Entity\Common\Upload;
use App\Entity\Gestiform\Admin\Cursus\CursusReponses;
use App\Entity\Gestiform\Admin\Cursus\CVdynamique;
use App\Entity\Gestiform\Admin\Cursus\Entretien;
use App\Entity\Gestiform\Formations\Dossier\PersonalInformations;
use App\Repository\Gestiform\Users\PersonneRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PersonneRepository::class)
*/
class Personne extends User
{
/**
* @ORM\ManyToOne(targetEntity=PersonalInformations::class, cascade={"all"})
* @ORM\JoinColumn(nullable=true)
*/
private ?PersonalInformations $personalInformations = null;
/**
* @ORM\OneToMany(targetEntity=HistoriqueEmail::class, mappedBy="personne",cascade={"persist"})
*/
private Collection $historiqueEmails;
/**
* @ORM\OneToMany(targetEntity=Document::class, mappedBy="personne",cascade={"persist"})
*/
private Collection $documents;
/**
* @ORM\OneToMany(targetEntity=CVdynamique::class, mappedBy="personne",cascade={"persist"})
*/
private Collection $cvDynamiques;
/**
* @ORM\OneToMany(targetEntity=Entretien::class, mappedBy="personne",cascade={"persist"})
*/
private Collection $entretiens;
/**
* @ORM\OneToMany(targetEntity=CursusReponses::class, mappedBy="personne",cascade={"persist"})
*/
private Collection $reponses;
/**
* @ORM\JoinColumn(nullable=true)
* @ORM\OneToOne(targetEntity=Upload::class, cascade={"persist", "remove"})
*/
private ?Upload $signatureFile = null;
public function __construct()
{
$this->documents = new ArrayCollection();
$this->historiqueEmails = new ArrayCollection();
$this->cvDynamiques = new ArrayCollection();
$this->entretiens = new ArrayCollection();
$this->reponses = new ArrayCollection();
}
public function getPersonalInformations(): ?PersonalInformations
{
return $this->personalInformations;
}
public function setPersonalInformations(?PersonalInformations $personalInformations): self
{
$this->personalInformations = $personalInformations;
return $this;
}
/**
* @return Collection<int, HistoriqueEmail>
*/
public function getHistoriqueEmails(): Collection
{
return $this->historiqueEmails;
}
public function addHistoriqueEmail(HistoriqueEmail $historiqueEmail): self
{
if (!$this->historiqueEmails->contains($historiqueEmail)) {
$this->historiqueEmails->add($historiqueEmail);
$historiqueEmail->setPersonne($this);
}
return $this;
}
public function removeHistoriqueEmail(HistoriqueEmail $historiqueEmail): self
{
if ($this->historiqueEmails->removeElement($historiqueEmail)) {
// set the owning side to null (unless already changed)
if ($historiqueEmail->getPersonne() === $this) {
$historiqueEmail->setPersonne(null);
}
}
return $this;
}
/**
* @return Collection<int, Document>
*/
public function getDocuments(): Collection
{
return $this->documents;
}
public function addDocument(Document $document): self
{
if (!$this->documents->contains($document)) {
$this->documents->add($document);
$document->setPersonne($this);
}
return $this;
}
public function removeDocument(Document $document): self
{
if ($this->documents->removeElement($document)) {
// set the owning side to null (unless already changed)
if ($document->getPersonne() === $this) {
$document->setPersonne(null);
}
}
return $this;
}
/**
* @return Collection<int, CVdynamique>
*/
public function getCVDynamiques(): Collection
{
return $this->cvDynamiques;
}
public function addCVDynamique(CVdynamique $cvDynamique): self
{
if (!$this->cvDynamiques->contains($cvDynamique)) {
$this->cvDynamiques->add($cvDynamique);
$cvDynamique->setPersonne($this);
}
return $this;
}
public function removeCVDynamique(CVdynamique $cVDynamique): self
{
if ($this->$cVDynamique->removeElement($cVDynamique)) {
// set the owning side to null (unless already changed)
if ($cVDynamique->getPersonne() === $this) {
$cVDynamique->setPersonne(null);
}
}
return $this;
}
/**
* @return Collection<int, Entretien>
*/
public function getEntretiens(): Collection
{
return $this->entretiens;
}
public function addEntretien(Entretien $entretien): self
{
if (!$this->entretiens->contains($entretien)) {
$this->entretiens->add($entretien);
$entretien->setPersonne($this);
}
return $this;
}
public function removeEntretien(Entretien $entretien): self
{
if ($this->entretiens->removeElement($entretien)) {
// set the owning side to null (unless already changed)
if ($entretien->getPersonne() === $this) {
$entretien->setPersonne(null);
}
}
return $this;
}
/**
* @return Collection<int, CursusReponses>
*/
public function getCursusReponse(): Collection
{
return $this->reponses;
}
public function addCursusReponse(CursusReponses $reponse): self
{
if (!$this->reponses->contains($reponse)) {
$this->reponses->add($reponse);
$reponse->setPersonne($this);
}
return $this;
}
public function removeCursusReponse(CursusReponses $reponse): self
{
if ($this->reponses->removeElement($reponse)) {
// set the owning side to null (unless already changed)
if ($reponse->getPersonne() === $this) {
$reponse->setPersonne(null);
}
}
return $this;
}
public function getSignatureFile(): ?Upload
{
return $this->signatureFile;
}
public function setSignatureFile(?Upload $signatureFile): self
{
$this->signatureFile = $signatureFile;
return $this;
}
}