<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Annotation\Groups;
use App\Entity\RDV;
/**
* @ORM\Table()
* @ORM\Entity
*/
class Intervenant extends AbstractPerson
{
const TRANSPORT_PERSONNEL = 1;
const TRANSPORT_PRO = 2;
const TRANSPORT_COMMUN = 3;
const TRANSPORT_VELO = 4;
const TRANSPORT_SCOOTER = 5;
const TRANSPORT_AUCUN = 0;
const METIER_COIFFEUR = 0;
const METIER_ESTHE = 1;
const METIER_TELEVENDEUR = 2;
/**
* @ORM\OneToOne(targetEntity="User", inversedBy="intervenant")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
*/
protected $user;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $birthdayPlace;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $numIdentite;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $metier;
/**
* @ORM\Column(type="boolean")
*/
private $status = true;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $emailPro;
/**
* @ORM\Column(type="string", name="situationFamille", nullable=true)
*/
protected $situationFamille;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $transportMode;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $numSecu;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $contactNom;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $contactTel;
/**
* @ORM\Column(type="string", nullable=true)
*
* @Assert\File()
*/
private $image;
/**
* @ORM\Column(type="string", nullable=true)
*
* @Assert\File()
*/
private $cni;
// materiel
/**
* @ORM\Column(type="integer", name="nb_blouse", nullable=true)
*/
protected $nbBlouse;
/**
* @ORM\Column(type="string", name="taille_blouse", nullable=true)
*/
protected $tailleBlouse;
/**
* @ORM\Column(type="string", name="model_tablette", nullable=true)
*/
protected $modelTablette;
/**
* @ORM\Column(type="string", name="ref_tablette", nullable=true)
*/
protected $refTablette;
/**
* @ORM\Column(type="string", name="carte_sim", nullable=true)
*/
protected $carteSim;
/**
* @ORM\Column(type="string", name="date_retour_tablette", nullable=true)
*/
protected $dateRetourTablette;
/**
* @ORM\Column(type="string", name="date_remise_tablette", nullable=true)
*/
protected $dateRemiseTablette;
/**
* @ORM\Column(type="string", name="identifiantEmma", nullable=true)
*/
protected $identifiantEmma;
/**
* @ORM\Column(type="string", name="motdepassemma", nullable=true)
*/
protected $motdepassEmma;
/**
* @ORM\Column(type="string", name="mailpro", nullable=true)
*/
protected $mailpro;
/**
* @ORM\OneToOne(targetEntity="WorkContract", inversedBy="intervenant" , cascade={"persist"})
* @ORM\JoinColumn(name="workContract_id", referencedColumnName="id")
*/
protected $workContract;
/**
* @var ArrayCollection
* @ORM\OneToMany(targetEntity="Absence", mappedBy="intervenant" ,cascade={"persist"})
*/
protected $absences;
// FIN matériel
/**
* @ORM\OneToMany(targetEntity=RDV::class, mappedBy="intervenant")
*/
private $rdvs;
/**
* @ORM\ManyToOne(targetEntity=Countries::class)
* @ORM\JoinColumn(name="country_id", referencedColumnName="id")
*
*/
protected $country;
/**
* @ORM\ManyToOne(targetEntity=Departement::class)
* @ORM\JoinColumn(name="departement_id", referencedColumnName="id")
*
*/
protected $departement;
/**
* @ORM\ManyToOne(targetEntity=Countries::class, inversedBy="personn2", cascade={"persist"})
* @ORM\JoinColumn(name="nationality_id", referencedColumnName="id")
*
*/
protected $nationality;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $motDePasseEmailPro;
/**
* @ORM\OneToMany(targetEntity=LogPlanning::class, mappedBy="intervenantOld")
*/
private $logPlannings;
/**
* @ORM\OneToMany(targetEntity=LogCancel::class, mappedBy="intervenantOld", cascade={"remove","persist"})
*/
private $logCancelsIntervenantOld;
/**
* @ORM\OneToMany(targetEntity=LogCancel::class, mappedBy="newIntervenant", cascade={"remove","persist"})
*/
private $logCancelsIntervenantNew;
public function __construct()
{
$this->absences = new ArrayCollection();
$this->logPlannings = new ArrayCollection();
$this->logCancelsIntervenantNew = new ArrayCollection();
$this->logCancelsIntervenantOld = new ArrayCollection();
}
public function __toString()
{
return ucfirst($this->lastname) . " " . ucfirst($this->firstname);
}
/**
* @return mixed
*/
public function getBirthdayPlace()
{
return $this->birthdayPlace;
}
/**
* @param mixed $birthdayPlace
*/
public function setBirthdayPlace($birthdayPlace): void
{
$this->birthdayPlace = $birthdayPlace;
}
/**
* @return mixed
*/
public function getNumIdentite()
{
return $this->numIdentite;
}
/**
* @param mixed $numIdentite
*/
public function setNumIdentite($numIdentite): void
{
$this->numIdentite = $numIdentite;
}
/**
* @return mixed
*/
public function getMetier()
{
return $this->metier;
}
/**
* @param mixed $metier
*/
public function setMetier($metier): void
{
$this->metier = $metier;
}
/**
* @return mixed
*/
public function getEmailPro()
{
return $this->emailPro;
}
/**
* @param mixed $emailPro
*/
public function setEmailPro($emailPro): void
{
$this->emailPro = $emailPro;
}
/**
* @return mixed
*/
public function getTransportMode()
{
return $this->transportMode;
}
/**
* @param mixed $transportMode
*/
public function setTransportMode($transportMode): void
{
$this->transportMode = $transportMode;
}
/**
* @return mixed
*/
public function getCountry()
{
return $this->country;
}
/**
* @param mixed $country
*/
public function setCountry($country): void
{
$this->country = $country;
}
/**
* @return mixed
*/
public function getNationality()
{
return $this->nationality;
}
/**
* @param mixed $nationality
*/
public function setNationality($nationality): void
{
$this->nationality = $nationality;
}
/**
* @return mixed
*/
public function getNumSecu()
{
return $this->numSecu;
}
/**
* @param mixed $numSecu
*/
public function setNumSecu($numSecu): void
{
$this->numSecu = $numSecu;
}
/**
* @return mixed
*/
public function getStatus()
{
return $this->status;
}
/**
* @param mixed $status
*/
public function setStatus($status): void
{
$this->status = $status;
}
/**
* @return mixed
*/
public function getNbBlouse()
{
return $this->nbBlouse;
}
/**
* @param mixed $nbBlouse
*/
public function setNbBlouse($nbBlouse): void
{
$this->nbBlouse = $nbBlouse;
}
/**
* @return mixed
*/
public function getTailleBlouse()
{
return $this->tailleBlouse;
}
/**
* @param mixed $tailleBlouse
*/
public function setTailleBlouse($tailleBlouse): void
{
$this->tailleBlouse = $tailleBlouse;
}
/**
* @return mixed
*/
public function getModelTablette()
{
return $this->modelTablette;
}
/**
* @param mixed $modelTablette
*/
public function setModelTablette($modelTablette): void
{
$this->modelTablette = $modelTablette;
}
/**
* @return mixed
*/
public function getRefTablette()
{
return $this->refTablette;
}
/**
* @param mixed $refTablette
*/
public function setRefTablette($refTablette): void
{
$this->refTablette = $refTablette;
}
/**
* @return mixed
*/
public function getCarteSim()
{
return $this->carteSim;
}
/**
* @param mixed $carteSim
*/
public function setCarteSim($carteSim): void
{
$this->carteSim = $carteSim;
}
/**
* @return mixed
*/
public function getDateRetourTablette()
{
return $this->dateRetourTablette;
}
/**
* @param mixed $dateRetourTablette
*/
public function setDateRetourTablette($dateRetourTablette): void
{
$this->dateRetourTablette = $dateRetourTablette;
}
/**
* @return mixed
*/
public function getDateRemiseTablette()
{
return $this->dateRemiseTablette;
}
/**
* @param mixed $dateRemiseTablette
*/
public function setDateRemiseTablette($dateRemiseTablette): void
{
$this->dateRemiseTablette = $dateRemiseTablette;
}
/**
* @return mixed
*/
public function getSituationFamille()
{
return $this->situationFamille;
}
/**
* @param mixed $situationFamille
*/
public function setSituationFamille($situationFamille): void
{
$this->situationFamille = $situationFamille;
}
/**
* @return WorkContract
*/
public function getWorkContract()
{
return $this->workContract;
}
/**
* @param mixed $workContract
*/
public function setWorkContract($workContract): void
{
$this->workContract = $workContract;
}
/**
* @return Salon
*/
public function getAbsences()
{
return $this->absences;
}
/**
* @param Salon $absences
*/
public function setAbsences($absences): void
{
$this->absences = $absences;
}
/**
* @return mixed
*/
public function getDepartement()
{
return $this->departement;
}
/**
* @param mixed $departement
*/
public function setDepartement($departement): void
{
$this->departement = $departement;
}
/**
* @return mixed
*/
public function getImage()
{
return $this->image;
}
/**
* @param mixed $image
*/
public function setImage($image): void
{
$this->image = $image;
}
/**
* @return mixed
*/
public function getCni()
{
return $this->cni;
}
/**
* @param mixed $cni
*/
public function setCni($cni): void
{
$this->cni = $cni;
}
/**
* @return mixed
*/
public function getContactNom()
{
return $this->contactNom;
}
/**
* @param mixed $contactNom
*/
public function setContactNom($contactNom): void
{
$this->contactNom = $contactNom;
}
/**
* @return mixed
*/
public function getContactTel()
{
return $this->contactTel;
}
/**
* @param mixed $contactTel
*/
public function setContactTel($contactTel): void
{
$this->contactTel = $contactTel;
}
/*********/
/* ADD */
/********/
public function addAbsence(Absence $item)
{
$this->absences->add($item);
$item->setIntervenant($this);
}
/*********/
/* REMVOE */
/********/
public function removeAbsence(IntervenantSalon $item)
{
$this->absences->remove($item);
}
/**
* @return RDV[]
*/
public function getRdvs()
{
return $this->rdvs;
}
/**
* @param mixed $rdvs
*/
public function setRdvs($rdvs): void
{
$this->rdvs = $rdvs;
}
/**
* @return mixed
*/
public function getUser()
{
return $this->user;
}
/**
* @param mixed $user
*/
public function setUser($user): void
{
$this->user = $user;
}
/**
* @return mixed
*/
public function getIdentifiantEmma()
{
return $this->identifiantEmma;
}
/**
* @param mixed $identifiantEmma
*/
public function setIdentifiantEmma($identifiantEmma): void
{
$this->identifiantEmma = $identifiantEmma;
}
/**
* @return mixed
*/
public function getMotdepassEmma()
{
return $this->motdepassEmma;
}
/**
* @param mixed $motdepassEmma
*/
public function setMotdepassEmma($motdepassEmma): void
{
$this->motdepassEmma = $motdepassEmma;
}
/**
* @return mixed
*/
public function getMailpro()
{
return $this->mailpro;
}
/**
* @param mixed $mailpro
*/
public function setMailpro($mailpro): void
{
$this->mailpro = $mailpro;
}
public function getMotDePasseEmailPro(): ?string
{
return $this->motDePasseEmailPro;
}
public function setMotDePasseEmailPro(?string $motDePasseEmailPro): self
{
$this->motDePasseEmailPro = $motDePasseEmailPro;
return $this;
}
/**
* @return Collection<int, LogPlanning>
*/
public function getLogPlannings(): Collection
{
return $this->logPlannings;
}
public function addLogPlanning(LogPlanning $logPlanning): self
{
if (!$this->logPlannings->contains($logPlanning)) {
$this->logPlannings[] = $logPlanning;
$logPlanning->setIntervenantOld($this);
}
return $this;
}
public function removeLogPlanning(LogPlanning $logPlanning): self
{
if ($this->logPlannings->removeElement($logPlanning)) {
// set the owning side to null (unless already changed)
if ($logPlanning->getIntervenantOld() === $this) {
$logPlanning->setIntervenantOld(null);
}
}
return $this;
}
/**
* @return ArrayCollection
*/
public function getLogCancelsIntervenantOld(): ArrayCollection
{
return $this->logCancelsIntervenantOld;
}
/**
* @param ArrayCollection $logCancelsIntervenantOld
*/
public function setLogCancelsIntervenantOld(ArrayCollection $logCancelsIntervenantOld): void
{
$this->logCancelsIntervenantOld = $logCancelsIntervenantOld;
}
/**
* @return ArrayCollection
*/
public function getLogCancelsIntervenantNew(): ArrayCollection
{
return $this->logCancelsIntervenantNew;
}
/**
* @param ArrayCollection $logCancelsIntervenantNew
*/
public function setLogCancelsIntervenantNew(ArrayCollection $logCancelsIntervenantNew): void
{
$this->logCancelsIntervenantNew = $logCancelsIntervenantNew;
}
}