<?php
namespace App\Entity;
use App\Repository\ApprenantRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ApprenantRepository::class)
*/
class Apprenant
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\OneToMany(targetEntity=Appel::class, mappedBy="apprenant")
*/
private $appels;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $idUser;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $firstname;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lastname;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $email;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $type;
/**
* @ORM\ManyToOne(targetEntity=Projet::class, inversedBy="apprenants")
* @ORM\JoinColumn(name="id_projet", referencedColumnName="id")
*/
private $projet;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $gsm;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $username;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $gsm2;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $permission_appel;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $categorie;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $last_access;
/**
* @ORM\Column(name="dateModif",type="string", length=255, nullable=true)
*/
private $dateModif;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $direction;
/**
* @ORM\Column(name="firstAccessSpeexx",type="string", length=255, nullable=true)
*/
private $firstAccessSpeexx;
/**
* @ORM\Column(name="lastAccessSpeexx",type="string", length=255, nullable=true)
*/
private $lastAccessSpeexx;
/**
* @ORM\Column(name="timePromo1",type="integer", nullable=true)
*/
private $timePromo1;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $profil;
/**
* @ORM\Column(name="testOral",type="integer",options={"default" : 0},nullable=true)
*/
private $testOral;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $poste;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $password;
/**
* @ORM\Column(name="noteOral",type="string", length=255, nullable=true)
*/
private $noteOral;
/**
* @ORM\OneToMany(targetEntity=Inscription::class, mappedBy="apprenant")
*/
private $inscriptions;
/**
* @ORM\OneToMany(targetEntity=Message::class, mappedBy="apprenant")
*/
private $messages;
/**
* @ORM\OneToMany(targetEntity=Rdv::class, mappedBy="apprenant")
*/
private $rdvs;
/**
* @ORM\OneToMany(targetEntity=Seance::class, mappedBy="apprenant")
*/
private $seances;
/**
* @ORM\OneToMany(targetEntity=Tache::class, mappedBy="apprenant")
*/
private $taches;
/**
* @ORM\Column(name="date_permission_appel", type="string", length=255, nullable=true, options={"comment":"Date de fin pour Interdiction d'appel"})
*/
private $DatePermissionAppel;
/**
* @ORM\Column(name="raison_permission_appel", type="string", length=255, nullable=true, options={"comment":"La raison pour Interdiction d'appel"})
*/
private $RaisonPermissionAppel;
/**
* @ORM\Column(type="integer",options={"default" : 0}, nullable=true)
*/
private $priority;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $creneau;
/**
* @ORM\OneToMany(targetEntity=Incident::class, mappedBy="apprenant", orphanRemoval=true)
*/
private $incidents;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $fonction;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $qualificationWebi;
public function __construct()
{
$this->appels = new ArrayCollection();
$this->inscriptions = new ArrayCollection();
$this->messages = new ArrayCollection();
$this->rdvs = new ArrayCollection();
$this->seances = new ArrayCollection();
$this->taches = new ArrayCollection();
$this->incidents = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return Collection|Appel[]
*/
public function getAppels(): Collection
{
return $this->appels;
}
public function addAppel(Appel $appel): self
{
if (!$this->appels->contains($appel)) {
$this->appels[] = $appel;
$appel->setApprenant($this);
}
return $this;
}
public function removeAppel(Appel $appel): self
{
if ($this->appels->contains($appel)) {
$this->appels->removeElement($appel);
// set the owning side to null (unless already changed)
if ($appel->getApprenant() === $this) {
$appel->setApprenant(null);
}
}
return $this;
}
public function getIdUser(): ?int
{
return $this->idUser;
}
public function setIdUser(?int $idUser): self
{
$this->idUser = $idUser;
return $this;
}
public function getFirstname(): ?string
{
return $this->firstname;
}
public function setFirstname(?string $firstname): self
{
$this->firstname = $firstname;
return $this;
}
public function getLastname(): ?string
{
return $this->lastname;
}
public function setLastname(?string $lastname): self
{
$this->lastname = $lastname;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
public function getType(): ?int
{
return $this->type;
}
public function setType(?int $type): self
{
$this->type = $type;
return $this;
}
public function getProjet(): ?Projet
{
return $this->projet;
}
public function setProjet(?Projet $projet): self
{
$this->projet = $projet;
return $this;
}
public function getGsm(): ?string
{
return $this->gsm;
}
public function setGsm(?string $gsm): self
{
$this->gsm = $gsm;
return $this;
}
public function getUsername(): ?string
{
return $this->username;
}
public function setUsername(?string $username): self
{
$this->username = $username;
return $this;
}
public function getGsm2(): ?string
{
return $this->gsm2;
}
public function setGsm2(?string $gsm2): self
{
$this->gsm2 = $gsm2;
return $this;
}
public function getPermissionAppel(): ?int
{
return $this->permission_appel;
}
public function setPermissionAppel(?int $permission_appel): self
{
$this->permission_appel = $permission_appel;
return $this;
}
public function getCategorie(): ?int
{
return $this->categorie;
}
public function setCategorie(?int $categorie): self
{
$this->categorie = $categorie;
return $this;
}
public function getLastAccess(): ?string
{
return $this->last_access;
}
public function setLastAccess(?string $last_access): self
{
$this->last_access = $last_access;
return $this;
}
public function getDateModif(): ?string
{
return $this->dateModif;
}
public function setDateModif(?string $dateModif): self
{
$this->dateModif = $dateModif;
return $this;
}
public function getDirection(): ?string
{
return $this->direction;
}
public function setDirection(?string $direction): self
{
$this->direction = $direction;
return $this;
}
public function getFirstAccessSpeexx(): ?string
{
return $this->firstAccessSpeexx;
}
public function setFirstAccessSpeexx(?string $firstAccessSpeexx): self
{
$this->firstAccessSpeexx = $firstAccessSpeexx;
return $this;
}
public function getLastAccessSpeexx(): ?string
{
return $this->lastAccessSpeexx;
}
public function setLastAccessSpeexx(?string $lastAccessSpeexx): self
{
$this->lastAccessSpeexx = $lastAccessSpeexx;
return $this;
}
public function getTimePromo1(): ?int
{
return $this->timePromo1;
}
public function setTimePromo1(?int $timePromo1): self
{
$this->timePromo1 = $timePromo1;
return $this;
}
public function getProfil(): ?string
{
return $this->profil;
}
public function setProfil(?string $profil): self
{
$this->profil = $profil;
return $this;
}
public function getTestOral(): ?int
{
return $this->testOral;
}
public function setTestOral(int $testOral): self
{
$this->testOral = $testOral;
return $this;
}
public function getPoste(): ?string
{
return $this->poste;
}
public function setPoste(?string $poste): self
{
$this->poste = $poste;
return $this;
}
public function getPassword(): ?string
{
return $this->password;
}
public function setPassword(?string $password): self
{
$this->password = $password;
return $this;
}
public function getNoteOral(): ?int
{
return $this->noteOral;
}
public function setNoteOral(?int $noteOral): self
{
$this->noteOral = $noteOral;
return $this;
}
/**
* @return Collection|Inscription[]
*/
public function getInscriptions(): Collection
{
return $this->inscriptions;
}
public function addInscription(Inscription $inscription): self
{
if (!$this->inscriptions->contains($inscription)) {
$this->inscriptions[] = $inscription;
$inscription->setApprenant($this);
}
return $this;
}
public function removeInscription(Inscription $inscription): self
{
if ($this->inscriptions->contains($inscription)) {
$this->inscriptions->removeElement($inscription);
// set the owning side to null (unless already changed)
if ($inscription->getApprenant() === $this) {
$inscription->setApprenant(null);
}
}
return $this;
}
/**
* @return Collection|Message[]
*/
public function getMessages(): Collection
{
return $this->messages;
}
public function addMessage(Message $message): self
{
if (!$this->messages->contains($message)) {
$this->messages[] = $message;
$message->setApprenant($this);
}
return $this;
}
public function removeMessage(Message $message): self
{
if ($this->messages->contains($message)) {
$this->messages->removeElement($message);
// set the owning side to null (unless already changed)
if ($message->getApprenant() === $this) {
$message->setApprenant(null);
}
}
return $this;
}
/**
* @return Collection|Rdv[]
*/
public function getRdvs(): Collection
{
return $this->rdvs;
}
public function addRdv(Rdv $rdv): self
{
if (!$this->rdvs->contains($rdv)) {
$this->rdvs[] = $rdv;
$rdv->setApprenant($this);
}
return $this;
}
public function removeRdv(Rdv $rdv): self
{
if ($this->rdvs->contains($rdv)) {
$this->rdvs->removeElement($rdv);
// set the owning side to null (unless already changed)
if ($rdv->getApprenant() === $this) {
$rdv->setApprenant(null);
}
}
return $this;
}
/**
* @return Collection|Seance[]
*/
public function getSeances(): Collection
{
return $this->seances;
}
public function addSeance(Seance $seance): self
{
if (!$this->seances->contains($seance)) {
$this->seances[] = $seance;
$seance->setApprenant($this);
}
return $this;
}
public function removeSeance(Seance $seance): self
{
if ($this->seances->contains($seance)) {
$this->seances->removeElement($seance);
// set the owning side to null (unless already changed)
if ($seance->getApprenant() === $this) {
$seance->setApprenant(null);
}
}
return $this;
}
/**
* @return Collection|Tache[]
*/
public function getTaches(): Collection
{
return $this->taches;
}
public function addTach(Tache $tach): self
{
if (!$this->taches->contains($tach)) {
$this->taches[] = $tach;
$tach->setApprenant($this);
}
return $this;
}
public function removeTach(Tache $tach): self
{
if ($this->taches->contains($tach)) {
$this->taches->removeElement($tach);
// set the owning side to null (unless already changed)
if ($tach->getApprenant() === $this) {
$tach->setApprenant(null);
}
}
return $this;
}
public function getDatePermissionAppel(): ?string
{
return $this->DatePermissionAppel;
}
public function setDatePermissionAppel(?string $DatePermissionAppel): self
{
$this->DatePermissionAppel = $DatePermissionAppel;
return $this;
}
public function getRaisonPermissionAppel(): ?string
{
return $this->RaisonPermissionAppel;
}
public function setRaisonPermissionAppel(?string $RaisonPermissionAppel): self
{
$this->RaisonPermissionAppel = $RaisonPermissionAppel;
return $this;
}
public function getRaisonsInterdictiondAppel()
{
$listRaisons = array(1 => 'Retraite', 2 => 'Pas Intéressé', 3 => 'Occupation urgente', 4 => 'Congé Maternel', 5 => 'Arrêt Maladie', 6 => 'Désistement', 7 => 'Décès', 8 => "Rendez-vous", 100 => 'Autres');
return $listRaisons;
}
/**
* Traiter le numéro GSM
* @return void
*/
public function getValideGSM($gsm)
{
$newGsm = '';
$trimGsm = str_replace("+", "", str_replace(" ", "", str_replace(".", "", str_replace("(", "", str_replace(")", "", str_replace("(", "", str_replace("-", "", str_replace("(", "", str_replace("_", "", $gsm)))))))));
if (substr($trimGsm, 0, 3) == "212") {
$newGsm = "00" . $trimGsm;
} elseif (substr($trimGsm, 0, 1) == "5") {
$newGsm = "0" . $trimGsm;
} elseif (substr($trimGsm, 0, 1) == "6") {
$newGsm = "0" . $trimGsm;
} elseif (substr($trimGsm, 0, 1) == "7") {
$newGsm = "0" . $trimGsm;
} else {
$newGsm = $trimGsm;
}
return $newGsm;
}
public function getPriority(): ?int
{
return $this->priority;
}
public function setPriority(?int $priority): self
{
$this->priority = $priority;
return $this;
}
public function getCreneau(): ?string
{
return $this->creneau;
}
public function setCreneau(?string $creneau): self
{
$this->creneau = $creneau;
return $this;
}
/**
* @return Collection|Incident[]
*/
public function getIncidents(): Collection
{
return $this->incidents;
}
public function addIncident(Incident $incident): self
{
if (!$this->incidents->contains($incident)) {
$this->incidents[] = $incident;
$incident->setApprenant($this);
}
return $this;
}
public function removeIncident(Incident $incident): self
{
if ($this->incidents->removeElement($incident)) {
// set the owning side to null (unless already changed)
if ($incident->getApprenant() === $this) {
$incident->setApprenant(null);
}
}
return $this;
}
public function getFonction(): ?string
{
return $this->fonction;
}
public function setFonction(?string $fonction): self
{
$this->fonction = $fonction;
return $this;
}
public function getQualificationWebi(): ?string
{
return $this->qualificationWebi;
}
public function setQualificationWebi(?string $qualificationWebi): self
{
$this->qualificationWebi = $qualificationWebi;
return $this;
}
}