<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use JMS\Serializer\Annotation\Expose;
use JMS\Serializer\Annotation\ExclusionPolicy;
use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface;
/**
* @ExclusionPolicy("all")
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
* @UniqueEntity(fields={"email"}, message="Il existe déjà un compte avec cet e-mail")
*/
class User implements UserInterface, TwoFactorInterface
{
const ACCES_LECTURE = 1;
const ACCES_ECRETURE = 2;
const INTERVENANT_MAITRE_OEUVRE = 1;
const INTERVENANT_AMO = 2;
const INTERVENANT_MACON = 3;
const INTERVENANT_CONSTRUCTEUR = 4;
const INTERVENANT_CHARPENTIER = 5;
const INTERVENANT_ELECTRICIEN = 6;
const INTERVENANT_COUVREUR = 7;
const INTERVENANT_POSEUR = 8;
const INTERVENANT_AUTRE = 9;
const ACCES_admin_prejeance = 1;
const ACCES_interne_prejeance = 2;
const ACCES_externe_prejeance = 3;
const ACCES_intervenant = 4;
const ACCES_visiteur = 5;
const ACCES_comptable = 6;
const fournisseur_type_EPC = 1;
const fournisseur_type_Installateur = 2;
const fournisseur_type_Charpentier = 3;
const fournisseur_type_Notaire = 4;
const fournisseur_type_Constructeur = 5;
const fournisseur_type_Mainteneur = 6;
const fournisseur_type_Conducteur = 7;
const fournisseur_type_AMO = 8;
/**
* @Expose
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $authCode;
/**
* @Expose
* @ORM\Column(type="string", length=180, unique=true)
* @Assert\Email(
* message = "Cette e-mail '{{ value }}' n`est pas valid.",
* )
* @Assert\NotBlank( message = "email is required.")
*/
private $email;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $tel;
/**
* @Expose
* @ORM\Column(type="string", length=255,nullable=true)
* @Assert\NotBlank( message = "firstname is required.")
*/
private $firstname;
/**
* @Expose
* @ORM\Column(type="string", length=255,nullable=true)
* @Assert\NotBlank( message = "lastname is required.")
*/
private $lastname;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isEnabled;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isArchived;
/**
* @ORM\Column(type="text" , nullable=true)
*/
private $roles = [];
/**
* @var string The hashed password
* @ORM\Column(type="string")
*/
private $password;
private $plainPassword;
/**
* @var string le token qui servira lors de l'oubli de mot de passe
* @ORM\Column(type="text", nullable=true)
*/
protected $resetToken;
/**
* @Expose
* @ORM\Column(type="datetime", nullable=true)
*/
private $createdAt;
/**
* @Expose
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $token;
/**
* @ORM\ManyToOne(targetEntity="Entreprise", cascade={"persist"})
* @ORM\JoinColumn(name="entreprise_id", referencedColumnName="id",nullable=true)
*/
private $entreprise;
/**
* @Expose
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $acces ;
/**
* @Expose
* @ORM\Column(type="datetime", nullable=true)
*/
private $derniereConnecxion;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Spv", cascade={"persist"})
* @ORM\JoinColumn(referencedColumnName="id",nullable=true ,onDelete="SET NULL")
* @ORM\OrderBy({"name" = "asc"})
*/
private $spv;
/**
* @ORM\Column(type="string", length=255,nullable=true)
*/
private $couleurRapport;
/**
* @Expose
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $intervenantNum ;
/**
* @ORM\OneToMany(targetEntity="App\Entity\UserDroit", mappedBy="user", cascade={"persist"})
*/
private $userDroit;
/**
* @ORM\Column(type="string", length=255,nullable=true)
*/
private $autreRole;
/**
* @ORM\ManyToOne(targetEntity="Fournisseur", cascade={"persist"},inversedBy="user")
* @ORM\JoinColumn(name="fournisseur_id", referencedColumnName="id",nullable=true)
*/
private $fournisseur;
/**
* @ORM\Column(type="string", length=255,nullable=true)
*/
private $codeDev;
/**
* @ORM\Column(type="string", length=255,nullable=true)
*/
private $typeAcces;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isAccesCreateFactureSpv;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isAccesCreateFacturePrejeance;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isAccesValidationFactureSpv;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isAccesValidationFacturePrejeance;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isAccesValidationFactureMiseEnpaiement;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isAccesConsultFacturePrejeance;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isNotifDoc;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isNotifProject;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isNotifProjectArchive;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isNotifClavus;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isNotifDate;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isNotifCommentaire;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isNotifChat;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isNotifImportFournisseur;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isNotifChangeSpv;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isNotifDateMESPrevisionnelle;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isNotifLoyerPaye;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isCreateUser;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $fournisseurType;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $tags;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $dashboardPreferences = [];
/**
* @ORM\Column(type="json", nullable=true)
*/
private $colvisOdrer = [];
/**
* @ORM\Column(type="json", nullable=true)
*/
private $dashboardOdrer = [];
/**
* @ORM\Column(type="text", nullable=true)
*/
private $objectId;
/**
* @Expose
* @ORM\Column(type="boolean", nullable=true)
*/
private $isLoginSso;
public function __construct()
{
$this->createdAt = new \DateTime();
$this->token = md5(uniqid());
$this->spv = new ArrayCollection();
$this->userDroit = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName()
{
return $this->firstname .' '.$this->lastname;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getPlainPassword(): ?string
{
return $this->plainPassword;
}
public function setPlainPassword(string $plainPassword): self
{
$this->plainPassword = $plainPassword;
return $this;
}
/**
* A visual identifier that represents this user.
*
* @see UserInterface
*/
public function getUsername(): string
{
return (string) $this->email;
}
/**
* @see UserInterface
*/
public function getRoles(): array
{
$roles = $this->roles;
$roles = json_decode($roles,true);
// guarantee every user at least has ROLE_USER
$roles[] = 'ROLE_USER';
return array_unique($roles);
}
public function getRoleString(){
$roles = $this->roles;
$roles = json_decode($roles,true);
if(in_array('ROLE_SUPER_ADMINISTRATOR',$roles)){
$string = 'Super admin';
}else if(in_array('ROLE_ADMIN',$roles)){
$string = 'Admin';
}else if(in_array('ROLE_EPC',$roles)){
$string = 'EPC';
}else if(in_array('ROLE_DEV',$roles)){
$string = 'DEV';
}else if(in_array('ROLE_GESTION_FINANCIER',$roles)){
$string = 'Gestionnaire financier';
}else if(in_array('ROLE_OPERATEUR_FINANCIER',$roles)){
$string = 'Operateur financier';
}else if(in_array('ROLE_ADMINISTRATEUR_FINANCIER',$roles)){
$string = 'Administrateur financier';
}else if(in_array('ROLE_AUDITEUR',$roles)){
$string = 'Auditeur';
}else if(in_array('ROLE_MAITRE_OEUVRE',$roles)){
$string = 'Maître d’Œuvre';
}else if(in_array('ROLE_AMO',$roles)){
$string = 'AMO';
}else if(in_array('ROLE_MACON',$roles)){
$string = 'Maçon';
}else if(in_array('ROLE_CONSTRUCTEUR',$roles)){
$string = 'Constructeur';
}else if(in_array('ROLE_CHARPENTIER',$roles)){
$string = 'Charpentier';
}else if(in_array('ROLE_ELECTRICIEN',$roles)){
$string = 'Electricien';
}else if(in_array('ROLE_COUVREUR',$roles)){
$string = 'Couvreur';
}else if(in_array('ROLE_POSEUR',$roles)){
$string = 'Poseur';
}else if(in_array('ROLE_AUTRE',$roles)){
$string = 'AUTRE';
}else if(in_array('ROLE_RESPONSABLE',$roles)){
$string = 'Responsable construction';
}else if(in_array('ROLE_RESPONSABLE_DEVELOPPEMENT',$roles)){
$string = 'Responsable développement';
}else if(in_array('ROLE_CONSTRUCTEUR',$roles)){
$string = 'Constructeur';
}else if(in_array('ROLE_DEVELOPPEMENT_ANALYSTE',$roles)){
$string = 'Développement + Analyste';
}else if(in_array('ROLE_ANALYSTE',$roles)){
$string = 'Analyste (focus METLD)';
}else if(in_array('ROLE_ASSET_MANAGER',$roles)){
$string = 'Asset Manager';
}else if(in_array('ROLE_COMPTABLE',$roles)){
$string = 'Comptable';
}else if(in_array('ROLE_FOURNISSEUR',$roles)){
$string = 'Fournisseur';
}else{
$string = 'User';
}
return $string;
}
public function getRoleStringComplet(){
$roles = $this->roles;
$roles = json_decode($roles,true);
if(in_array('ROLE_SUPER_ADMINISTRATOR',$roles)){
$string = 'Super administrateur';
}else if(in_array('ROLE_ADMIN',$roles)){
$string = 'Administrateur';
}else if(in_array('ROLE_EPC',$roles)){
$string = 'EPC';
}else if(in_array('ROLE_DEV',$roles)){
$string = 'Développeur';
}else if(in_array('ROLE_GESTION_FINANCIER',$roles)){
$string = 'Gestionnaire financier';
}else if(in_array('ROLE_OPERATEUR_FINANCIER',$roles)){
$string = 'Opérateur financier';
}else if(in_array('ROLE_ADMINISTRATEUR_FINANCIER',$roles)){
$string = 'Administrateur financier';
}else if(in_array('ROLE_AUDITEUR',$roles)){
$string = 'Auditeur';
}else if(in_array('ROLE_MAITRE_OEUVRE',$roles)){
$string = 'Maître d’Œuvre';
}else if(in_array('ROLE_AMO',$roles)){
$string = 'AMO';
}else if(in_array('ROLE_MACON',$roles)){
$string = 'Maçon';
}else if(in_array('ROLE_CONSTRUCTEUR',$roles)){
$string = 'Constructeur';
}else if(in_array('ROLE_CHARPENTIER',$roles)){
$string = 'Charpentier';
}else if(in_array('ROLE_ELECTRICIEN',$roles)){
$string = 'Electricien';
}else if(in_array('ROLE_COUVREUR',$roles)){
$string = 'Couvreur';
}else if(in_array('ROLE_POSEUR',$roles)){
$string = 'Poseur';
}else if(in_array('ROLE_AUTRE',$roles)){
$string = $this->autreRole;
}else if(in_array('ROLE_RESPONSABLE',$roles)){
$string = 'Responsable construction';
}else if(in_array('ROLE_RESPONSABLE_DEVELOPPEMENT',$roles)){
$string = 'Responsable développement';
}else if(in_array('ROLE_CONSTRUCTEUR',$roles)){
$string = 'Constructeur';
}else if(in_array('ROLE_DEVELOPPEMENT_ANALYSTE',$roles)){
$string = 'Développement + Analyste';
}else if(in_array('ROLE_ANALYSTE',$roles)){
$string = 'Analyste (focus METLD)';
}else if(in_array('ROLE_ASSET_MANAGER',$roles)){
$string = 'Asset Manager';
}else if(in_array('ROLE_COMPTABLE',$roles)){
$string = 'Comptable';
}else if(in_array('ROLE_FOURNISSEUR',$roles)){
$string = 'Fournisseur';
}else{
$string = 'User';
}
return $string;
}
public function setRoles(array $roles): self
{
$this->roles = json_encode($roles);
return $this;
}
/**
* @see UserInterface
*/
public function getPassword(): string
{
return (string) $this->password;
}
public function setPassword(string $password): self
{
$this->password = $password;
return $this;
}
/**
* @see UserInterface
*/
public function getSalt()
{
// not needed when using the "bcrypt" algorithm in security.yaml
}
/**
* @see UserInterface
*/
public function eraseCredentials()
{
// If you store any temporary, sensitive data on the user, clear it here
// $this->plainPassword = null;
}
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 getIsEnabled(): ?bool
{
return $this->isEnabled;
}
public function setIsEnabled(?bool $isEnabled): self
{
$this->isEnabled = $isEnabled;
return $this;
}
public function getIsArchived(): ?bool
{
return $this->isArchived;
}
public function setIsArchived(?bool $isArchived): self
{
$this->isArchived = $isArchived;
return $this;
}
public function __toString(){
return $this->firstname .' '.$this->lastname;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getSiret(): ?string
{
return $this->siret;
}
public function setSiret(?string $siret): self
{
$this->siret = $siret;
return $this;
}
public function getToken(): ?string
{
return $this->token;
}
public function setToken(?string $token): self
{
$this->token = $token;
return $this;
}
public function getAcces(): ?string
{
return $this->acces;
}
public function setAcces(?string $acces): self
{
$this->acces = $acces;
return $this;
}
public function getEntreprise(): ?Entreprise
{
return $this->entreprise;
}
public function setEntreprise(?Entreprise $entreprise): self
{
$this->entreprise = $entreprise;
return $this;
}
public function getDerniereConnecxion(): ?\DateTimeInterface
{
return $this->derniereConnecxion;
}
public function setDerniereConnecxion(?\DateTimeInterface $derniereConnecxion): self
{
$this->derniereConnecxion = $derniereConnecxion;
return $this;
}
/**
* @return Collection|Spv[]
*/
public function getSpv(): Collection
{
return $this->spv;
}
public function addSpv(Spv $spv): self
{
if (!$this->spv->contains($spv)) {
$this->spv[] = $spv;
}
return $this;
}
public function removeSpv(Spv $spv): self
{
$this->spv->removeElement($spv);
return $this;
}
public function getCouleurRapport(): ?string
{
return $this->couleurRapport;
}
public function setCouleurRapport(?string $couleurRapport): self
{
$this->couleurRapport = $couleurRapport;
return $this;
}
public function getIntervenantNum(): ?string
{
return $this->intervenantNum;
}
public function setIntervenantNum(?string $intervenantNum): self
{
$this->intervenantNum = $intervenantNum;
return $this;
}
/**
* @return Collection|UserDroit[]
*/
public function getUserDroit(): Collection
{
return $this->userDroit;
}
public function addUserDroit(UserDroit $userDroit): self
{
if (!$this->userDroit->contains($userDroit)) {
$this->userDroit[] = $userDroit;
$userDroit->setUser($this);
}
return $this;
}
public function removeUserDroit(UserDroit $userDroit): self
{
if ($this->userDroit->removeElement($userDroit)) {
// set the owning side to null (unless already changed)
if ($userDroit->getUser() === $this) {
$userDroit->setUser(null);
}
}
return $this;
}
public function getAutreRole(): ?string
{
return $this->autreRole;
}
public function setAutreRole(?string $autreRole): self
{
$this->autreRole = $autreRole;
return $this;
}
public function isEmailAuthEnabled(): bool
{
return true; // This can be a persisted field to switch email code authentication on/off
}
public function getEmailAuthRecipient(): string
{
return $this->email;
}
public function getEmailAuthCode(): string
{
if (null === $this->authCode) {
throw new \LogicException('The email authentication code was not set');
}
return $this->authCode;
}
public function setEmailAuthCode(string $authCode): void
{
$this->authCode = $authCode;
}
public function getAuthCode(): ?string
{
return $this->authCode;
}
public function setAuthCode(?string $authCode): self
{
$this->authCode = $authCode;
return $this;
}
public function getResetToken(): ?string
{
return $this->resetToken;
}
public function setResetToken(?string $resetToken): self
{
$this->resetToken = $resetToken;
return $this;
}
public function getFournisseur(): ?Fournisseur
{
return $this->fournisseur;
}
public function setFournisseur(?Fournisseur $fournisseur): self
{
$this->fournisseur = $fournisseur;
return $this;
}
public function getTel(): ?string
{
return $this->tel;
}
public function setTel(?string $tel): self
{
$this->tel = $tel;
return $this;
}
public function getCodeDev(): ?string
{
return $this->codeDev;
}
public function setCodeDev(?string $codeDev): self
{
$this->codeDev = $codeDev;
return $this;
}
public function getTypeAcces(): ?string
{
return $this->typeAcces;
}
public function setTypeAcces(?string $typeAcces): self
{
$this->typeAcces = $typeAcces;
return $this;
}
public function getIsAccesCreateFactureSpv(): ?bool
{
return $this->isAccesCreateFactureSpv;
}
public function setIsAccesCreateFactureSpv(?bool $isAccesCreateFactureSpv): self
{
$this->isAccesCreateFactureSpv = $isAccesCreateFactureSpv;
return $this;
}
public function getIsAccesCreateFacturePrejeance(): ?bool
{
return $this->isAccesCreateFacturePrejeance;
}
public function setIsAccesCreateFacturePrejeance(?bool $isAccesCreateFacturePrejeance): self
{
$this->isAccesCreateFacturePrejeance = $isAccesCreateFacturePrejeance;
return $this;
}
public function getIsAccesValidationFactureSpv(): ?bool
{
return $this->isAccesValidationFactureSpv;
}
public function setIsAccesValidationFactureSpv(?bool $isAccesValidationFactureSpv): self
{
$this->isAccesValidationFactureSpv = $isAccesValidationFactureSpv;
return $this;
}
public function getIsAccesValidationFacturePrejeance(): ?bool
{
return $this->isAccesValidationFacturePrejeance;
}
public function setIsAccesValidationFacturePrejeance(?bool $isAccesValidationFacturePrejeance): self
{
$this->isAccesValidationFacturePrejeance = $isAccesValidationFacturePrejeance;
return $this;
}
public function getIsAccesValidationFactureMiseEnpaiement(): ?bool
{
return $this->isAccesValidationFactureMiseEnpaiement;
}
public function setIsAccesValidationFactureMiseEnpaiement(?bool $isAccesValidationFactureMiseEnpaiement): self
{
$this->isAccesValidationFactureMiseEnpaiement = $isAccesValidationFactureMiseEnpaiement;
return $this;
}
public function getIsAccesConsultFacturePrejeance(): ?bool
{
return $this->isAccesConsultFacturePrejeance;
}
public function setIsAccesConsultFacturePrejeance(?bool $isAccesConsultFacturePrejeance): self
{
$this->isAccesConsultFacturePrejeance = $isAccesConsultFacturePrejeance;
return $this;
}
public function getIsNotifDoc(): ?bool
{
return $this->isNotifDoc;
}
public function setIsNotifDoc(?bool $isNotifDoc): self
{
$this->isNotifDoc = $isNotifDoc;
return $this;
}
public function getIsNotifClavus(): ?bool
{
return $this->isNotifClavus;
}
public function setIsNotifClavus(?bool $isNotifClavus): self
{
$this->isNotifClavus = $isNotifClavus;
return $this;
}
public function getIsNotifDate(): ?bool
{
return $this->isNotifDate;
}
public function setIsNotifDate(?bool $isNotifDate): self
{
$this->isNotifDate = $isNotifDate;
return $this;
}
public function getIsNotifCommentaire(): ?bool
{
return $this->isNotifCommentaire;
}
public function setIsNotifCommentaire(?bool $isNotifCommentaire): self
{
$this->isNotifCommentaire = $isNotifCommentaire;
return $this;
}
public function getIsNotifChat(): ?bool
{
return $this->isNotifChat;
}
public function setIsNotifChat(?bool $isNotifChat): self
{
$this->isNotifChat = $isNotifChat;
return $this;
}
public function getIsNotifProject(): ?bool
{
return $this->isNotifProject;
}
public function setIsNotifProject(?bool $isNotifProject): self
{
$this->isNotifProject = $isNotifProject;
return $this;
}
public function getIsNotifImportFournisseur(): ?bool
{
return $this->isNotifImportFournisseur;
}
public function setIsNotifImportFournisseur(?bool $isNotifImportFournisseur): self
{
$this->isNotifImportFournisseur = $isNotifImportFournisseur;
return $this;
}
public function getIsNotifChangeSpv(): ?bool
{
return $this->isNotifChangeSpv;
}
public function setIsNotifChangeSpv(?bool $isNotifChangeSpv): self
{
$this->isNotifChangeSpv = $isNotifChangeSpv;
return $this;
}
public function getIsNotifDateMESPrevisionnelle(): ?bool
{
return $this->isNotifDateMESPrevisionnelle;
}
public function setIsNotifDateMESPrevisionnelle(?bool $isNotifDateMESPrevisionnelle): self
{
$this->isNotifDateMESPrevisionnelle = $isNotifDateMESPrevisionnelle;
return $this;
}
public function getIsCreateUser(): ?bool
{
return $this->isCreateUser;
}
public function setIsCreateUser(?bool $isCreateUser): self
{
$this->isCreateUser = $isCreateUser;
return $this;
}
public function getFournisseurType(): ?string
{
return $this->fournisseurType;
}
public function setFournisseurType(?string $fournisseurType): self
{
$this->fournisseurType = $fournisseurType;
return $this;
}
public function getFournisseurTypeStr(){
$fournisseurType = $this->fournisseurType;
if($fournisseurType == self::fournisseur_type_EPC){
return 'EPC';
}elseif ($fournisseurType == self::fournisseur_type_Installateur){
return 'Installateur';
}elseif ($fournisseurType == self::fournisseur_type_Charpentier){
return 'Charpentier';
}elseif ($fournisseurType == self::fournisseur_type_Notaire){
return 'Notaire';
}elseif ($fournisseurType == self::fournisseur_type_Constructeur){
return 'Constructeur';
}elseif ($fournisseurType == self::fournisseur_type_Mainteneur){
return 'Mainteneur';
}elseif ($fournisseurType == self::fournisseur_type_Conducteur){
return 'Conducteur';
}elseif ($fournisseurType == self::fournisseur_type_AMO){
return 'AMO';
}else{
return null;
}
}
public function getTypeAccesStr(){
$typeAcces = $this->typeAcces;
if($typeAcces == self::ACCES_admin_prejeance){
return 'Admin Prejeance';
}elseif ($typeAcces == self::ACCES_interne_prejeance){
return 'Interne Prejeance';
}elseif ($typeAcces == self::ACCES_intervenant){
return 'Intervenant';
}elseif ($typeAcces == self::ACCES_visiteur){
return 'Visiteur';
}elseif ($typeAcces == self::ACCES_comptable){
return 'Comptable';
}else{
return '';
}
}
public function getTags(): ?string
{
return $this->tags;
}
public function setTags(?string $tags): self
{
$this->tags = $tags;
return $this;
}
public function getIsNotifProjectArchive(): ?bool
{
return $this->isNotifProjectArchive;
}
public function setIsNotifProjectArchive(?bool $isNotifProjectArchive): self
{
$this->isNotifProjectArchive = $isNotifProjectArchive;
return $this;
}
public function getDashboardPreferences(): ?array
{
if($this->dashboardPreferences and $this->dashboardPreferences != []){
return $this->dashboardPreferences ;
}else{
return [
'projets' => [
'nouveau' => false,
'suivi' => true
],
'finances' => [
'factures' => true,
'avoir' => false,
'bon_commande' => false,
],
'utilisateurs' => ['comptes' => false],
'exploitations' => [
'centrales' => false,
'rapports' => false,
],
'informations' => ['notifications' => true],
];
}
}
public function setDashboardPreferences(?array $dashboardPreferences): self
{
$this->dashboardPreferences = $dashboardPreferences ?? [];
return $this;
}
public function getColvisOdrer(): ?array
{
return $this->colvisOdrer ?? [];
}
public function setColvisOdrer(?array $colvisOdrer): self
{
$this->colvisOdrer = $colvisOdrer;
return $this;
}
public function getDashboardOdrer(): ?array
{
return $this->dashboardOdrer ?? [];
}
public function setDashboardOdrer(?array $dashboardOdrer): self
{
$this->dashboardOdrer = $dashboardOdrer;
return $this;
}
public function getIsNotifLoyerPaye(): ?bool
{
return $this->isNotifLoyerPaye;
}
public function setIsNotifLoyerPaye(?bool $isNotifLoyerPaye): self
{
$this->isNotifLoyerPaye = $isNotifLoyerPaye;
return $this;
}
public function getObjectId(): ?string
{
return $this->objectId;
}
public function setObjectId(?string $objectId): self
{
$this->objectId = $objectId;
return $this;
}
public function getIsLoginSso(): ?bool
{
return $this->isLoginSso;
}
public function setIsLoginSso(?bool $isLoginSso): self
{
$this->isLoginSso = $isLoginSso;
return $this;
}
}