src/Entity/User.php line 20

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\Security\Core\User\UserInterface;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9. use JMS\Serializer\Annotation\Expose;
  10. use JMS\Serializer\Annotation\ExclusionPolicy;
  11. use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface;
  12. /**
  13.  * @ExclusionPolicy("all")
  14.  * @ORM\Entity(repositoryClass="App\Repository\UserRepository")
  15.  * @UniqueEntity(fields={"email"}, message="Il existe déjà un compte avec cet e-mail")
  16.  */
  17. class User implements UserInterface, TwoFactorInterface
  18. {
  19.     const ACCES_LECTURE = 1;
  20.     const ACCES_ECRETURE = 2;
  21.     const INTERVENANT_MAITRE_OEUVRE = 1;
  22.     const INTERVENANT_AMO = 2;
  23.     const INTERVENANT_MACON = 3;
  24.     const INTERVENANT_CONSTRUCTEUR = 4;
  25.     const INTERVENANT_CHARPENTIER = 5;
  26.     const INTERVENANT_ELECTRICIEN = 6;
  27.     const INTERVENANT_COUVREUR = 7;
  28.     const INTERVENANT_POSEUR = 8;
  29.     const INTERVENANT_AUTRE = 9;
  30.     const ACCES_admin_prejeance = 1;
  31.     const ACCES_interne_prejeance = 2;
  32.     const ACCES_externe_prejeance = 3;
  33.     const ACCES_intervenant = 4;
  34.     const ACCES_visiteur = 5;
  35.     const ACCES_comptable = 6;
  36.     const fournisseur_type_EPC = 1;
  37.     const fournisseur_type_Installateur = 2;
  38.     const fournisseur_type_Charpentier = 3;
  39.     const fournisseur_type_Notaire = 4;
  40.     const fournisseur_type_Constructeur = 5;
  41.     const fournisseur_type_Mainteneur = 6;
  42.     const fournisseur_type_Conducteur = 7;
  43.     const fournisseur_type_AMO = 8;
  44.     /**
  45.      * @Expose
  46.      * @ORM\Id()
  47.      * @ORM\GeneratedValue()
  48.      * @ORM\Column(type="integer")
  49.      */
  50.     private $id;
  51.     /**
  52.      * @ORM\Column(type="string", nullable=true)
  53.      */
  54.     private $authCode;
  55.     /**
  56.      * @Expose
  57.      * @ORM\Column(type="string", length=180, unique=true)
  58.      * @Assert\Email(
  59.      *     message = "Cette e-mail '{{ value }}' n`est pas valid.",
  60.      * )
  61.      * @Assert\NotBlank( message = "email is required.")
  62.      */
  63.     private $email;
  64.     /**
  65.      * @ORM\Column(type="text", nullable=true)
  66.      */
  67.     private $tel;
  68.     
  69.     /**
  70.      * @Expose
  71.      * @ORM\Column(type="string", length=255,nullable=true)
  72.      * @Assert\NotBlank( message = "firstname is required.")
  73.      */
  74.     private $firstname;
  75.     /**
  76.      * @Expose
  77.      * @ORM\Column(type="string", length=255,nullable=true)
  78.      * @Assert\NotBlank( message = "lastname is required.")
  79.      */
  80.     private $lastname;
  81.     /**
  82.      * @Expose
  83.      * @ORM\Column(type="boolean", nullable=true)
  84.      */
  85.     private $isEnabled;
  86.     /**
  87.      * @Expose
  88.      * @ORM\Column(type="boolean", nullable=true)
  89.      */
  90.     private $isArchived;
  91.     /**
  92.      * @ORM\Column(type="text" , nullable=true)
  93.      */
  94.     private $roles = [];
  95.     /**
  96.      * @var string The hashed password
  97.      * @ORM\Column(type="string")
  98.      */
  99.     private $password;
  100.     private $plainPassword;
  101.     /**
  102.      * @var string le token qui servira lors de l'oubli de mot de passe
  103.      * @ORM\Column(type="text", nullable=true)
  104.      */
  105.     protected $resetToken;
  106.     /**
  107.      * @Expose
  108.      * @ORM\Column(type="datetime", nullable=true)
  109.      */
  110.     private $createdAt;
  111.     /**
  112.      * @Expose
  113.      * @ORM\Column(type="string", length=255, nullable=true)
  114.      */
  115.     private $token;
  116.     /**
  117.      * @ORM\ManyToOne(targetEntity="Entreprise", cascade={"persist"})
  118.      * @ORM\JoinColumn(name="entreprise_id", referencedColumnName="id",nullable=true)
  119.      */
  120.     private $entreprise;
  121.     /**
  122.      * @Expose
  123.      * @ORM\Column(type="string", length=255, nullable=true)
  124.      */
  125.     private $acces ;
  126.     /**
  127.      * @Expose
  128.      * @ORM\Column(type="datetime", nullable=true)
  129.      */
  130.     private $derniereConnecxion;
  131.     /**
  132.      * @ORM\ManyToMany(targetEntity="App\Entity\Spv", cascade={"persist"})
  133.      * @ORM\JoinColumn(referencedColumnName="id",nullable=true ,onDelete="SET NULL")
  134.      * @ORM\OrderBy({"name" = "asc"})
  135.      */
  136.     private $spv;
  137.     /**
  138.      * @ORM\Column(type="string", length=255,nullable=true)
  139.      */
  140.     private $couleurRapport;
  141.     /**
  142.      * @Expose
  143.      * @ORM\Column(type="string", length=255, nullable=true)
  144.      */
  145.     private $intervenantNum ;
  146.     /**
  147.      * @ORM\OneToMany(targetEntity="App\Entity\UserDroit", mappedBy="user", cascade={"persist"})
  148.      */
  149.     private $userDroit;
  150.     /**
  151.      * @ORM\Column(type="string", length=255,nullable=true)
  152.      */
  153.     private $autreRole;
  154.     /**
  155.      * @ORM\ManyToOne(targetEntity="Fournisseur", cascade={"persist"},inversedBy="user")
  156.      * @ORM\JoinColumn(name="fournisseur_id", referencedColumnName="id",nullable=true)
  157.      */
  158.     private $fournisseur;
  159.     /**
  160.      * @ORM\Column(type="string", length=255,nullable=true)
  161.      */
  162.     private $codeDev;
  163.     /**
  164.      * @ORM\Column(type="string", length=255,nullable=true)
  165.      */
  166.     private $typeAcces;
  167.     /**
  168.      * @Expose
  169.      * @ORM\Column(type="boolean", nullable=true)
  170.      */
  171.     private $isAccesCreateFactureSpv;
  172.     /**
  173.      * @Expose
  174.      * @ORM\Column(type="boolean", nullable=true)
  175.      */
  176.     private $isAccesCreateFacturePrejeance;
  177.     /**
  178.      * @Expose
  179.      * @ORM\Column(type="boolean", nullable=true)
  180.      */
  181.     private $isAccesValidationFactureSpv;
  182.     /**
  183.      * @Expose
  184.      * @ORM\Column(type="boolean", nullable=true)
  185.      */
  186.     private $isAccesValidationFacturePrejeance;
  187.     /**
  188.      * @Expose
  189.      * @ORM\Column(type="boolean", nullable=true)
  190.      */
  191.     private $isAccesValidationFactureMiseEnpaiement;
  192.     /**
  193.      * @Expose
  194.      * @ORM\Column(type="boolean", nullable=true)
  195.      */
  196.     private $isAccesConsultFacturePrejeance;
  197.     /**
  198.      * @Expose
  199.      * @ORM\Column(type="boolean", nullable=true)
  200.      */
  201.     private $isNotifDoc;
  202.     /**
  203.      * @Expose
  204.      * @ORM\Column(type="boolean", nullable=true)
  205.      */
  206.     private $isNotifProject;
  207.     /**
  208.      * @Expose
  209.      * @ORM\Column(type="boolean", nullable=true)
  210.      */
  211.     private $isNotifProjectArchive;
  212.     /**
  213.      * @Expose
  214.      * @ORM\Column(type="boolean", nullable=true)
  215.      */
  216.     private $isNotifClavus;
  217.     /**
  218.      * @Expose
  219.      * @ORM\Column(type="boolean", nullable=true)
  220.      */
  221.     private $isNotifDate;
  222.     /**
  223.      * @Expose
  224.      * @ORM\Column(type="boolean", nullable=true)
  225.      */
  226.     private $isNotifCommentaire;
  227.     /**
  228.      * @Expose
  229.      * @ORM\Column(type="boolean", nullable=true)
  230.      */
  231.     private $isNotifChat;
  232.     /**
  233.      * @ORM\Column(type="boolean", nullable=true)
  234.      */
  235.     private $isNotifImportFournisseur;
  236.     /**
  237.      * @ORM\Column(type="boolean", nullable=true)
  238.      */
  239.     private $isNotifChangeSpv;
  240.     /**
  241.      * @ORM\Column(type="boolean", nullable=true)
  242.      */
  243.     private $isNotifDateMESPrevisionnelle;
  244.     /**
  245.      * @ORM\Column(type="boolean", nullable=true)
  246.      */
  247.     private $isNotifLoyerPaye;
  248.     /**
  249.      * @Expose
  250.      * @ORM\Column(type="boolean", nullable=true)
  251.      */
  252.     private $isCreateUser;
  253.     /**
  254.      * @ORM\Column(type="text", nullable=true)
  255.      */
  256.     private $fournisseurType;
  257.     /**
  258.      * @ORM\Column(type="text", nullable=true)
  259.      */
  260.     private $tags;
  261.     /**
  262.      * @ORM\Column(type="json", nullable=true)
  263.      */
  264.     private $dashboardPreferences = [];
  265.     /**
  266.      * @ORM\Column(type="json", nullable=true)
  267.      */
  268.     private $colvisOdrer = [];
  269.     /**
  270.      * @ORM\Column(type="json", nullable=true)
  271.      */
  272.     private $dashboardOdrer = [];
  273.     /**
  274.      * @ORM\Column(type="text", nullable=true)
  275.      */
  276.     private $objectId;
  277.     /**
  278.      * @Expose
  279.      * @ORM\Column(type="boolean", nullable=true)
  280.      */
  281.     private $isLoginSso;
  282.     public function __construct()
  283.     {
  284.         $this->createdAt = new \DateTime();
  285.         $this->token =  md5(uniqid());
  286.         $this->spv = new ArrayCollection();
  287.         $this->userDroit = new ArrayCollection();
  288.     }
  289.     public function getId(): ?int
  290.     {
  291.         return $this->id;
  292.     }
  293.     public function getName()
  294.     {
  295.         return $this->firstname .' '.$this->lastname;
  296.     }
  297.     public function getEmail(): ?string
  298.     {
  299.         return $this->email;
  300.     }
  301.     public function setEmail(string $email): self
  302.     {
  303.         $this->email = $email;
  304.         return $this;
  305.     }
  306.     public function getPlainPassword(): ?string
  307.     {
  308.         return $this->plainPassword;
  309.     }
  310.     public function setPlainPassword(string $plainPassword): self
  311.     {
  312.         $this->plainPassword = $plainPassword;
  313.         return $this;
  314.     }
  315.     /**
  316.      * A visual identifier that represents this user.
  317.      *
  318.      * @see UserInterface
  319.      */
  320.     public function getUsername(): string
  321.     {
  322.         return (string) $this->email;
  323.     }
  324.     /**
  325.      * @see UserInterface
  326.      */
  327.     public function getRoles(): array
  328.     {
  329.         $roles = $this->roles;
  330.         $roles = json_decode($roles,true);
  331.         // guarantee every user at least has ROLE_USER
  332.         $roles[] = 'ROLE_USER';
  333.         return array_unique($roles);
  334.     }
  335.     public function getRoleString(){
  336.         $roles = $this->roles;
  337.         $roles = json_decode($roles,true);
  338.         if(in_array('ROLE_SUPER_ADMINISTRATOR',$roles)){
  339.             $string = 'Super admin';
  340.         }else if(in_array('ROLE_ADMIN',$roles)){
  341.             $string = 'Admin';
  342.         }else if(in_array('ROLE_EPC',$roles)){
  343.             $string = 'EPC';
  344.         }else if(in_array('ROLE_DEV',$roles)){
  345.             $string = 'DEV';
  346.         }else if(in_array('ROLE_GESTION_FINANCIER',$roles)){
  347.             $string = 'Gestionnaire financier';
  348.         }else if(in_array('ROLE_OPERATEUR_FINANCIER',$roles)){
  349.             $string = 'Operateur financier';
  350.         }else if(in_array('ROLE_ADMINISTRATEUR_FINANCIER',$roles)){
  351.             $string = 'Administrateur financier';
  352.         }else if(in_array('ROLE_AUDITEUR',$roles)){
  353.             $string = 'Auditeur';
  354.         }else if(in_array('ROLE_MAITRE_OEUVRE',$roles)){
  355.             $string = 'Maître d’Œuvre';
  356.         }else if(in_array('ROLE_AMO',$roles)){
  357.             $string = 'AMO';
  358.         }else if(in_array('ROLE_MACON',$roles)){
  359.             $string = 'Maçon';
  360.         }else if(in_array('ROLE_CONSTRUCTEUR',$roles)){
  361.             $string = 'Constructeur';
  362.         }else if(in_array('ROLE_CHARPENTIER',$roles)){
  363.             $string = 'Charpentier';
  364.         }else if(in_array('ROLE_ELECTRICIEN',$roles)){
  365.             $string = 'Electricien';
  366.         }else if(in_array('ROLE_COUVREUR',$roles)){
  367.             $string = 'Couvreur';
  368.         }else if(in_array('ROLE_POSEUR',$roles)){
  369.             $string = 'Poseur';
  370.         }else if(in_array('ROLE_AUTRE',$roles)){
  371.             $string = 'AUTRE';
  372.         }else if(in_array('ROLE_RESPONSABLE',$roles)){
  373.             $string = 'Responsable construction';
  374.         }else if(in_array('ROLE_RESPONSABLE_DEVELOPPEMENT',$roles)){
  375.             $string = 'Responsable développement';
  376.         }else if(in_array('ROLE_CONSTRUCTEUR',$roles)){
  377.             $string = 'Constructeur';
  378.         }else if(in_array('ROLE_DEVELOPPEMENT_ANALYSTE',$roles)){
  379.             $string = 'Développement + Analyste';
  380.         }else if(in_array('ROLE_ANALYSTE',$roles)){
  381.             $string = 'Analyste (focus METLD)';
  382.         }else if(in_array('ROLE_ASSET_MANAGER',$roles)){
  383.             $string = 'Asset Manager';
  384.         }else if(in_array('ROLE_COMPTABLE',$roles)){
  385.             $string = 'Comptable';
  386.         }else if(in_array('ROLE_FOURNISSEUR',$roles)){
  387.             $string = 'Fournisseur';
  388.         }else{
  389.             $string = 'User';
  390.         }
  391.         return $string;
  392.     }
  393.     public function getRoleStringComplet(){
  394.         $roles = $this->roles;
  395.         $roles = json_decode($roles,true);
  396.         if(in_array('ROLE_SUPER_ADMINISTRATOR',$roles)){
  397.             $string = 'Super administrateur';
  398.         }else if(in_array('ROLE_ADMIN',$roles)){
  399.             $string = 'Administrateur';
  400.         }else if(in_array('ROLE_EPC',$roles)){
  401.             $string = 'EPC';
  402.         }else if(in_array('ROLE_DEV',$roles)){
  403.             $string = 'Développeur';
  404.         }else if(in_array('ROLE_GESTION_FINANCIER',$roles)){
  405.             $string = 'Gestionnaire financier';
  406.         }else if(in_array('ROLE_OPERATEUR_FINANCIER',$roles)){
  407.             $string = 'Opérateur financier';
  408.         }else if(in_array('ROLE_ADMINISTRATEUR_FINANCIER',$roles)){
  409.             $string = 'Administrateur financier';
  410.         }else if(in_array('ROLE_AUDITEUR',$roles)){
  411.             $string = 'Auditeur';
  412.         }else if(in_array('ROLE_MAITRE_OEUVRE',$roles)){
  413.             $string = 'Maître d’Œuvre';
  414.         }else if(in_array('ROLE_AMO',$roles)){
  415.             $string = 'AMO';
  416.         }else if(in_array('ROLE_MACON',$roles)){
  417.             $string = 'Maçon';
  418.         }else if(in_array('ROLE_CONSTRUCTEUR',$roles)){
  419.             $string = 'Constructeur';
  420.         }else if(in_array('ROLE_CHARPENTIER',$roles)){
  421.             $string = 'Charpentier';
  422.         }else if(in_array('ROLE_ELECTRICIEN',$roles)){
  423.             $string = 'Electricien';
  424.         }else if(in_array('ROLE_COUVREUR',$roles)){
  425.             $string = 'Couvreur';
  426.         }else if(in_array('ROLE_POSEUR',$roles)){
  427.             $string = 'Poseur';
  428.         }else if(in_array('ROLE_AUTRE',$roles)){
  429.             $string = $this->autreRole;
  430.         }else if(in_array('ROLE_RESPONSABLE',$roles)){
  431.             $string = 'Responsable construction';
  432.         }else if(in_array('ROLE_RESPONSABLE_DEVELOPPEMENT',$roles)){
  433.             $string = 'Responsable développement';
  434.         }else if(in_array('ROLE_CONSTRUCTEUR',$roles)){
  435.             $string = 'Constructeur';
  436.         }else if(in_array('ROLE_DEVELOPPEMENT_ANALYSTE',$roles)){
  437.             $string = 'Développement + Analyste';
  438.         }else if(in_array('ROLE_ANALYSTE',$roles)){
  439.             $string = 'Analyste (focus METLD)';
  440.         }else if(in_array('ROLE_ASSET_MANAGER',$roles)){
  441.             $string = 'Asset Manager';
  442.         }else if(in_array('ROLE_COMPTABLE',$roles)){
  443.             $string = 'Comptable';
  444.         }else if(in_array('ROLE_FOURNISSEUR',$roles)){
  445.             $string = 'Fournisseur';
  446.         }else{
  447.             $string = 'User';
  448.         }
  449.         return $string;
  450.     }
  451.     public function setRoles(array $roles): self
  452.     {
  453.         $this->roles = json_encode($roles);
  454.         return $this;
  455.     }
  456.     /**
  457.      * @see UserInterface
  458.      */
  459.     public function getPassword(): string
  460.     {
  461.         return (string) $this->password;
  462.     }
  463.     public function setPassword(string $password): self
  464.     {
  465.         $this->password = $password;
  466.         return $this;
  467.     }
  468.     /**
  469.      * @see UserInterface
  470.      */
  471.     public function getSalt()
  472.     {
  473.         // not needed when using the "bcrypt" algorithm in security.yaml
  474.     }
  475.     /**
  476.      * @see UserInterface
  477.      */
  478.     public function eraseCredentials()
  479.     {
  480.         // If you store any temporary, sensitive data on the user, clear it here
  481.         // $this->plainPassword = null;
  482.     }
  483.     public function getFirstname(): ?string
  484.     {
  485.         return $this->firstname;
  486.     }
  487.     public function setFirstname(string $firstname): self
  488.     {
  489.         $this->firstname = $firstname;
  490.         return $this;
  491.     }
  492.     public function getLastname(): ?string
  493.     {
  494.         return $this->lastname;
  495.     }
  496.     public function setLastname(string $lastname): self
  497.     {
  498.         $this->lastname = $lastname;
  499.         return $this;
  500.     }
  501.     
  502.     public function getIsEnabled(): ?bool
  503.     {
  504.         return $this->isEnabled;
  505.     }
  506.     public function setIsEnabled(?bool $isEnabled): self
  507.     {
  508.         $this->isEnabled = $isEnabled;
  509.         return $this;
  510.     }
  511.     public function getIsArchived(): ?bool
  512.     {
  513.         return $this->isArchived;
  514.     }
  515.     public function setIsArchived(?bool $isArchived): self
  516.     {
  517.         $this->isArchived = $isArchived;
  518.         return $this;
  519.     }
  520.     public function __toString(){
  521.           return $this->firstname .' '.$this->lastname;
  522.      }
  523.     public function getCreatedAt(): ?\DateTimeInterface
  524.     {
  525.         return $this->createdAt;
  526.     }
  527.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  528.     {
  529.         $this->createdAt = $createdAt;
  530.         return $this;
  531.     }
  532.     public function getSiret(): ?string
  533.     {
  534.         return $this->siret;
  535.     }
  536.     public function setSiret(?string $siret): self
  537.     {
  538.         $this->siret = $siret;
  539.         return $this;
  540.     }
  541.     public function getToken(): ?string
  542.     {
  543.         return $this->token;
  544.     }
  545.     public function setToken(?string $token): self
  546.     {
  547.         $this->token = $token;
  548.         return $this;
  549.     }
  550.     public function getAcces(): ?string
  551.     {
  552.         return $this->acces;
  553.     }
  554.     public function setAcces(?string $acces): self
  555.     {
  556.         $this->acces = $acces;
  557.         return $this;
  558.     }
  559.     public function getEntreprise(): ?Entreprise
  560.     {
  561.         return $this->entreprise;
  562.     }
  563.     public function setEntreprise(?Entreprise $entreprise): self
  564.     {
  565.         $this->entreprise = $entreprise;
  566.         return $this;
  567.     }
  568.     public function getDerniereConnecxion(): ?\DateTimeInterface
  569.     {
  570.         return $this->derniereConnecxion;
  571.     }
  572.     public function setDerniereConnecxion(?\DateTimeInterface $derniereConnecxion): self
  573.     {
  574.         $this->derniereConnecxion = $derniereConnecxion;
  575.         return $this;
  576.     }
  577.     /**
  578.      * @return Collection|Spv[]
  579.      */
  580.     public function getSpv(): Collection
  581.     {
  582.         return $this->spv;
  583.     }
  584.     public function addSpv(Spv $spv): self
  585.     {
  586.         if (!$this->spv->contains($spv)) {
  587.             $this->spv[] = $spv;
  588.         }
  589.         return $this;
  590.     }
  591.     public function removeSpv(Spv $spv): self
  592.     {
  593.         $this->spv->removeElement($spv);
  594.         return $this;
  595.     }
  596.     public function getCouleurRapport(): ?string
  597.     {
  598.         return $this->couleurRapport;
  599.     }
  600.     public function setCouleurRapport(?string $couleurRapport): self
  601.     {
  602.         $this->couleurRapport = $couleurRapport;
  603.         return $this;
  604.     }
  605.     public function getIntervenantNum(): ?string
  606.     {
  607.         return $this->intervenantNum;
  608.     }
  609.     public function setIntervenantNum(?string $intervenantNum): self
  610.     {
  611.         $this->intervenantNum = $intervenantNum;
  612.         return $this;
  613.     }
  614.     /**
  615.      * @return Collection|UserDroit[]
  616.      */
  617.     public function getUserDroit(): Collection
  618.     {
  619.         return $this->userDroit;
  620.     }
  621.     public function addUserDroit(UserDroit $userDroit): self
  622.     {
  623.         if (!$this->userDroit->contains($userDroit)) {
  624.             $this->userDroit[] = $userDroit;
  625.             $userDroit->setUser($this);
  626.         }
  627.         return $this;
  628.     }
  629.     public function removeUserDroit(UserDroit $userDroit): self
  630.     {
  631.         if ($this->userDroit->removeElement($userDroit)) {
  632.             // set the owning side to null (unless already changed)
  633.             if ($userDroit->getUser() === $this) {
  634.                 $userDroit->setUser(null);
  635.             }
  636.         }
  637.         return $this;
  638.     }
  639.     public function getAutreRole(): ?string
  640.     {
  641.         return $this->autreRole;
  642.     }
  643.     public function setAutreRole(?string $autreRole): self
  644.     {
  645.         $this->autreRole = $autreRole;
  646.         return $this;
  647.     }
  648.     public function isEmailAuthEnabled(): bool
  649.     {
  650.         return true; // This can be a persisted field to switch email code authentication on/off
  651.     }
  652.     public function getEmailAuthRecipient(): string
  653.     {
  654.         return $this->email;
  655.     }
  656.     public function getEmailAuthCode(): string
  657.     {
  658.         if (null === $this->authCode) {
  659.             throw new \LogicException('The email authentication code was not set');
  660.         }
  661.         return $this->authCode;
  662.     }
  663.     public function setEmailAuthCode(string $authCode): void
  664.     {
  665.         $this->authCode = $authCode;
  666.     }
  667.     public function getAuthCode(): ?string
  668.     {
  669.         return $this->authCode;
  670.     }
  671.     public function setAuthCode(?string $authCode): self
  672.     {
  673.         $this->authCode = $authCode;
  674.         return $this;
  675.     }
  676.     public function getResetToken(): ?string
  677.     {
  678.         return $this->resetToken;
  679.     }
  680.     public function setResetToken(?string $resetToken): self
  681.     {
  682.         $this->resetToken = $resetToken;
  683.         return $this;
  684.     }
  685.     public function getFournisseur(): ?Fournisseur
  686.     {
  687.         return $this->fournisseur;
  688.     }
  689.     public function setFournisseur(?Fournisseur $fournisseur): self
  690.     {
  691.         $this->fournisseur = $fournisseur;
  692.         return $this;
  693.     }
  694.     public function getTel(): ?string
  695.     {
  696.         return $this->tel;
  697.     }
  698.     public function setTel(?string $tel): self
  699.     {
  700.         $this->tel = $tel;
  701.         return $this;
  702.     }
  703.     public function getCodeDev(): ?string
  704.     {
  705.         return $this->codeDev;
  706.     }
  707.     public function setCodeDev(?string $codeDev): self
  708.     {
  709.         $this->codeDev = $codeDev;
  710.         return $this;
  711.     }
  712.     public function getTypeAcces(): ?string
  713.     {
  714.         return $this->typeAcces;
  715.     }
  716.     public function setTypeAcces(?string $typeAcces): self
  717.     {
  718.         $this->typeAcces = $typeAcces;
  719.         return $this;
  720.     }
  721.     public function getIsAccesCreateFactureSpv(): ?bool
  722.     {
  723.         return $this->isAccesCreateFactureSpv;
  724.     }
  725.     public function setIsAccesCreateFactureSpv(?bool $isAccesCreateFactureSpv): self
  726.     {
  727.         $this->isAccesCreateFactureSpv = $isAccesCreateFactureSpv;
  728.         return $this;
  729.     }
  730.     public function getIsAccesCreateFacturePrejeance(): ?bool
  731.     {
  732.         return $this->isAccesCreateFacturePrejeance;
  733.     }
  734.     public function setIsAccesCreateFacturePrejeance(?bool $isAccesCreateFacturePrejeance): self
  735.     {
  736.         $this->isAccesCreateFacturePrejeance = $isAccesCreateFacturePrejeance;
  737.         return $this;
  738.     }
  739.     public function getIsAccesValidationFactureSpv(): ?bool
  740.     {
  741.         return $this->isAccesValidationFactureSpv;
  742.     }
  743.     public function setIsAccesValidationFactureSpv(?bool $isAccesValidationFactureSpv): self
  744.     {
  745.         $this->isAccesValidationFactureSpv = $isAccesValidationFactureSpv;
  746.         return $this;
  747.     }
  748.     public function getIsAccesValidationFacturePrejeance(): ?bool
  749.     {
  750.         return $this->isAccesValidationFacturePrejeance;
  751.     }
  752.     public function setIsAccesValidationFacturePrejeance(?bool $isAccesValidationFacturePrejeance): self
  753.     {
  754.         $this->isAccesValidationFacturePrejeance = $isAccesValidationFacturePrejeance;
  755.         return $this;
  756.     }
  757.     public function getIsAccesValidationFactureMiseEnpaiement(): ?bool
  758.     {
  759.         return $this->isAccesValidationFactureMiseEnpaiement;
  760.     }
  761.     public function setIsAccesValidationFactureMiseEnpaiement(?bool $isAccesValidationFactureMiseEnpaiement): self
  762.     {
  763.         $this->isAccesValidationFactureMiseEnpaiement = $isAccesValidationFactureMiseEnpaiement;
  764.         return $this;
  765.     }
  766.     public function getIsAccesConsultFacturePrejeance(): ?bool
  767.     {
  768.         return $this->isAccesConsultFacturePrejeance;
  769.     }
  770.     public function setIsAccesConsultFacturePrejeance(?bool $isAccesConsultFacturePrejeance): self
  771.     {
  772.         $this->isAccesConsultFacturePrejeance = $isAccesConsultFacturePrejeance;
  773.         return $this;
  774.     }
  775.     public function getIsNotifDoc(): ?bool
  776.     {
  777.         return $this->isNotifDoc;
  778.     }
  779.     public function setIsNotifDoc(?bool $isNotifDoc): self
  780.     {
  781.         $this->isNotifDoc = $isNotifDoc;
  782.         return $this;
  783.     }
  784.     public function getIsNotifClavus(): ?bool
  785.     {
  786.         return $this->isNotifClavus;
  787.     }
  788.     public function setIsNotifClavus(?bool $isNotifClavus): self
  789.     {
  790.         $this->isNotifClavus = $isNotifClavus;
  791.         return $this;
  792.     }
  793.     public function getIsNotifDate(): ?bool
  794.     {
  795.         return $this->isNotifDate;
  796.     }
  797.     public function setIsNotifDate(?bool $isNotifDate): self
  798.     {
  799.         $this->isNotifDate = $isNotifDate;
  800.         return $this;
  801.     }
  802.     public function getIsNotifCommentaire(): ?bool
  803.     {
  804.         return $this->isNotifCommentaire;
  805.     }
  806.     public function setIsNotifCommentaire(?bool $isNotifCommentaire): self
  807.     {
  808.         $this->isNotifCommentaire = $isNotifCommentaire;
  809.         return $this;
  810.     }
  811.     public function getIsNotifChat(): ?bool
  812.     {
  813.         return $this->isNotifChat;
  814.     }
  815.     public function setIsNotifChat(?bool $isNotifChat): self
  816.     {
  817.         $this->isNotifChat = $isNotifChat;
  818.         return $this;
  819.     }
  820.     public function getIsNotifProject(): ?bool
  821.     {
  822.         return $this->isNotifProject;
  823.     }
  824.     public function setIsNotifProject(?bool $isNotifProject): self
  825.     {
  826.         $this->isNotifProject = $isNotifProject;
  827.         return $this;
  828.     }
  829.     public function getIsNotifImportFournisseur(): ?bool
  830.     {
  831.         return $this->isNotifImportFournisseur;
  832.     }
  833.     public function setIsNotifImportFournisseur(?bool $isNotifImportFournisseur): self
  834.     {
  835.         $this->isNotifImportFournisseur = $isNotifImportFournisseur;
  836.         return $this;
  837.     }
  838.     public function getIsNotifChangeSpv(): ?bool
  839.     {
  840.         return $this->isNotifChangeSpv;
  841.     }
  842.     public function setIsNotifChangeSpv(?bool $isNotifChangeSpv): self
  843.     {
  844.         $this->isNotifChangeSpv = $isNotifChangeSpv;
  845.         return $this;
  846.     }
  847.     public function getIsNotifDateMESPrevisionnelle(): ?bool
  848.     {
  849.         return $this->isNotifDateMESPrevisionnelle;
  850.     }
  851.     public function setIsNotifDateMESPrevisionnelle(?bool $isNotifDateMESPrevisionnelle): self
  852.     {
  853.         $this->isNotifDateMESPrevisionnelle = $isNotifDateMESPrevisionnelle;
  854.         return $this;
  855.     }
  856.     public function getIsCreateUser(): ?bool
  857.     {
  858.         return $this->isCreateUser;
  859.     }
  860.     public function setIsCreateUser(?bool $isCreateUser): self
  861.     {
  862.         $this->isCreateUser = $isCreateUser;
  863.         return $this;
  864.     }
  865.     public function getFournisseurType(): ?string
  866.     {
  867.         return $this->fournisseurType;
  868.     }
  869.     public function setFournisseurType(?string $fournisseurType): self
  870.     {
  871.         $this->fournisseurType = $fournisseurType;
  872.         return $this;
  873.     }
  874.     public function getFournisseurTypeStr(){
  875.         $fournisseurType = $this->fournisseurType;
  876.        if($fournisseurType == self::fournisseur_type_EPC){
  877.            return 'EPC';
  878.        }elseif ($fournisseurType == self::fournisseur_type_Installateur){
  879.            return 'Installateur';
  880.        }elseif ($fournisseurType == self::fournisseur_type_Charpentier){
  881.            return 'Charpentier';
  882.        }elseif ($fournisseurType == self::fournisseur_type_Notaire){
  883.            return 'Notaire';
  884.        }elseif ($fournisseurType == self::fournisseur_type_Constructeur){
  885.            return 'Constructeur';
  886.        }elseif ($fournisseurType == self::fournisseur_type_Mainteneur){
  887.            return 'Mainteneur';
  888.        }elseif ($fournisseurType == self::fournisseur_type_Conducteur){
  889.            return 'Conducteur';
  890.        }elseif ($fournisseurType == self::fournisseur_type_AMO){
  891.            return 'AMO';
  892.        }else{
  893.            return null;
  894.        }
  895.     }
  896.     public function getTypeAccesStr(){
  897.         $typeAcces = $this->typeAcces;
  898.         if($typeAcces == self::ACCES_admin_prejeance){
  899.             return 'Admin Prejeance';
  900.         }elseif ($typeAcces == self::ACCES_interne_prejeance){
  901.             return 'Interne Prejeance';
  902.         }elseif ($typeAcces == self::ACCES_intervenant){
  903.             return 'Intervenant';
  904.         }elseif ($typeAcces == self::ACCES_visiteur){
  905.             return 'Visiteur';
  906.         }elseif ($typeAcces == self::ACCES_comptable){
  907.             return 'Comptable';
  908.         }else{
  909.             return '';
  910.         }
  911.     }
  912.     public function getTags(): ?string
  913.     {
  914.         return $this->tags;
  915.     }
  916.     public function setTags(?string $tags): self
  917.     {
  918.         $this->tags = $tags;
  919.         return $this;
  920.     }
  921.     public function getIsNotifProjectArchive(): ?bool
  922.     {
  923.         return $this->isNotifProjectArchive;
  924.     }
  925.     public function setIsNotifProjectArchive(?bool $isNotifProjectArchive): self
  926.     {
  927.         $this->isNotifProjectArchive = $isNotifProjectArchive;
  928.         return $this;
  929.     }
  930.     public function getDashboardPreferences(): ?array
  931.     {
  932.         if($this->dashboardPreferences and $this->dashboardPreferences != []){
  933.             return $this->dashboardPreferences ;
  934.         }else{
  935.             return  [
  936.                 'projets' => [
  937.                     'nouveau' => false,
  938.                     'suivi' => true
  939.                 ],
  940.                 'finances' => [
  941.                     'factures' => true,
  942.                     'avoir' => false,
  943.                     'bon_commande' => false,
  944.                 ],
  945.                 'utilisateurs' => ['comptes' => false],
  946.                 'exploitations' => [
  947.                     'centrales' => false,
  948.                     'rapports' => false,
  949.                 ],
  950.                 'informations' => ['notifications' => true],
  951.             ];
  952.         }
  953.     }
  954.     public function setDashboardPreferences(?array $dashboardPreferences): self
  955.     {
  956.         $this->dashboardPreferences = $dashboardPreferences ?? [];
  957.         return $this;
  958.     }
  959.     public function getColvisOdrer(): ?array
  960.     {
  961.         return $this->colvisOdrer ?? [];
  962.     }
  963.     public function setColvisOdrer(?array $colvisOdrer): self
  964.     {
  965.         $this->colvisOdrer = $colvisOdrer;
  966.         return $this;
  967.     }
  968.     public function getDashboardOdrer(): ?array
  969.     {
  970.         return $this->dashboardOdrer ?? [];
  971.     }
  972.     public function setDashboardOdrer(?array $dashboardOdrer): self
  973.     {
  974.         $this->dashboardOdrer = $dashboardOdrer;
  975.         return $this;
  976.     }
  977.     public function getIsNotifLoyerPaye(): ?bool
  978.     {
  979.         return $this->isNotifLoyerPaye;
  980.     }
  981.     public function setIsNotifLoyerPaye(?bool $isNotifLoyerPaye): self
  982.     {
  983.         $this->isNotifLoyerPaye = $isNotifLoyerPaye;
  984.         return $this;
  985.     }
  986.     public function getObjectId(): ?string
  987.     {
  988.         return $this->objectId;
  989.     }
  990.     public function setObjectId(?string $objectId): self
  991.     {
  992.         $this->objectId = $objectId;
  993.         return $this;
  994.     }
  995.     public function getIsLoginSso(): ?bool
  996.     {
  997.         return $this->isLoginSso;
  998.     }
  999.     public function setIsLoginSso(?bool $isLoginSso): self
  1000.     {
  1001.         $this->isLoginSso = $isLoginSso;
  1002.         return $this;
  1003.     }
  1004. }