src/Entity/Gestiform/Users/Personne.php line 20
<?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\DossierQuiz;
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\JoinColumn(nullable: true)]
#[ORM\ManyToOne(targetEntity: PersonalInformations::class, cascade: ['all'])]
private ?PersonalInformations $personalInformations = null;
#[ORM\OneToMany(mappedBy: 'personne', targetEntity: HistoriqueEmail::class, cascade: ['persist'])]
private Collection $historiqueEmails;
#[ORM\OneToMany(mappedBy: 'personne', targetEntity: Document::class, cascade: ['persist'])]
private Collection $documents;
#[ORM\OneToMany(mappedBy: 'personne', targetEntity: CVdynamique::class, cascade: ['persist'])]
private Collection $cvDynamiques;
#[ORM\OneToMany(mappedBy: 'personne', targetEntity: Entretien::class, cascade: ['persist'])]
private Collection $entretiens;
#[ORM\OneToMany(mappedBy: 'personne', targetEntity: CursusReponses::class, cascade: ['persist'])]
private Collection $reponses;
#[ORM\JoinColumn(nullable: true)]
#[ORM\OneToOne(targetEntity: Upload::class, cascade: ['persist', 'remove'])]
private ?Upload $signatureFile = null;
#[ORM\OneToMany(mappedBy: 'personne', targetEntity: DossierQuiz::class, cascade: ['all'])]
private Collection $personneQuizzs;
public function __construct()
{
$this->documents = new ArrayCollection();
$this->historiqueEmails = new ArrayCollection();
$this->cvDynamiques = new ArrayCollection();
$this->entretiens = new ArrayCollection();
$this->reponses = new ArrayCollection();
$this->personneQuizzs = 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
{
// set the owning side to null (unless already changed)
if ($this->historiqueEmails->removeElement($historiqueEmail) && $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
{
// set the owning side to null (unless already changed)
if ($this->documents->removeElement($document) && $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
{
// set the owning side to null (unless already changed)
if ($this->$cVDynamique->removeElement($cVDynamique) && $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
{
// set the owning side to null (unless already changed)
if ($this->entretiens->removeElement($entretien) && $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
{
// set the owning side to null (unless already changed)
if ($this->reponses->removeElement($reponse) && $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;
}
/**
* @return Collection<int, CursusReponses>
*/
public function getReponses(): Collection
{
return $this->reponses;
}
public function addReponse(CursusReponses $reponse): static
{
if (!$this->reponses->contains($reponse)) {
$this->reponses->add($reponse);
$reponse->setPersonne($this);
}
return $this;
}
public function removeReponse(CursusReponses $reponse): static
{
if ($this->reponses->removeElement($reponse)) {
// set the owning side to null (unless already changed)
if ($reponse->getPersonne() === $this) {
$reponse->setPersonne(null);
}
}
return $this;
}
/**
* @return Collection<int, DossierQuiz>
*/
public function getPersonneQuizzs(): Collection
{
return $this->personneQuizzs;
}
public function addPersonneQuizz(DossierQuiz $personneQuizz): static
{
if (!$this->personneQuizzs->contains($personneQuizz)) {
$this->personneQuizzs->add($personneQuizz);
$personneQuizz->setPersonne($this);
}
return $this;
}
public function removePersonneQuizz(DossierQuiz $personneQuizz): static
{
if ($this->personneQuizzs->removeElement($personneQuizz)) {
// set the owning side to null (unless already changed)
if ($personneQuizz->getPersonne() === $this) {
$personneQuizz->setPersonne(null);
}
}
return $this;
}
}