src/Entity/Intervenant.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use App\Entity\RDV;
  9. /**
  10.  * @ORM\Table()
  11.  * @ORM\Entity
  12.  */
  13. class Intervenant extends AbstractPerson
  14. {
  15.     const TRANSPORT_PERSONNEL 1;
  16.     const TRANSPORT_PRO 2;
  17.     const TRANSPORT_COMMUN 3;
  18.     const TRANSPORT_VELO 4;
  19.     const TRANSPORT_SCOOTER 5;
  20.     const TRANSPORT_AUCUN 0;
  21.     const METIER_COIFFEUR 0;
  22.     const METIER_ESTHE 1;
  23.     const METIER_TELEVENDEUR 2;
  24.     /**
  25.      * @ORM\OneToOne(targetEntity="User", inversedBy="intervenant")
  26.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
  27.      */
  28.     protected $user;
  29.     /**
  30.      * @ORM\Column(type="string", nullable=true)
  31.      */
  32.     private $birthdayPlace;
  33.     /**
  34.      * @ORM\Column(type="string", nullable=true)
  35.      */
  36.     private $numIdentite;
  37.     /**
  38.      * @ORM\Column(type="string", nullable=true)
  39.      */
  40.     private $metier;
  41.     /**
  42.      * @ORM\Column(type="boolean")
  43.      */
  44.     private $status true;
  45.     /**
  46.      * @ORM\Column(type="string", nullable=true)
  47.      */
  48.     protected $emailPro;
  49.     /**
  50.      * @ORM\Column(type="string", name="situationFamille", nullable=true)
  51.      */
  52.     protected $situationFamille;
  53.     /**
  54.      * @ORM\Column(type="string", nullable=true)
  55.      */
  56.     protected $transportMode;
  57.     /**
  58.      * @ORM\Column(type="string", nullable=true)
  59.      */
  60.     protected $numSecu;
  61.     /**
  62.      * @ORM\Column(type="string", nullable=true)
  63.      */
  64.     protected $contactNom;
  65.     /**
  66.      * @ORM\Column(type="string", nullable=true)
  67.      */
  68.     protected $contactTel;
  69.     /**
  70.      * @ORM\Column(type="string", nullable=true)
  71.      *
  72.      * @Assert\File()
  73.      */
  74.     private $image;
  75.     /**
  76.      * @ORM\Column(type="string", nullable=true)
  77.      *
  78.      * @Assert\File()
  79.      */
  80.     private $cni;
  81.     // materiel
  82.     /**
  83.      * @ORM\Column(type="integer", name="nb_blouse", nullable=true)
  84.      */
  85.     protected $nbBlouse;
  86.     /**
  87.      * @ORM\Column(type="string", name="taille_blouse", nullable=true)
  88.      */
  89.     protected $tailleBlouse;
  90.     /**
  91.      * @ORM\Column(type="string", name="model_tablette", nullable=true)
  92.      */
  93.     protected $modelTablette;
  94.     /**
  95.      * @ORM\Column(type="string", name="ref_tablette", nullable=true)
  96.      */
  97.     protected $refTablette;
  98.     /**
  99.      * @ORM\Column(type="string", name="carte_sim", nullable=true)
  100.      */
  101.     protected $carteSim;
  102.     /**
  103.      * @ORM\Column(type="string", name="date_retour_tablette", nullable=true)
  104.      */
  105.     protected $dateRetourTablette;
  106.     /**
  107.      * @ORM\Column(type="string", name="date_remise_tablette", nullable=true)
  108.      */
  109.     protected $dateRemiseTablette;
  110.     /**
  111.      * @ORM\Column(type="string", name="identifiantEmma", nullable=true)
  112.      */
  113.     protected $identifiantEmma;
  114.     /**
  115.      * @ORM\Column(type="string", name="motdepassemma", nullable=true)
  116.      */
  117.     protected $motdepassEmma;
  118.     /**
  119.      * @ORM\Column(type="string", name="mailpro", nullable=true)
  120.      */
  121.     protected $mailpro;
  122.     /**
  123.      * @ORM\OneToOne(targetEntity="WorkContract", inversedBy="intervenant" , cascade={"persist"})
  124.      * @ORM\JoinColumn(name="workContract_id", referencedColumnName="id")
  125.      */
  126.     protected $workContract;
  127.     /**
  128.      * @var ArrayCollection
  129.      * @ORM\OneToMany(targetEntity="Absence", mappedBy="intervenant" ,cascade={"persist"})
  130.      */
  131.     protected $absences;
  132.     // FIN matériel
  133.     /**
  134.      * @ORM\OneToMany(targetEntity=RDV::class, mappedBy="intervenant")
  135.      */
  136.     private $rdvs;
  137.     /**
  138.      * @ORM\ManyToOne(targetEntity=Countries::class)
  139.      * @ORM\JoinColumn(name="country_id", referencedColumnName="id")
  140.      *
  141.      */
  142.     protected $country;
  143.     /**
  144.      * @ORM\ManyToOne(targetEntity=Departement::class)
  145.      * @ORM\JoinColumn(name="departement_id", referencedColumnName="id")
  146.      *
  147.      */
  148.     protected $departement;
  149.     /**
  150.      * @ORM\ManyToOne(targetEntity=Countries::class, inversedBy="personn2", cascade={"persist"})
  151.      * @ORM\JoinColumn(name="nationality_id", referencedColumnName="id")
  152.      *
  153.      */
  154.     protected $nationality;
  155.     /**
  156.      * @ORM\Column(type="string", length=255, nullable=true)
  157.      */
  158.     private $motDePasseEmailPro;
  159.     /**
  160.      * @ORM\OneToMany(targetEntity=LogPlanning::class, mappedBy="intervenantOld")
  161.      */
  162.     private $logPlannings;
  163.     /**
  164.      * @ORM\OneToMany(targetEntity=LogCancel::class, mappedBy="intervenantOld", cascade={"remove","persist"})
  165.      */
  166.     private $logCancelsIntervenantOld;
  167.     /**
  168.      * @ORM\OneToMany(targetEntity=LogCancel::class, mappedBy="newIntervenant", cascade={"remove","persist"})
  169.      */
  170.     private $logCancelsIntervenantNew;
  171.     public function __construct()
  172.                       {
  173.                           $this->absences = new ArrayCollection();
  174.                     $this->logPlannings = new ArrayCollection();
  175.                         $this->logCancelsIntervenantNew = new ArrayCollection();
  176.                         $this->logCancelsIntervenantOld = new ArrayCollection();
  177.                       }
  178.     public function __toString()
  179.                       {
  180.                           return ucfirst($this->lastname) . " " ucfirst($this->firstname);
  181.                       }
  182.     /**
  183.      * @return mixed
  184.      */
  185.     public function getBirthdayPlace()
  186.                       {
  187.                           return $this->birthdayPlace;
  188.                       }
  189.     /**
  190.      * @param mixed $birthdayPlace
  191.      */
  192.     public function setBirthdayPlace($birthdayPlace): void
  193.                       {
  194.                           $this->birthdayPlace $birthdayPlace;
  195.                       }
  196.     /**
  197.      * @return mixed
  198.      */
  199.     public function getNumIdentite()
  200.                       {
  201.                           return $this->numIdentite;
  202.                       }
  203.     /**
  204.      * @param mixed $numIdentite
  205.      */
  206.     public function setNumIdentite($numIdentite): void
  207.                       {
  208.                           $this->numIdentite $numIdentite;
  209.                       }
  210.     /**
  211.      * @return mixed
  212.      */
  213.     public function getMetier()
  214.                       {
  215.                           return $this->metier;
  216.                       }
  217.     /**
  218.      * @param mixed $metier
  219.      */
  220.     public function setMetier($metier): void
  221.                       {
  222.                           $this->metier $metier;
  223.                       }
  224.     /**
  225.      * @return mixed
  226.      */
  227.     public function getEmailPro()
  228.                       {
  229.                           return $this->emailPro;
  230.                       }
  231.     /**
  232.      * @param mixed $emailPro
  233.      */
  234.     public function setEmailPro($emailPro): void
  235.                       {
  236.                           $this->emailPro $emailPro;
  237.                       }
  238.     /**
  239.      * @return mixed
  240.      */
  241.     public function getTransportMode()
  242.                       {
  243.                           return $this->transportMode;
  244.                       }
  245.     /**
  246.      * @param mixed $transportMode
  247.      */
  248.     public function setTransportMode($transportMode): void
  249.                       {
  250.                           $this->transportMode $transportMode;
  251.                       }
  252.     /**
  253.      * @return mixed
  254.      */
  255.     public function getCountry()
  256.                       {
  257.                           return $this->country;
  258.                       }
  259.     /**
  260.      * @param mixed $country
  261.      */
  262.     public function setCountry($country): void
  263.                       {
  264.                           $this->country $country;
  265.                       }
  266.     /**
  267.      * @return mixed
  268.      */
  269.     public function getNationality()
  270.                       {
  271.                           return $this->nationality;
  272.                       }
  273.     /**
  274.      * @param mixed $nationality
  275.      */
  276.     public function setNationality($nationality): void
  277.                       {
  278.                           $this->nationality $nationality;
  279.                       }
  280.     /**
  281.      * @return mixed
  282.      */
  283.     public function getNumSecu()
  284.                       {
  285.                           return $this->numSecu;
  286.                       }
  287.     /**
  288.      * @param mixed $numSecu
  289.      */
  290.     public function setNumSecu($numSecu): void
  291.                       {
  292.                           $this->numSecu $numSecu;
  293.                       }
  294.     /**
  295.      * @return mixed
  296.      */
  297.     public function getStatus()
  298.                       {
  299.                           return $this->status;
  300.                       }
  301.     /**
  302.      * @param mixed $status
  303.      */
  304.     public function setStatus($status): void
  305.                       {
  306.                           $this->status $status;
  307.                       }
  308.     /**
  309.      * @return mixed
  310.      */
  311.     public function getNbBlouse()
  312.                       {
  313.                           return $this->nbBlouse;
  314.                       }
  315.     /**
  316.      * @param mixed $nbBlouse
  317.      */
  318.     public function setNbBlouse($nbBlouse): void
  319.                       {
  320.                           $this->nbBlouse $nbBlouse;
  321.                       }
  322.     /**
  323.      * @return mixed
  324.      */
  325.     public function getTailleBlouse()
  326.                       {
  327.                           return $this->tailleBlouse;
  328.                       }
  329.     /**
  330.      * @param mixed $tailleBlouse
  331.      */
  332.     public function setTailleBlouse($tailleBlouse): void
  333.                       {
  334.                           $this->tailleBlouse $tailleBlouse;
  335.                       }
  336.     /**
  337.      * @return mixed
  338.      */
  339.     public function getModelTablette()
  340.                       {
  341.                           return $this->modelTablette;
  342.                       }
  343.     /**
  344.      * @param mixed $modelTablette
  345.      */
  346.     public function setModelTablette($modelTablette): void
  347.                       {
  348.                           $this->modelTablette $modelTablette;
  349.                       }
  350.     /**
  351.      * @return mixed
  352.      */
  353.     public function getRefTablette()
  354.                       {
  355.                           return $this->refTablette;
  356.                       }
  357.     /**
  358.      * @param mixed $refTablette
  359.      */
  360.     public function setRefTablette($refTablette): void
  361.                       {
  362.                           $this->refTablette $refTablette;
  363.                       }
  364.     /**
  365.      * @return mixed
  366.      */
  367.     public function getCarteSim()
  368.                       {
  369.                           return $this->carteSim;
  370.                       }
  371.     /**
  372.      * @param mixed $carteSim
  373.      */
  374.     public function setCarteSim($carteSim): void
  375.                       {
  376.                           $this->carteSim $carteSim;
  377.                       }
  378.     /**
  379.      * @return mixed
  380.      */
  381.     public function getDateRetourTablette()
  382.                       {
  383.                           return $this->dateRetourTablette;
  384.                       }
  385.     /**
  386.      * @param mixed $dateRetourTablette
  387.      */
  388.     public function setDateRetourTablette($dateRetourTablette): void
  389.                       {
  390.                           $this->dateRetourTablette $dateRetourTablette;
  391.                       }
  392.     /**
  393.      * @return mixed
  394.      */
  395.     public function getDateRemiseTablette()
  396.                       {
  397.                           return $this->dateRemiseTablette;
  398.                       }
  399.     /**
  400.      * @param mixed $dateRemiseTablette
  401.      */
  402.     public function setDateRemiseTablette($dateRemiseTablette): void
  403.                       {
  404.                           $this->dateRemiseTablette $dateRemiseTablette;
  405.                       }
  406.     /**
  407.      * @return mixed
  408.      */
  409.     public function getSituationFamille()
  410.                       {
  411.                           return $this->situationFamille;
  412.                       }
  413.     /**
  414.      * @param mixed $situationFamille
  415.      */
  416.     public function setSituationFamille($situationFamille): void
  417.                       {
  418.                           $this->situationFamille $situationFamille;
  419.                       }
  420.     /**
  421.      * @return WorkContract
  422.      */
  423.     public function getWorkContract()
  424.                       {
  425.                           return $this->workContract;
  426.                       }
  427.     /**
  428.      * @param mixed $workContract
  429.      */
  430.     public function setWorkContract($workContract): void
  431.                       {
  432.                           $this->workContract $workContract;
  433.                       }
  434.     /**
  435.      * @return Salon
  436.      */
  437.     public function getAbsences()
  438.                       {
  439.                           return $this->absences;
  440.                       }
  441.     /**
  442.      * @param Salon $absences
  443.      */
  444.     public function setAbsences($absences): void
  445.                       {
  446.                           $this->absences $absences;
  447.                       }
  448.     /**
  449.      * @return mixed
  450.      */
  451.     public function getDepartement()
  452.                       {
  453.                           return $this->departement;
  454.                       }
  455.     /**
  456.      * @param mixed $departement
  457.      */
  458.     public function setDepartement($departement): void
  459.                       {
  460.                           $this->departement $departement;
  461.                       }
  462.     /**
  463.      * @return mixed
  464.      */
  465.     public function getImage()
  466.                       {
  467.                           return $this->image;
  468.                       }
  469.     /**
  470.      * @param mixed $image
  471.      */
  472.     public function setImage($image): void
  473.                       {
  474.                           $this->image $image;
  475.                       }
  476.     /**
  477.      * @return mixed
  478.      */
  479.     public function getCni()
  480.                       {
  481.                           return $this->cni;
  482.                       }
  483.     /**
  484.      * @param mixed $cni
  485.      */
  486.     public function setCni($cni): void
  487.                       {
  488.                           $this->cni $cni;
  489.                       }
  490.     /**
  491.      * @return mixed
  492.      */
  493.     public function getContactNom()
  494.                       {
  495.                           return $this->contactNom;
  496.                       }
  497.     /**
  498.      * @param mixed $contactNom
  499.      */
  500.     public function setContactNom($contactNom): void
  501.                       {
  502.                           $this->contactNom $contactNom;
  503.                       }
  504.     /**
  505.      * @return mixed
  506.      */
  507.     public function getContactTel()
  508.                       {
  509.                           return $this->contactTel;
  510.                       }
  511.     /**
  512.      * @param mixed $contactTel
  513.      */
  514.     public function setContactTel($contactTel): void
  515.                       {
  516.                           $this->contactTel $contactTel;
  517.                       }
  518.     /*********/
  519.     /*  ADD */
  520.     /********/
  521.     public function addAbsence(Absence $item)
  522.                       {
  523.                           $this->absences->add($item);
  524.                           $item->setIntervenant($this);
  525.                       }
  526.     /*********/
  527.     /*  REMVOE */
  528.     /********/
  529.     public function removeAbsence(IntervenantSalon $item)
  530.                       {
  531.                           $this->absences->remove($item);
  532.                       }
  533.     /**
  534.      * @return RDV[]
  535.      */
  536.     public function getRdvs()
  537.                       {
  538.                           return $this->rdvs;
  539.                       }
  540.     /**
  541.      * @param mixed $rdvs
  542.      */
  543.     public function setRdvs($rdvs): void
  544.                       {
  545.                           $this->rdvs $rdvs;
  546.                       }
  547.     /**
  548.      * @return mixed
  549.      */
  550.     public function getUser()
  551.                       {
  552.                           return $this->user;
  553.                       }
  554.     /**
  555.      * @param mixed $user
  556.      */
  557.     public function setUser($user): void
  558.                       {
  559.                           $this->user $user;
  560.                       }
  561.     /**
  562.      * @return mixed
  563.      */
  564.     public function getIdentifiantEmma()
  565.                       {
  566.                           return $this->identifiantEmma;
  567.                       }
  568.     /**
  569.      * @param mixed $identifiantEmma
  570.      */
  571.     public function setIdentifiantEmma($identifiantEmma): void
  572.                       {
  573.                           $this->identifiantEmma $identifiantEmma;
  574.                       }
  575.     /**
  576.      * @return mixed
  577.      */
  578.     public function getMotdepassEmma()
  579.                       {
  580.                           return $this->motdepassEmma;
  581.                       }
  582.     /**
  583.      * @param mixed $motdepassEmma
  584.      */
  585.     public function setMotdepassEmma($motdepassEmma): void
  586.                       {
  587.                           $this->motdepassEmma $motdepassEmma;
  588.                       }
  589.     /**
  590.      * @return mixed
  591.      */
  592.     public function getMailpro()
  593.                       {
  594.                           return $this->mailpro;
  595.                       }
  596.     /**
  597.      * @param mixed $mailpro
  598.      */
  599.     public function setMailpro($mailpro): void
  600.                       {
  601.                           $this->mailpro $mailpro;
  602.                       }
  603.     public function getMotDePasseEmailPro(): ?string
  604.                       {
  605.                           return $this->motDePasseEmailPro;
  606.                       }
  607.     public function setMotDePasseEmailPro(?string $motDePasseEmailPro): self
  608.                       {
  609.                           $this->motDePasseEmailPro $motDePasseEmailPro;
  610.                           return $this;
  611.                       }
  612.     /**
  613.      * @return Collection<int, LogPlanning>
  614.      */
  615.     public function getLogPlannings(): Collection
  616.     {
  617.         return $this->logPlannings;
  618.     }
  619.     public function addLogPlanning(LogPlanning $logPlanning): self
  620.     {
  621.         if (!$this->logPlannings->contains($logPlanning)) {
  622.             $this->logPlannings[] = $logPlanning;
  623.             $logPlanning->setIntervenantOld($this);
  624.         }
  625.         return $this;
  626.     }
  627.     public function removeLogPlanning(LogPlanning $logPlanning): self
  628.     {
  629.         if ($this->logPlannings->removeElement($logPlanning)) {
  630.             // set the owning side to null (unless already changed)
  631.             if ($logPlanning->getIntervenantOld() === $this) {
  632.                 $logPlanning->setIntervenantOld(null);
  633.             }
  634.         }
  635.         return $this;
  636.     }
  637.     /**
  638.      * @return ArrayCollection
  639.      */
  640.     public function getLogCancelsIntervenantOld(): ArrayCollection
  641.     {
  642.         return $this->logCancelsIntervenantOld;
  643.     }
  644.     /**
  645.      * @param ArrayCollection $logCancelsIntervenantOld
  646.      */
  647.     public function setLogCancelsIntervenantOld(ArrayCollection $logCancelsIntervenantOld): void
  648.     {
  649.         $this->logCancelsIntervenantOld $logCancelsIntervenantOld;
  650.     }
  651.     /**
  652.      * @return ArrayCollection
  653.      */
  654.     public function getLogCancelsIntervenantNew(): ArrayCollection
  655.     {
  656.         return $this->logCancelsIntervenantNew;
  657.     }
  658.     /**
  659.      * @param ArrayCollection $logCancelsIntervenantNew
  660.      */
  661.     public function setLogCancelsIntervenantNew(ArrayCollection $logCancelsIntervenantNew): void
  662.     {
  663.         $this->logCancelsIntervenantNew $logCancelsIntervenantNew;
  664.     }
  665. }