src/Entity/User.php line 28

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\NotificationType;
  4. use App\Repository\UserRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Component\HttpFoundation\File\File;
  10. use Symfony\Component\Serializer\Annotation\Groups;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  13. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  14. use Symfony\Component\Security\Core\User\UserInterface;
  15. use Symfony\Component\Uid\Uuid;
  16. use Misd\PhoneNumberBundle\Validator\Constraints\PhoneNumber as AssertPhoneNumber;
  17. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  18. use SymfonyCasts\Bundle\ResetPassword\Model\ResetPasswordToken;
  19. #[ORM\Entity(repositoryClassUserRepository::class)]
  20. #[ORM\Table(name'users')]
  21. #[UniqueEntity(fields: ['email'], message'Cette adresse email est déjà utilisée par un autre compte')]
  22. /**
  23.  * @Vich\Uploadable()
  24.  */
  25. class User implements UserInterfacePasswordAuthenticatedUserInterface
  26. {
  27.    
  28.     #[ORM\Id]
  29.     #[ORM\Column(type'string'length22uniquetrue)]
  30.     #[Groups(['campaign''user_read','mission_list''mission_read''mission_participant_write''message_write','message_read','user_directory'])]
  31.     private string $id;
  32.     #[ORM\Column(type'string'length180nullabletrue)]
  33.     // #[Assert\NotBlank(message: 'Ce champs est requis')]
  34.     #[Groups(['user_read''mission_read','mission_list''mission_participant_write','message_read''message_write','user_directory'])]
  35.     private ?string $firstname null;
  36.     #[ORM\Column(type'boolean'nullabletrue)]
  37.     private ?bool $newAdd false;
  38.     #[ORM\Column(type'boolean'nullabletrue)]
  39.     private ?bool $allCompany false;
  40.      #[ORM\Column(type'boolean'nullabletrue)]
  41.      #[Groups(['mission_list','mission_read','message_read','user_read'])]
  42.     private ?bool $salary false;
  43.      #[ORM\Column(type'boolean'nullabletrue)]
  44.     private ?bool $manager false;
  45.       #[ORM\Column(type'boolean'nullabletrue)]
  46.     private ?bool $partner false;
  47.     #[ORM\Column(type'boolean'nullabletrue)]
  48.     #[Groups(['mission_list','mission_read','message_read','user_read'])]
  49.     private ?bool $shareMyEmail false;
  50.      #[ORM\Column(type'boolean'nullabletrue)]
  51.      #[Groups(['mission_list','mission_read','message_read','user_read'])]
  52.     private ?bool $shareMyPhone false;
  53.     #[ORM\Column(type'string'length180nullabletrue)]
  54.     // #[Assert\NotBlank(message: 'Ce champs est requis')]
  55.     #[Groups(['user_read''mission_read','mission_list','message_read''mission_participant_write''message_write','user_directory'])]
  56.     private ?string $lastname null;
  57.     #[ORM\Column(type'string'nullabletrue)]
  58.     #[Groups(['user_read''mission_read','mission_list','message_read''mission_participant_write'])]
  59.     private ?string $cellPhone null;
  60.     #[ORM\Column(type'boolean'nullabletrue)]
  61.     #[Groups(['mission_list','user_read''mission_read','message_read''mission_participant_write'])]
  62.     private ?bool $enabled false;
  63.      #[ORM\Column(type'boolean'nullabletrue)]
  64.     private ?bool $external false;
  65.     #[ORM\Column(type'decimal'precision10scale2nullabletrue)]
  66.     #[Groups(['mission_list','user_read','message_read','mission_read'])]
  67.     private ?float $dailyRate null;
  68.     #[ORM\Column(type'decimal'precision10scale2nullabletrue)]
  69.     #[Groups(['mission_list','user_read','message_read','mission_read'])]
  70.     private ?float $resaleRate null;
  71.     #[ORM\Column(type'smallint'nullabletrue)]
  72.     private ?int $billingMethod 0;
  73.     /**
  74.      * @Vich\UploadableField(mapping="sub_contractor_image", fileNameProperty="pictureName")
  75.      */
  76.     #[Assert\File(mimeTypes: ['image/png''image/jpeg''image/jpg','image/webp'], mimeTypesMessage'Les formats supportés sont : PNG, JPEG, JPG')]
  77.     private ?File $picture null;
  78.     #[ORM\Column(type'string'nullabletrue)]
  79.     #[Groups(['mission_list','user_read''mission_read','message_read','user_directory'])]
  80.     private ?string $pictureName null;
  81.     #[ORM\Column(type'datetime'nullabletrue)]
  82.     #[Groups(['mission_list','user_read','message_read'])]
  83.     private ?\DateTimeInterface $updatedAt null;
  84.     #[ORM\Column(type'string'length180uniquetrue)]
  85.     #[Assert\NotBlank(message'Ce champ est requis')]
  86.     // #[Assert\Email(message: 'Cette adresse n\'est pas valide')]
  87.     #[Groups(['mission_list','user_read''mission_read','message_read''mission_participant_write'])]
  88.     private string $email '';
  89.     #[ORM\Column(type'string'length180nullabletrue)]
  90.     private $OriginalEmail ;
  91.     #[ORM\Column(type'json')]
  92.     #[Groups(['user_read'])]
  93.     private array $roles = [];
  94.     #[ORM\Column(type'string')]
  95.     private string $password '';
  96.     #[Assert\Length(min8minMessage'Le mot de passe doit faire 8 charactères minimum')]
  97.     #[Assert\NotCompromisedPassword(message'Votre mot de passe est trop faible, merci d\'en choisir un plus fort'threshold50000)]
  98.     private ?string $plainPassword null;
  99.     #[ORM\Column(type'datetime'nullabletrue)]
  100.     private ?\DateTimeInterface $createdAt;
  101.     #[ORM\Column(type'datetime'nullabletrue)]
  102.     private ?\DateTimeInterface $lastConnectionAt null;
  103.     #[ORM\Column(type'string'nullabletrue)]
  104.     private ?string $accountType;
  105.     #[ORM\ManyToOne(targetEntityCompany::class, inversedBy'users')]
  106.     #[Groups(['user_read','message_read'])]
  107.     private ?Company $company;
  108.     #[ORM\ManyToMany(inversedBy'otherUser',targetEntityCompany::class)]
  109.     private $otherCompany;
  110.     #[ORM\OneToMany(mappedBy'user'targetEntityMessage::class)]
  111.     private $messages;
  112.    
  113.     #[ORM\OneToOne(targetEntityUserData::class, cascade: ['persist''remove'])]
  114.     private ?UserData $userData;
  115.     #[ORM\OneToMany(mappedBy'user'targetEntityFileMission::class)]
  116.     private $fileMissions;
  117.     #[ORM\ManyToMany(mappedBy'user'targetEntityWorkflowAction::class)]
  118.     private $workflowAction;
  119.     #[ORM\OneToMany(mappedBy'user'targetEntityInfoMission::class)]
  120.     private $infoMissions;
  121.     #[ORM\OneToMany(mappedBy'contact'targetEntityMission::class)]
  122.     private $missions;
  123.     #[ORM\OneToMany(mappedBy'user'targetEntityHistorique::class)]
  124.     private $historiques;
  125.     #[ORM\OneToMany(mappedBy'orderedBy'targetEntityCreditHistory::class)]
  126.     private $creditHistories;
  127.     #[ORM\OneToMany(mappedBy'orderedBy'targetEntityCampaign::class)]
  128.     private $campaigns;
  129.     #[ORM\OneToMany(mappedBy'user'targetEntitySubContractorCompany::class, cascade: ["persist"])]
  130.     private $subContractorCompanies;
  131.     #[ORM\Column(type'json'nullabletrue)]
  132.     #[Groups(['user_read'])]
  133.     private ?array $notificationType = [0,1,2];
  134.     #[ORM\Column(type'json'nullabletrue)]
  135.     #[Groups(['user_read'])]
  136.     private ?array $notification = [0,1,2,3,4,5];
  137.     #[ORM\Column(type'json'nullabletrue)]
  138.     #[Groups(['user_read'])]
  139.     private $freqNotification = [1];
  140.     #[ORM\Column(type'json'nullabletrue)]
  141.     #[Groups(['user_read'])]
  142.     private $freqNotificationEverytime = [1,3,5,8];
  143.     #[ORM\Column(type'json'nullabletrue)]
  144.     #[Groups(['user_read'])]
  145.     private $freqNotificationPerDay = [0,2];
  146.     #[ORM\Column(type'json'nullabletrue)]
  147.     #[Groups(['user_read'])]
  148.     private $freqNotificationPerWeek = [6];
  149.     #[ORM\Column(type'json'nullabletrue)]
  150.     #[Groups(['user_read'])]
  151.     private $freqNotificationPerMonth = [];
  152.     #[ORM\OneToMany(mappedBy'user'targetEntityDevice::class)]
  153.     private $devices;
  154.     #[ORM\OneToMany(mappedBy'user'targetEntityService::class)]
  155.     #[Groups(['user_read'])]
  156.     private $services;
  157.     #[ORM\ManyToMany(targetEntityJob::class, mappedBy'user')]
  158.     #[Groups(['user_directory','user_read'])]
  159.     private $jobs;
  160.     #[ORM\Column(type'boolean'options: ['default' => false])]
  161.     private ?bool $isActiveNotification false;
  162.     #[ORM\Column(type'boolean')]
  163.     #[Groups(['mission_list','user_read''mission_read''mission_participant_write'])]
  164.     private ?bool $deleted false;
  165.     #[ORM\Column(type'boolean')]
  166.     private ?bool $referencingConfirmationNotification false;
  167.     #[ORM\Column(type'string'length255nullabletrue)]
  168.     #[Groups(['user_read'])]
  169.     private $gender;
  170.     #[ORM\OneToMany(mappedBy'orderBy'targetEntityBalanceTransactions::class)]
  171.     private $balanceTransactions;
  172.     #[ORM\Column(type'array'nullabletrue)]
  173.     private $deviceConnectedList = [];
  174.     #[ORM\Column]
  175.     private ?bool $invisible null;
  176.     #[ORM\Column(nullabletrue)]
  177.     private ?\DateTimeImmutable $lastActivityAt null;
  178.     #[ORM\Column(nullabletrue)]
  179.     private ?bool $isLogged null;
  180.     #[ORM\OneToMany(mappedBy'user'targetEntityMessageReaction::class)]
  181.     private Collection $messageReactions;
  182.     #[ORM\OneToMany(mappedBy'user'targetEntityEmoji::class)]
  183.     private Collection $emoji;
  184.     #[ORM\OneToMany(mappedBy'orderedBy'targetEntityCommandeLogging::class)]
  185.     private $commandeLoggings;
  186.     #[ORM\OneToMany(mappedBy'user'targetEntitySupport::class, orphanRemovaltrue,cascade: ["persist"])]
  187.     private $supports;
  188.     
  189.     #[ORM\OneToMany(mappedBy'user'targetEntityConfidentialityContract::class)]
  190.     private Collection $confidentialityContracts;
  191.     #[ORM\OneToMany(mappedBy'user'targetEntityCampaignPendingToSend::class)]
  192.     private $campaignPendingToSends;
  193.     private $resetToken null;
  194.     #[ORM\Column(type'boolean'nullabletrue)]
  195.     private $isNewClient;
  196.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  197.     private $autorizationDateAt;
  198.     #[ORM\Column(type'boolean'nullabletrue)]
  199.     private $acceptPresentation;
  200.     #[ORM\Column(type'text'nullabletrue)]  
  201.     #[Groups(['user_directory'])]
  202.     private $description;
  203.     #[ORM\Column(type'string'length255nullabletrue)]
  204.     #[Groups(['user_directory'])]
  205.     private $title;
  206.     #[ORM\Column(type'string'length255nullabletrue)]
  207.     private $oneTimeLoginToken;
  208.     #[ORM\Column(type'string'length255nullabletrue)]
  209.     private $state
  210.     
  211.     #[ORM\OneToMany(mappedBy'user'targetEntityPortfolio::class)]
  212.     #[Groups(['user_directory'])]
  213.     private $portfolio
  214.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'children',cascade: ["persist"])]
  215.     private $parent;
  216.     #[ORM\OneToMany(mappedBy'parent'targetEntityUser::class,cascade: ["persist"])]
  217.     private $children;
  218.     #[ORM\OneToMany(mappedBy'user'targetEntitySignedContract::class)]
  219.     private $signedContracts;
  220.     #[ORM\OneToMany(mappedBy'representative'targetEntityCompany::class)]
  221.     private $companiesRepresentative;
  222.     private $originalEmail "";
  223.     #[ORM\OneToMany(mappedBy'createdBy'targetEntityProduct::class)]
  224.     private $products;
  225.     #[ORM\ManyToMany(targetEntityWorkflowStep::class, mappedBy'userResponsable')]
  226.     private $workflowSteps;
  227.     //only for API
  228.     #[Groups(['user_read'])]
  229.     private $listAccount;
  230.     #[Groups(['user_read'])]
  231.     private $originalMailUser "";
  232.     #[Groups(['user_read'])]
  233.     private $roleName ="";
  234.     #[Groups(['user_read'])]
  235.     private $lastActivityInMinute 99999;
  236.     ///////
  237.     private $fullName;
  238.     #[ORM\Column(type'string'length255nullabletrue)]
  239.     #[Groups(['message_read''mission_read''message_write'])]
  240.     private $identifier;
  241.     #[ORM\OneToMany(mappedBy'createdBy'targetEntitySharedResourcesCategory::class)]
  242.     private Collection $sharedResourcesCategories;
  243.     #[ORM\OneToMany(mappedBy'createdBy'targetEntityCompanyResource::class)]
  244.     private Collection $companyResources;
  245.     #[ORM\OneToMany(mappedBy'createdBy'targetEntityResourceDeliverableHistory::class)]
  246.     private Collection $resourceDeliverableHistories;
  247.     #[ORM\OneToMany(mappedBy'createdBy'targetEntityFilesResourceDeliverableHistory::class)]
  248.     private Collection $filesResourceDeliverableHistories;
  249.     #[ORM\ManyToMany(targetEntityFilePermissions::class, mappedBy'user')]
  250.     private Collection $filePermissions;
  251.     #[ORM\ManyToMany(targetEntityFolderPermissions::class, mappedBy'user')]
  252.     private Collection $folderPermissions;
  253.     #[ORM\OneToMany(mappedBy'createdBy'targetEntityFolderPermissions::class)]
  254.     private Collection $folderPermissionsCreatedBy;
  255.     #[ORM\OneToMany(mappedBy'createdBy'targetEntityFilePermissions::class)]
  256.     private Collection $filePermissionsCreatedBy;
  257.     
  258.     
  259.     public function __construct()
  260.     {
  261.         $this->id Uuid::v4()->toBase58();
  262.         $this->createdAt = new \DateTime('now');
  263.         $this->messages = new ArrayCollection();
  264.         $this->infoMissions = new ArrayCollection();
  265.         $this->missions = new ArrayCollection();
  266.         $this->historiques = new ArrayCollection();
  267.         $this->creditHistories = new ArrayCollection();
  268.         $this->campaigns = new ArrayCollection();
  269.         $this->subContractorCompanies = new ArrayCollection();
  270.         $this->devices = new ArrayCollection();
  271.         $this->services = new ArrayCollection();
  272.         $this->jobs = new ArrayCollection();
  273.         $this->balanceTransactions = new ArrayCollection();
  274.         $this->invisible false;
  275.         $this->company null;
  276.         $this->dailyRate 0;
  277.         $this->resaleRate 0;
  278.         $this->workflowAction = new ArrayCollection();
  279.         $this->messageReactions = new ArrayCollection();
  280.         $this->emoji = new ArrayCollection();
  281.         $this->commandeLoggings = new ArrayCollection();
  282.         $this->supports = new ArrayCollection();
  283.         $this->confidentialityContracts = new ArrayCollection();
  284.         $this->campaignPendingToSends = new ArrayCollection();
  285.         $this->fileMissions = new ArrayCollection();
  286.         $this->isNewClient false;
  287.         $this->autorizationDateAt = new \DateTimeImmutable();
  288.         $this->state 'enabled'
  289.         $this->portfolio = new ArrayCollection();
  290.         $this->otherCompany = new ArrayCollection();
  291.         $this->children = new ArrayCollection();
  292.         $this->signedContracts = new ArrayCollection();
  293.         $this->companiesRepresentative = new ArrayCollection();
  294.         $this->products = new ArrayCollection();
  295.         $this->workflowSteps = new ArrayCollection();
  296.         $this->sharedResourcesCategories = new ArrayCollection();
  297.         $this->companyResources = new ArrayCollection();
  298.         $this->resourceDeliverableHistories = new ArrayCollection();
  299.         $this->filesResourceDeliverableHistories = new ArrayCollection();
  300.         $this->filePermissions = new ArrayCollection();
  301.         $this->folderPermissions = new ArrayCollection();
  302.         $this->folderPermissionsCreatedBy = new ArrayCollection();
  303.         $this->filePermissionsCreatedBy = new ArrayCollection();
  304.     }
  305.     public function getId(): ?string
  306.     {
  307.         return $this->id;
  308.     }
  309.     public function setId($id){
  310.         $this->id $id;
  311.         return $this;
  312.     }
  313.     public function __toString(): string
  314.     {
  315.         return $this->getFirstname().' '.$this->getLastname();
  316.     }
  317.     public function getEmail(): ?string
  318.     {
  319.         if ($this->getOriginalEmail() != null) {
  320.             return $this->getOriginalEmail();
  321.         }
  322.         return $this->email;
  323.     }
  324.     public function getOriginalMailUser(): ?string
  325.     {
  326.         return $this->email;
  327.     }
  328.     //  public function getOriginalEmail(): ?string
  329.     // {
  330.     //     return $this->email;
  331.     // }
  332.     public function setEmail(string $email): self
  333.     {
  334.         $this->email $email;
  335.         return $this;
  336.     }
  337.     /**
  338.      * A visual identifier that represents this user.
  339.      *
  340.      * @see UserInterface
  341.      */
  342.     public function getUserIdentifier(): string
  343.     {
  344.         return (string) $this->email;
  345.     }
  346.     /**
  347.      * @deprecated since Symfony 5.3, use getUserIdentifier instead
  348.      */
  349.     public function getUsername(): string
  350.     {
  351.         return (string) $this->email;
  352.     }
  353.     /**
  354.      * @see UserInterface
  355.      */
  356.     public function getRoles(): array
  357.     {
  358.         $roles $this->roles;
  359.         // if (isset($_SESSION['_sf2_attributes']['role_current_user']) and null !== $_SESSION['_sf2_attributes']['role_current_user']) {
  360.         //    $roles[0]= $_SESSION['_sf2_attributes']['role_current_user'];
  361.         // }
  362.         // $roles[0]='ROLE_MANAGER';
  363.         // guarantee every user at least has ROLE_USER
  364.         $roles[] = 'ROLE_USER';
  365.         return array_unique($roles);
  366.     }
  367.     public function getOriginalRoles(): array 
  368.     {
  369.         $roles $this->roles;
  370.         // $roles[0]='ROLE_MANAGER';
  371.         // guarantee every user at least has ROLE_USER
  372.         $roles[] = 'ROLE_USER';
  373.         return array_unique($roles);
  374.     }
  375.     public function setRoles(array $roles): self
  376.     {
  377.         $this->roles $roles;
  378.         return $this;
  379.     }
  380.     /**
  381.      * @see PasswordAuthenticatedUserInterface
  382.      */
  383.     public function getPassword(): string
  384.     {
  385.         return $this->password;
  386.     }
  387.     public function setPassword(string $password): self
  388.     {
  389.         
  390.         $this->password $password;
  391.         return $this;
  392.     }
  393.     /**
  394.      * Returning a salt is only needed, if you are not using a modern
  395.      * hashing algorithm (e.g. bcrypt or sodium) in your security.yaml.
  396.      *
  397.      * @see UserInterface
  398.      */
  399.     public function getSalt(): ?string
  400.     {
  401.         return null;
  402.     }
  403.     /**
  404.      * @see UserInterface
  405.      */
  406.     public function eraseCredentials()
  407.     {
  408.         // If you store any temporary, sensitive data on the user, clear it here
  409.         // $this->plainPassword = null;
  410.     }
  411.     /**
  412.      * @return string|null
  413.      */
  414.     public function getFirstname(): ?string
  415.     {
  416.         return $this->firstname;
  417.     }
  418.     /**
  419.      * @param mixed $firstname
  420.      */
  421.     public function setFirstname(?string $firstname): self
  422.     {
  423.         $this->firstname $firstname;
  424.         return $this;
  425.     }
  426.     /**
  427.      * @return string|null
  428.      */
  429.     public function getLastname(): ?string
  430.     {
  431.         return $this->lastname;
  432.     }
  433.     /**
  434.      * @param mixed $lastname
  435.      */
  436.     public function setLastname(?string $lastname): self
  437.     {
  438.         $this->lastname $lastname;
  439.         return $this;
  440.     }
  441.     /**
  442.      * @return string|null
  443.      */
  444.     public function getCellPhone(): ?string
  445.     {
  446.         return $this->cellPhone;
  447.     }
  448.     /**
  449.      * @param mixed $cellPhone
  450.      */
  451.     public function setCellPhone(?string $cellPhone): self
  452.     {
  453.         $this->cellPhone $cellPhone;
  454.         return $this;
  455.     }
  456.     /**
  457.      * @return bool
  458.      */
  459.     public function isEnabled(): bool
  460.     {
  461.         return $this->enabled;
  462.     }
  463.     /**
  464.      * @param int $enabled
  465.      */
  466.     public function setEnabled(bool $enabled): self
  467.     {
  468.         if (is_null($this->getParent()) and $enabled) {
  469.             foreach ($this->getChildren() as $userChild) {
  470.                 $userChild->setEnabled($enabled);
  471.             }
  472.         }
  473.         $this->enabled $enabled;
  474.         return $this;
  475.     }
  476.     /**
  477.      * @return bool|null
  478.      */
  479.     public function isExternal(): ?bool
  480.     {
  481.         return $this->external;
  482.     }
  483.     /**
  484.      * @param int $external
  485.      */
  486.     public function setExternal(bool $external): self
  487.     {
  488.         $this->external $external;
  489.         return $this;
  490.     }
  491.     /**
  492.      * @return mixed
  493.      */
  494.     public function getDailyRate(): ?string
  495.     {
  496.         return $this->dailyRate;
  497.     }
  498.     /**
  499.      * @param mixed $dailyRate
  500.      */
  501.     public function setDailyRate(?string $dailyRate): void
  502.     {
  503.         $this->dailyRate $dailyRate;
  504.     }
  505.     /**
  506.      * @return mixed
  507.      */
  508.     public function getBillingMethod(): ?string
  509.     {
  510.         return $this->billingMethod;
  511.     }
  512.     /**
  513.      * @param mixed $billingMethod
  514.      */
  515.     public function setBillingMethod(?string $billingMethod): void
  516.     {
  517.         $this->billingMethod $billingMethod;
  518.     }
  519.     public function serialize()
  520.     {
  521.         $this->picture base64_encode($this->picture);
  522.     }
  523.     public function unserialize($serialized)
  524.     {
  525.         $this->picture base64_decode($this->picture);
  526.     }
  527.     /**
  528.      * @return File|null
  529.      */
  530.     public function getPicture(): ?File
  531.     {
  532.         return $this->picture;
  533.     }
  534.     public function setPicture(?File $picture null): void
  535.     {
  536.         $this->picture $picture;
  537.         if (null !== $picture) {
  538.             // It is required that at least one field changes if you are using doctrine
  539.             // otherwise the event listeners won't be called and the file is lost
  540.             $this->updatedAt = new \DateTimeImmutable();
  541.         }
  542.     }
  543.     public function getUpdatedAt(): ?\DateTimeInterface
  544.     {
  545.         return $this->updatedAt;
  546.     }
  547.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  548.     {
  549.         $this->updatedAt $updatedAt;
  550.         return $this;
  551.     }
  552.     /**
  553.      * @return string|null
  554.      */
  555.     public function getPictureName(): ?string
  556.     {
  557.         return $this->pictureName;
  558.     }
  559.     /**
  560.      * @param string|null $pictureName
  561.      */
  562.     public function setPictureName(?string $pictureName): void
  563.     {
  564.         $this->pictureName $pictureName;
  565.     }
  566.     /**
  567.      * @return \DateTimeInterface|null
  568.      */
  569.     public function getCreatedAt(): ?\DateTimeInterface
  570.     {
  571.         return $this->createdAt;
  572.     }
  573.     /**
  574.      * @param \DateTimeInterface|null $createdAt
  575.      */
  576.     public function setCreatedAt(?\DateTimeInterface $createdAt): void
  577.     {
  578.         $this->createdAt $createdAt;
  579.     }
  580.     /**
  581.      * @return \DateTimeInterface|null
  582.      */
  583.     public function getLastConnectionAt(): ?\DateTimeInterface
  584.     {
  585.         return $this->lastConnectionAt;
  586.     }
  587.     /**
  588.      * @param \DateTimeInterface|null $lastConnectionAt
  589.      * @return User
  590.      */
  591.     public function setLastConnectionAt(?\DateTimeInterface $lastConnectionAt): User
  592.     {
  593.         $this->lastConnectionAt $lastConnectionAt;
  594.         return $this;
  595.     }
  596.     public function getPlainPassword(): ?string
  597.     {
  598.         return $this->plainPassword;
  599.     }
  600.     public function setPlainPassword(?string $password): self
  601.     {
  602.         $this->plainPassword $password;
  603.         return $this;
  604.     }
  605.     /**
  606.      * @return string|null
  607.      */
  608.     public function getAccountType(): ?string
  609.     {
  610.         return $this->accountType;
  611.     }
  612.     /**
  613.      * @param string|null $accountType
  614.      * @return User
  615.      */
  616.     public function setAccountType(?string $accountType): User
  617.     {
  618.         $this->accountType $accountType;
  619.         return $this;
  620.     }
  621.     public function getCompany(): ?Company
  622.     {
  623.         return $this->company;
  624.     }
  625.     public function setCompany(?Company $company): self
  626.     {
  627.         $this->company $company;
  628.         return $this;
  629.     }
  630.     /**
  631.      * @return Collection|Message[]
  632.      */
  633.     public function getMessages(): Collection
  634.     {
  635.         return $this->messages;
  636.     }
  637.     public function addMessage(Message $message): self
  638.     {
  639.         if (!$this->messages->contains($message)) {
  640.             $this->messages[] = $message;
  641.             $message->setUser($this);
  642.         }
  643.         return $this;
  644.     }
  645.     public function removeMessage(Message $message): self
  646.     {
  647.         if ($this->messages->removeElement($message)) {
  648.             // set the owning side to null (unless already changed)
  649.             if ($message->getUser() === $this) {
  650.                 $message->setUser(null);
  651.             }
  652.         }
  653.         return $this;
  654.     }
  655.     /**
  656.      * @return Collection|InfoMission[]
  657.      */
  658.     public function getInfoMissions(): Collection
  659.     {
  660.         return $this->infoMissions;
  661.     }
  662.     public function addInfoMission(InfoMission $infoMission): self
  663.     {
  664.         if (!$this->infoMissions->contains($infoMission)) {
  665.             $this->infoMissions[] = $infoMission;
  666.             $infoMission->setUser($this);
  667.         }
  668.         return $this;
  669.     }
  670.     public function removeInfoMission(InfoMission $infoMission): self
  671.     {
  672.         if ($this->infoMissions->removeElement($infoMission)) {
  673.             // set the owning side to null (unless already changed)
  674.             if ($infoMission->getUser() === $this) {
  675.                 $infoMission->setUser(null);
  676.             }
  677.         }
  678.         return $this;
  679.     }
  680.     /**
  681.      * @return Collection|Mission[]
  682.      */
  683.     public function getMissions(): Collection
  684.     {
  685.         return $this->missions;
  686.     }
  687.     public function addMission(Mission $mission): self
  688.     {
  689.         if (!$this->missions->contains($mission)) {
  690.             $this->missions[] = $mission;
  691.             $mission->setContact($this);
  692.         }
  693.         return $this;
  694.     }
  695.     public function removeMission(Mission $mission): self
  696.     {
  697.         if ($this->missions->removeElement($mission)) {
  698.             // set the owning side to null (unless already changed)
  699.             if ($mission->getContact() === $this) {
  700.                 $mission->setContact(null);
  701.             }
  702.         }
  703.         return $this;
  704.     }
  705.     /**
  706.      * @return Collection|Historique[]
  707.      */
  708.     public function getHistoriques(): Collection
  709.     {
  710.         return $this->historiques;
  711.     }
  712.     public function addHistorique(Historique $historique): self
  713.     {
  714.         if (!$this->historiques->contains($historique)) {
  715.             $this->historiques[] = $historique;
  716.             $historique->setUser($this);
  717.         }
  718.         return $this;
  719.     }
  720.     public function removeHistorique(Historique $historique): self
  721.     {
  722.         if ($this->historiques->removeElement($historique)) {
  723.             // set the owning side to null (unless already changed)
  724.             if ($historique->getUser() === $this) {
  725.                 $historique->setUser(null);
  726.             }
  727.         }
  728.         return $this;
  729.     }
  730.     /**
  731.      * @return Collection|SubContractorCompany[]
  732.      */
  733.     public function getSubContractorCompanies(): Collection
  734.     {
  735.         return $this->subContractorCompanies;
  736.     }
  737.     public function addSubContractorCompany(SubContractorCompany $subContractorCompany): self
  738.     {
  739.         if (!$this->subContractorCompanies->contains($subContractorCompany)) {
  740.             $this->subContractorCompanies[] = $subContractorCompany;
  741.             $subContractorCompany->setUser($this);
  742.         }
  743.         return $this;
  744.     }
  745.     public function removeSubContractorCompany(SubContractorCompany $subContractorCompany): self
  746.     {
  747.         if ($this->subContractorCompanies->removeElement($subContractorCompany)) {
  748.             // set the owning side to null (unless already changed)
  749.             if ($subContractorCompany->getUser() === $this) {
  750.                 $subContractorCompany->setUser(null);
  751.             }
  752.         }
  753.         return $this;
  754.     }
  755.     /**
  756.      * @return Collection|Device[]
  757.      */
  758.     public function getDevices(): Collection
  759.     {
  760.         return $this->devices;
  761.     }
  762.     public function addDevice(Device $device): self
  763.     {
  764.         if (!$this->devices->contains($device)) {
  765.             $this->devices[] = $device;
  766.             $device->setUser($this);
  767.         }
  768.         return $this;
  769.     }
  770.     public function removeDevice(Device $device): self
  771.     {
  772.         if ($this->devices->removeElement($device)) {
  773.             // set the owning side to null (unless already changed)
  774.             if ($device->getUser() === $this) {
  775.                 $device->setUser(null);
  776.             }
  777.         }
  778.         return $this;
  779.     }
  780.     /**
  781.      * @return Collection|Service[]
  782.      */
  783.     public function getServices(): Collection
  784.     {
  785.         return $this->services;
  786.     }
  787.     public function addService(Service $service): self
  788.     {
  789.         if (!$this->services->contains($service)) {
  790.             $this->services[] = $service;
  791.             $service->setUser($this);
  792.         }
  793.         return $this;
  794.     }
  795.     public function removeService(Service $service): self
  796.     {
  797.         if ($this->services->removeElement($service)) {
  798.             // set the owning side to null (unless already changed)
  799.             if ($service->getUser() === $this) {
  800.                 $service->setUser(null);
  801.             }
  802.         }
  803.         return $this;
  804.     }
  805.     /**
  806.      * @return array|null
  807.      */
  808.     public function getNotificationType(): ?array
  809.     {
  810.         return $this->notificationType;
  811.     }
  812.     /**
  813.      * @param array|null $notificationType
  814.      */
  815.     public function setNotificationType(?array $notificationType): void
  816.     {
  817.         $this->notificationType $notificationType;
  818.     }
  819.     /**
  820.      * @return array|null
  821.      */
  822.     public function getNotification(): ?array
  823.     {
  824.         return $this->notification;
  825.     }
  826.     /**
  827.      * @param array|null $notification
  828.      */
  829.     public function setNotification(?array $notification): void
  830.     {
  831.         $this->notification $notification;
  832.     }
  833.     /**
  834.      * @return Collection|Job[]
  835.      */
  836.     public function getJobs(): Collection
  837.     {
  838.         return $this->jobs;
  839.     }
  840.     public function addJob(Job $job): self
  841.     {
  842.         if (!$this->jobs->contains($job)) {
  843.             $this->jobs[] = $job;
  844.             $job->addUser($this);
  845.         }
  846.         return $this;
  847.     }
  848.     public function removeJob(Job $job): self
  849.     {
  850.         if ($this->jobs->removeElement($job)) {
  851.             $job->removeUser($this);
  852.         }
  853.         return $this;
  854.     }
  855.     public function getIsActiveNotification(): ?bool
  856.     {
  857.         return $this->isActiveNotification;
  858.     }
  859.     public function setIsActiveNotification(bool $isActiveNotification): self
  860.     {
  861.         $this->isActiveNotification $isActiveNotification;
  862.         return $this;
  863.     }
  864.     public function getDeleted(): ?bool
  865.     {
  866.         return $this->deleted;
  867.     }
  868.     public function setDeleted(bool $deleted): self
  869.     {
  870.         $this->deleted $deleted;
  871.         return $this;
  872.     }
  873.     
  874.     /**
  875.      * @return array|null
  876.      */
  877.     public function getFreqNotification(): ?array
  878.     {
  879.         return $this->freqNotification;
  880.     }
  881.     /**
  882.      * @param int|null $freqNotification
  883.      */
  884.     public function setFreqNotification(?array $freqNotification): void
  885.     {
  886.         $this->freqNotification $freqNotification;
  887.     }
  888.     /**
  889.      * @return array|null
  890.      */
  891.     public function getFreqNotificationEverytime(): ?array
  892.     {
  893.         return $this->freqNotificationEverytime;
  894.     }
  895.     /**
  896.      * @param int|null $freqNotification
  897.      */
  898.     public function setFreqNotificationEverytime(?array $freqNotificationEverytime): void
  899.     {
  900.         $this->freqNotificationEverytime $freqNotificationEverytime;
  901.     }
  902.      /**
  903.      * @return array|null
  904.      */
  905.     public function getFreqNotificationPerDay(): ?array
  906.     {
  907.         return $this->freqNotificationPerDay;
  908.     }
  909.     /**
  910.      * @param int|null $freqNotification
  911.      */
  912.     public function setFreqNotificationPerDay(?array $freqNotificationPerDay): void
  913.     {
  914.         $this->freqNotificationPerDay $freqNotificationPerDay;
  915.     }
  916.     /**
  917.      * @return array|null
  918.      */
  919.     public function getFreqNotificationPerWeek(): ?array
  920.     {
  921.         return $this->freqNotificationPerWeek;
  922.     }
  923.     /**
  924.      * @param int|null $freqNotification
  925.      */
  926.     public function setFreqNotificationPerWeek(?array $freqNotificationPerWeek): void
  927.     {
  928.         $this->freqNotificationPerWeek $freqNotificationPerWeek;
  929.     }
  930.     /**
  931.      * @return array|null
  932.      */
  933.     public function getFreqNotificationPerMonth(): ?array
  934.     {
  935.         return $this->freqNotificationPerMonth;
  936.     }
  937.     /**
  938.      * @param int|null $freqNotification
  939.      */
  940.     public function setFreqNotificationPerMonth(?array $freqNotificationPerMonth): void
  941.     {
  942.         $this->freqNotificationPerMonth $freqNotificationPerMonth;
  943.     }
  944.     /**
  945.      * @return float|null
  946.      */
  947.     public function getResaleRate(): ?float
  948.     {
  949.         return $this->resaleRate;
  950.     }
  951.     /**
  952.      * @param float|null $resaleRate
  953.      */
  954.     public function setResaleRate(?float $resaleRate): void
  955.     {
  956.         //mettre 30% si le prix de vente est 0 ou null 
  957.         if (($this->getResaleRate() == null or $this->getResaleRate() == 0)) {
  958.             if ($this->getDailyRate() != null and $this->getDailyRate() > 0) {
  959.                 $this->resaleRate $this->getDailyRate() + ($this->getDailyRate() * 0.3);
  960.             }else{
  961.                 $this->resaleRate $resaleRate;
  962.             }
  963.         }else{
  964.             $this->resaleRate $resaleRate;
  965.         }
  966.     }
  967.     public function getReferencingConfirmationNotification(): ?bool
  968.     {
  969.         return $this->referencingConfirmationNotification;
  970.     }
  971.     public function setReferencingConfirmationNotification(bool $referencingConfirmationNotification): self
  972.     {
  973.         $this->referencingConfirmationNotification $referencingConfirmationNotification;
  974.         return $this;
  975.     }
  976.     public function getGender(): ?string
  977.     {
  978.         return $this->gender;
  979.     }
  980.     public function setGender(?string $gender): self
  981.     {
  982.         $this->gender $gender;
  983.         return $this;
  984.     }
  985.     public function getFullName():?string
  986.     {
  987.         return $this->getFirstname()."  "$this->getLastname();
  988.     }
  989.     /**
  990.      * @return Collection|BalanceTransactions[]
  991.      */
  992.     public function getBalanceTransactions(): Collection
  993.     {
  994.         return $this->balanceTransactions;
  995.     }
  996.     public function addBalanceTransaction(BalanceTransactions $balanceTransaction): self
  997.     {
  998.         if (!$this->balanceTransactions->contains($balanceTransaction)) {
  999.             $this->balanceTransactions[] = $balanceTransaction;
  1000.             $balanceTransaction->setOrderBy($this);
  1001.         }
  1002.         return $this;
  1003.     }
  1004.     public function removeBalanceTransaction(BalanceTransactions $balanceTransaction): self
  1005.     {
  1006.         if ($this->balanceTransactions->removeElement($balanceTransaction)) {
  1007.             // set the owning side to null (unless already changed)
  1008.             if ($balanceTransaction->getOrderBy() === $this) {
  1009.                 $balanceTransaction->setOrderBy(null);
  1010.             }
  1011.         }
  1012.         return $this;
  1013.     }
  1014.     public function getDeviceConnectedList(): ?array
  1015.     {
  1016.         return $this->deviceConnectedList;
  1017.     }
  1018.     public function setDeviceConnectedList(?array $deviceConnectedList): self
  1019.     {
  1020.         $this->deviceConnectedList $deviceConnectedList;
  1021.         return $this;
  1022.     }
  1023.     public function isInvisible(): ?bool
  1024.     {
  1025.         return $this->invisible;
  1026.     }
  1027.     public function setInvisible(bool $invisible): static
  1028.     {
  1029.         $this->invisible $invisible;
  1030.         return $this;
  1031.     }
  1032.     public function getLastActivityAt(): ?\DateTimeImmutable
  1033.     {
  1034.         return $this->lastActivityAt;
  1035.     }
  1036.     public function setLastActivityAt(?\DateTimeImmutable $lastActivityAt): static
  1037.     {
  1038.         $this->lastActivityAt $lastActivityAt;
  1039.         return $this;
  1040.     }
  1041.     public function getLastActivityInMinute(){
  1042.         if($this->getLastActivityAt() != null){
  1043.             $now = new \DateTimeImmutable();
  1044.             $userLastActivity $this->getLastActivityAt();
  1045.             $interval$now->diff($userLastActivity);
  1046.             return $interval->days 24 60 $interval->60 $interval->i
  1047.         }
  1048.         return 9999;
  1049.     }
  1050.     public function isLogged(): ?bool
  1051.     {
  1052.         return $this->isLogged;
  1053.     }
  1054.     public function setIsLogged(?bool $isLogged): static
  1055.     {
  1056.         $this->isLogged $isLogged;
  1057.         return $this;
  1058.     }
  1059.     public function getEnabled(): ?bool
  1060.     {
  1061.         return $this->enabled;
  1062.     }
  1063.     public function getExternal(): ?bool
  1064.     {
  1065.         return $this->external;
  1066.     }
  1067.     public function getInvisible(): ?bool
  1068.     {
  1069.         return $this->invisible;
  1070.     }
  1071.     public function getIsLogged(): ?bool
  1072.     {
  1073.         return $this->isLogged;
  1074.     }
  1075.     
  1076.     /**
  1077.      * @return Collection<int, MessageReaction>
  1078.      */
  1079.     public function getMessageReactions(): Collection
  1080.     {
  1081.         return $this->messageReactions;
  1082.     }
  1083.     public function addMessageReaction(MessageReaction $messageReaction): static
  1084.     {
  1085.         if (!$this->messageReactions->contains($messageReaction)) {
  1086.             $this->messageReactions->add($messageReaction);
  1087.             $messageReaction->setUser($this);
  1088.         }
  1089.         return $this;
  1090.     }
  1091.     public function removeMessageReaction(MessageReaction $messageReaction): static
  1092.     {
  1093.         if ($this->messageReactions->removeElement($messageReaction)) {
  1094.             // set the owning side to null (unless already changed)
  1095.             if ($messageReaction->getUser() === $this) {
  1096.                 $messageReaction->setUser(null);
  1097.             }
  1098.         }
  1099.         return $this;
  1100.     }
  1101.     /**
  1102.      * @return Collection<int, Emoji>
  1103.      */
  1104.     public function getEmoji(): Collection
  1105.     {
  1106.         return $this->emoji;
  1107.     }
  1108.     public function addEmoji(Emoji $emoji): static
  1109.     {
  1110.         if (!$this->emoji->contains($emoji)) {
  1111.             $this->emoji->add($emoji);
  1112.             $emoji->setUser($this);
  1113.         }
  1114.         return $this;
  1115.     }
  1116.     public function removeEmoji(Emoji $emoji): static
  1117.     {
  1118.         if ($this->emoji->removeElement($emoji)) {
  1119.             // set the owning side to null (unless already changed)
  1120.             if ($emoji->getUser() === $this) {
  1121.                 $emoji->setUser(null);
  1122.             }
  1123.         }
  1124.         return $this;
  1125.     }
  1126.     /**
  1127.      * @return Collection|WorkflowAction[]
  1128.      */
  1129.     public function getWorkflowAction(): Collection
  1130.     {
  1131.         return $this->workflowAction;
  1132.     }
  1133.     public function addWorkflowAction(WorkflowAction $workflowAction): self
  1134.     {
  1135.         if (!$this->workflowAction->contains($workflowAction)) {
  1136.             $this->workflowAction[] = $workflowAction;
  1137.             $workflowAction->setUser($this);
  1138.         }
  1139.         return $this;
  1140.     }
  1141.     public function removeWorkflowAction(WorkflowAction $workflowAction): self
  1142.     {
  1143.         if ($this->workflowAction->removeElement($workflowAction)) {
  1144.             // set the owning side to null (unless already changed)
  1145.             if ($workflowAction->getUser() === $this) {
  1146.                 $workflowAction->setUser(null);
  1147.             }
  1148.         }
  1149.         return $this;
  1150.     }
  1151.     public function getDefaultEmoji(){
  1152.         return [
  1153.             [
  1154.                 "emoji" => "👍️",
  1155.                 "emojiId"=>350,
  1156.                 "detail" => "thumbs up"
  1157.             ],
  1158.             [
  1159.                 "emoji" => "❤️",
  1160.                 "emojiId"=>153,
  1161.                 "detail" => "red heart"
  1162.             ],
  1163.             [
  1164.                 "emoji" => "😆",
  1165.                 "emojiId"=>5,
  1166.                 "detail" => "grinning squinting face"
  1167.             ],
  1168.             [
  1169.                 "emoji" => "😮",
  1170.                 "emojiId"=>86,
  1171.                 "detail" => "face with open mouth"
  1172.             ],
  1173.             [
  1174.                 "emoji" => "😢",
  1175.                 "emojiId"=>97,
  1176.                 "detail" => "crying face"
  1177.             ],
  1178.             [
  1179.                 "emoji" => "😡",
  1180.                 "emojiId"=>108,
  1181.                 "detail" => "enraged face"
  1182.             ],
  1183.         ];
  1184.     }
  1185.     /**
  1186.      * @return Collection|CommandeLogging[]
  1187.      */
  1188.     public function getCommandeLoggings(): Collection
  1189.     {
  1190.         return $this->commandeLoggings;
  1191.     }
  1192.     public function addCommandeLogging(CommandeLogging $commandeLogging): self
  1193.     {
  1194.         if (!$this->commandeLoggings->contains($commandeLogging)) {
  1195.             $this->commandeLoggings[] = $commandeLogging;
  1196.             $commandeLogging->setUser($this);
  1197.         }
  1198.         return $this;
  1199.     }
  1200.     public function removeCommandeLogging(CommandeLogging $commandeLogging): self
  1201.     {
  1202.         if ($this->commandeLoggings->removeElement($commandeLogging)) {
  1203.             // set the owning side to null (unless already changed)
  1204.             if ($commandeLogging->getUser() === $this) {
  1205.                 $commandeLogging->setUser(null);
  1206.             }
  1207.         }
  1208.         return $this;
  1209.     }
  1210.     public function getNewAdd(): ?bool
  1211.     {
  1212.         return $this->newAdd;
  1213.     }
  1214.     public function setNewAdd(?bool $newAdd): self
  1215.     {
  1216.         $this->newAdd $newAdd;
  1217.         return $this;
  1218.     }
  1219.     /**
  1220.      * @return Collection|CreditHistory[]
  1221.      */
  1222.     public function getCreditHistories(): Collection
  1223.     {
  1224.         return $this->creditHistories;
  1225.     }
  1226.     public function addCreditHistory(CreditHistory $creditHistory): self
  1227.     {
  1228.         if (!$this->creditHistories->contains($creditHistory)) {
  1229.             $this->creditHistories[] = $creditHistory;
  1230.             $creditHistory->setOrderedBy($this);
  1231.         }
  1232.         return $this;
  1233.     }
  1234.     public function removeCreditHistory(CreditHistory $creditHistory): self
  1235.     {
  1236.         if ($this->creditHistories->removeElement($creditHistory)) {
  1237.             // set the owning side to null (unless already changed)
  1238.             if ($creditHistory->getOrderedBy() === $this) {
  1239.                 $creditHistory->setOrderedBy(null);
  1240.             }
  1241.         }
  1242.         return $this;
  1243.     }
  1244.     /**
  1245.      * @return Collection|Campaign[]
  1246.      */
  1247.     public function getCampaigns(): Collection
  1248.     {
  1249.         return $this->campaigns;
  1250.     }
  1251.     public function addCampaign(Campaign $campaign): self
  1252.     {
  1253.         if (!$this->campaigns->contains($campaign)) {
  1254.             $this->campaigns[] = $campaign;
  1255.             $campaign->setOrderedBy($this);
  1256.         }
  1257.         return $this;
  1258.     }
  1259.     public function removeCampaign(Campaign $campaign): self
  1260.     {
  1261.         if ($this->campaigns->removeElement($campaign)) {
  1262.             // set the owning side to null (unless already changed)
  1263.             if ($campaign->getOrderedBy() === $this) {
  1264.                 $campaign->setOrderedBy(null);
  1265.             }
  1266.         }
  1267.         return $this;
  1268.     }
  1269.     public function getShareMyEmail(): ?bool
  1270.     {
  1271.         return $this->shareMyEmail;
  1272.     }
  1273.     public function setShareMyEmail(?bool $shareMyEmail): self
  1274.     {
  1275.         $this->shareMyEmail $shareMyEmail;
  1276.         return $this;
  1277.     }
  1278.     public function getShareMyPhone(): ?bool
  1279.     {
  1280.         return $this->shareMyPhone;
  1281.     }
  1282.     public function setShareMyPhone(?bool $shareMyPhone): self
  1283.     {
  1284.         $this->shareMyPhone $shareMyPhone;
  1285.         return $this;
  1286.     }
  1287.     /**
  1288.      * @return Collection|Support[]
  1289.      */
  1290.     public function getSupports(): Collection
  1291.     {
  1292.         return $this->supports;
  1293.     }
  1294.     public function addSupport(Support $support): self
  1295.     {
  1296.         if (!$this->supports->contains($support)) {
  1297.             $this->supports[] = $support;
  1298.             $support->setUser($this);
  1299.         }
  1300.         return $this;
  1301.     }
  1302.     public function removeSupport(Support $support): self
  1303.     {
  1304.         if ($this->supports->removeElement($support)) {
  1305.             // set the owning side to null (unless already changed)
  1306.             if ($support->getUser() === $this) {
  1307.                 $support->setUser(null);
  1308.             }
  1309.         }
  1310.     }
  1311.     public function getResetToken(): ?ResetPasswordToken
  1312.     {
  1313.         return $this->resetToken;
  1314.     }
  1315.     public function setResetToken(?ResetPasswordToken  $resetToken): self
  1316.     {
  1317.         $this->resetToken $resetToken;
  1318.         return $this;
  1319.     }
  1320.     /**
  1321.      * @return Collection<int, ConfidentialityContract>
  1322.      */
  1323.     public function getConfidentialityContracts(): Collection
  1324.     {
  1325.         return $this->confidentialityContracts;
  1326.     }
  1327.     public function addConfidentialityContract(ConfidentialityContract $confidentialityContract): static
  1328.     {
  1329.         if (!$this->confidentialityContracts->contains($confidentialityContract)) {
  1330.             $this->confidentialityContracts->add($confidentialityContract);
  1331.             $confidentialityContract->setUser($this);
  1332.         }
  1333.         return $this;
  1334.     }
  1335.     public function removeConfidentialityContract(ConfidentialityContract $confidentialityContract): static
  1336.     {
  1337.         if ($this->confidentialityContracts->removeElement($confidentialityContract)) {
  1338.             // set the owning side to null (unless already changed)
  1339.             if ($confidentialityContract->getUser() === $this) {
  1340.                 $confidentialityContract->setUser(null);
  1341.             }
  1342.         }
  1343.         return $this;
  1344.     }
  1345.     /**
  1346.      * @return Collection|CampaignPendingToSend[]
  1347.      */
  1348.     public function getCampaignPendingToSends(): Collection
  1349.     {
  1350.         return $this->campaignPendingToSends;
  1351.     }
  1352.     public function addCampaignPendingToSend(CampaignPendingToSend $campaignPendingToSend): self
  1353.     {
  1354.         if (!$this->campaignPendingToSends->contains($campaignPendingToSend)) {
  1355.             $this->campaignPendingToSends[] = $campaignPendingToSend;
  1356.             $campaignPendingToSend->setUser($this);
  1357.         }
  1358.         return $this;
  1359.     }
  1360.     public function removeCampaignPendingToSend(CampaignPendingToSend $campaignPendingToSend): self
  1361.     {
  1362.         if ($this->campaignPendingToSends->removeElement($campaignPendingToSend)) {
  1363.             // set the owning side to null (unless already changed)
  1364.             if ($campaignPendingToSend->getUser() === $this) {
  1365.                 $campaignPendingToSend->setUser(null);
  1366.             }
  1367.         }
  1368.         return $this;
  1369.     }
  1370.     public function isNewAdd(): ?bool
  1371.     {
  1372.         return $this->newAdd;
  1373.     }
  1374.     public function isShareMyEmail(): ?bool
  1375.     {
  1376.         return $this->shareMyEmail;
  1377.     }
  1378.     public function isShareMyPhone(): ?bool
  1379.     {
  1380.         return $this->shareMyPhone;
  1381.     }
  1382.     public function isIsActiveNotification(): ?bool
  1383.     {
  1384.         return $this->isActiveNotification;
  1385.     }
  1386.     public function isDeleted(): ?bool
  1387.     {
  1388.         return $this->deleted;
  1389.     }
  1390.     public function isReferencingConfirmationNotification(): ?bool
  1391.     {
  1392.         return $this->referencingConfirmationNotification;
  1393.     }
  1394.     public function isIsLogged(): ?bool
  1395.     {
  1396.         return $this->isLogged;
  1397.     }
  1398.     /**
  1399.      * @return Collection<int, FileMission>
  1400.      */
  1401.     public function getFileMissions(): Collection
  1402.     {
  1403.         return $this->fileMissions;
  1404.     }
  1405.     public function addFileMission(FileMission $fileMission): static
  1406.     {
  1407.         if (!$this->fileMissions->contains($fileMission)) {
  1408.             $this->fileMissions->add($fileMission);
  1409.             $fileMission->setUser($this);
  1410.         }
  1411.         return $this;
  1412.     }
  1413.     public function removeFileMission(FileMission $fileMission): static
  1414.     {
  1415.         if ($this->fileMissions->removeElement($fileMission)) {
  1416.             // set the owning side to null (unless already changed)
  1417.             if ($fileMission->getUser() === $this) {
  1418.                 $fileMission->setUser(null);
  1419.             }
  1420.         }
  1421.         return $this;
  1422.     }
  1423.     public function getIsNewClient(): ?bool
  1424.     {
  1425.         return $this->isNewClient;
  1426.     }
  1427.     public function setIsNewClient(?bool $isNewClient): self
  1428.     {
  1429.         $this->isNewClient $isNewClient;
  1430.         return $this;
  1431.     }
  1432.     public function getAutorizationDateAt(): ?\DateTimeImmutable
  1433.     {
  1434.         return $this->autorizationDateAt;
  1435.     }
  1436.     public function setAutorizationDateAt(?\DateTimeImmutable $autorizationDateAt): self
  1437.     {
  1438.         $this->autorizationDateAt $autorizationDateAt;
  1439.         return $this;
  1440.     }
  1441.     public function getUserData(): ?UserData
  1442.     {
  1443.         return $this->userData;
  1444.     }
  1445.     public function setUserData(?UserData $userData): self
  1446.     {
  1447.         $this->userData $userData;
  1448.         return $this;
  1449.     }
  1450.     public function getAcceptPresentation(): ?bool
  1451.     {
  1452.         return $this->acceptPresentation;
  1453.     }
  1454.     public function setAcceptPresentation(?bool $acceptPresentation): self
  1455.     {
  1456.         $this->acceptPresentation $acceptPresentation;
  1457.         return $this;
  1458.     }
  1459.     public function getDescription(): ?string
  1460.     {
  1461.         return $this->description;
  1462.     }
  1463.     public function setDescription(?string $description): self
  1464.     {
  1465.         $this->description $description;
  1466.         return $this;
  1467.     }
  1468.     public function getTitle(): ?string
  1469.     {
  1470.         return $this->title;
  1471.     }
  1472.     public function setTitle(?string $title): self
  1473.     {
  1474.         $this->title $title;
  1475.         return $this;
  1476.     }
  1477.     public function getOneTimeLoginToken(): ?string
  1478.     {
  1479.         return $this->oneTimeLoginToken;
  1480.     }
  1481.     public function setOneTimeLoginToken(?string $oneTimeLoginToken): self
  1482.     {
  1483.         $this->oneTimeLoginToken $oneTimeLoginToken;
  1484.         return $this;
  1485.     }
  1486.     public function getState(): ?string
  1487.     {
  1488.         return $this->state;
  1489.     }
  1490.     public function setState(?string $state): self
  1491.     {
  1492.         $this->state $state;
  1493.         return  $this
  1494.     }
  1495.     /**
  1496.      * @return Collection|Portfolio[]
  1497.      */
  1498.     public function getPortfolio(): Collection
  1499.     {
  1500.         return $this->portfolio;
  1501.     }
  1502.     public function addPortfolio(Portfolio $portfolio): self
  1503.     {
  1504.         if (!$this->portfolio->contains($portfolio)) {
  1505.             $this->portfolio[] = $portfolio;
  1506.             $portfolio->setUser($this);
  1507.         }
  1508.         return $this;
  1509.     }
  1510.     public function removePortfolio(Portfolio $portfolio): self
  1511.     {
  1512.         if ($this->portfolio->removeElement($portfolio)) {
  1513.             // set the owning side to null (unless already changed)
  1514.             if ($portfolio->getUser() === $this) {
  1515.                 $portfolio->setUser(null);
  1516.             }
  1517.         }
  1518.         return $this;
  1519.     }
  1520.     public function getSalary(): ?bool
  1521.     {
  1522.         return $this->salary;
  1523.     }
  1524.     public function setSalary(?bool $salary): self
  1525.     {
  1526.         $this->salary $salary;
  1527.         return $this;
  1528.     }
  1529.     public function getAllCompany(): ?bool
  1530.     {
  1531.         return $this->allCompany;
  1532.     }
  1533.     public function setAllCompany(?bool $allCompany): self
  1534.     {
  1535.         $this->allCompany $allCompany;
  1536.         return $this;
  1537.     }
  1538.     public function getManager(): ?bool
  1539.     {
  1540.         return $this->manager;
  1541.     }
  1542.     public function setManager(?bool $manager): self
  1543.     {
  1544.         $this->manager $manager;
  1545.         return $this;
  1546.     }
  1547.     /**
  1548.      * @return Collection|Company[]
  1549.      */
  1550.     public function getOtherCompany(): Collection
  1551.     {
  1552.         return $this->otherCompany;
  1553.     }
  1554.     public function addOtherCompany(Company $otherCompany): self
  1555.     {
  1556.         if (!$this->otherCompany->contains($otherCompany)) {
  1557.             $this->otherCompany[] = $otherCompany;
  1558.         }
  1559.         return $this;
  1560.     }
  1561.     public function removeOtherCompany(Company $otherCompany): self
  1562.     {
  1563.         $this->otherCompany->removeElement($otherCompany);
  1564.         return $this;
  1565.     }
  1566.     
  1567.     public function getPartner(): ?bool
  1568.     {
  1569.         return $this->partner;
  1570.     }
  1571.     public function setPartner(?bool $partner): self
  1572.     {
  1573.         $this->partner $partner;
  1574.         return $this;
  1575.     }
  1576.     public function getParent(): ?self
  1577.     {
  1578.         return $this->parent;
  1579.     }
  1580.     public function setParent(?self $parent): self
  1581.     {
  1582.         $this->parent $parent;
  1583.         return $this;
  1584.     }
  1585.     /**
  1586.      * @return Collection|User[]
  1587.      */
  1588.     public function getChildren(): Collection
  1589.     {
  1590.         return $this->children;
  1591.     }
  1592.     public function addChild(User $child): self
  1593.     {
  1594.         if (!$this->children->contains($child)) {
  1595.             $this->children[] = $child;
  1596.             $child->setParent($this);
  1597.         }
  1598.         return $this;
  1599.     }
  1600.     public function removeChild(User $child): self
  1601.     {
  1602.         if ($this->children->removeElement($child)) {
  1603.             // set the owning side to null (unless already changed)
  1604.             if ($child->getParent() === $this) {
  1605.                 $child->setParent(null);
  1606.             }
  1607.         }
  1608.         return $this;
  1609.     }
  1610.     public function getOriginalEmail(): ?string
  1611.     {
  1612.         return $this->OriginalEmail;
  1613.     }
  1614.     public function setOriginalEmail(?string $OriginalEmail): self
  1615.     {
  1616.         $this->OriginalEmail $OriginalEmail;
  1617.         return $this;
  1618.     }
  1619.     /**
  1620.      * @return Collection|SignedContract[]
  1621.      */
  1622.     public function getSignedContracts(): Collection
  1623.     {
  1624.         return $this->signedContracts;
  1625.     }
  1626.     public function addSignedContract(SignedContract $signedContract): self
  1627.     {
  1628.         if (!$this->signedContracts->contains($signedContract)) {
  1629.             $this->signedContracts[] = $signedContract;
  1630.             $signedContract->setUser($this);
  1631.         }
  1632.         return $this;
  1633.     }
  1634.     public function removeSignedContract(SignedContract $signedContract): self
  1635.     {
  1636.         if ($this->signedContracts->removeElement($signedContract)) {
  1637.             // set the owning side to null (unless already changed)
  1638.             if ($signedContract->getUser() === $this) {
  1639.                 $signedContract->setUser(null);
  1640.             }
  1641.         }
  1642.         return $this;
  1643.     }
  1644.     /**
  1645.      * @return Collection|Company[]
  1646.      */
  1647.     public function getCompaniesRepresentative(): Collection
  1648.     {
  1649.         return $this->companiesRepresentative;
  1650.     }
  1651.     public function addCompanyRepresentative(Company $companiesRepresentative): self
  1652.     {
  1653.         if (!$this->companiesRepresentative->contains($companiesRepresentative)) {
  1654.             $this->companiesRepresentative[] = $companiesRepresentative;
  1655.             $companiesRepresentative->setRepresentative($this);
  1656.         }
  1657.         return $this;
  1658.     }
  1659.     public function removeCompanyRepresentative(Company $companiesRepresentative): self
  1660.     {
  1661.         if ($this->companiesRepresentative->removeElement($companiesRepresentative)) {
  1662.             // set the owning side to null (unless already changed)
  1663.             if ($companiesRepresentative->getRepresentative() === $this) {
  1664.                 $companiesRepresentative->setRepresentative(null);
  1665.             }
  1666.         }
  1667.         return $this;
  1668.     }
  1669.     /**
  1670.      * @return Collection|Product[]
  1671.      */
  1672.     public function getProducts(): Collection
  1673.     {
  1674.         return $this->products;
  1675.     }
  1676.     public function addProduct(Product $product): self
  1677.     {
  1678.         if (!$this->products->contains($product)) {
  1679.             $this->products[] = $product;
  1680.             $product->setCreatedBy($this);
  1681.         }
  1682.         return $this;
  1683.     }
  1684.     public function removeProduct(Product $product): self
  1685.     {
  1686.         if ($this->products->removeElement($product)) {
  1687.             // set the owning side to null (unless already changed)
  1688.             if ($product->getCreatedBy() === $this) {
  1689.                 $product->setCreatedBy(null);
  1690.             }
  1691.         }
  1692.         return $this;
  1693.     }
  1694.     /**
  1695.      * @return Collection|WorkflowStep[]
  1696.      */
  1697.     public function getWorkflowSteps(): Collection
  1698.     {
  1699.         return $this->workflowSteps;
  1700.     }
  1701.     public function addWorkflowStep(WorkflowStep $workflowStep): self
  1702.     {
  1703.         if (!$this->workflowSteps->contains($workflowStep)) {
  1704.             $this->workflowSteps[] = $workflowStep;
  1705.             $workflowStep->addUserResponsable($this);
  1706.         }
  1707.         return $this;
  1708.     }
  1709.     public function removeWorkflowStep(WorkflowStep $workflowStep): self
  1710.     {
  1711.         if ($this->workflowSteps->removeElement($workflowStep)) {
  1712.             $workflowStep->removeUserResponsable($this);
  1713.         }
  1714.         return $this;
  1715.     }
  1716.     // for api only
  1717.         public function getListAccount()
  1718.         {
  1719.             return $this->listAccount;
  1720.         }
  1721.         public function setListAccount($listAccount){
  1722.             $this->listAccount $listAccount;
  1723.             return $this;
  1724.         }
  1725.         public function getRoleName()
  1726.         {
  1727.             return $this->roleName;
  1728.         }
  1729.         public function setRoleName($roleName){
  1730.             $this->roleName $roleName;
  1731.             return $this;
  1732.         }
  1733.         public function getIdentifier(): ?string
  1734.         {
  1735.             return $this->identifier;
  1736.         }
  1737.         public function setIdentifier(?string $identifier): self
  1738.         {
  1739.             $this->identifier $identifier;
  1740.             return $this;
  1741.         }
  1742.         /**
  1743.          * @return Collection<int, SharedResourcesCategory>
  1744.          */
  1745.         public function getSharedResourcesCategories(): Collection
  1746.         {
  1747.             return $this->sharedResourcesCategories;
  1748.         }
  1749.         public function addSharedResourcesCategory(SharedResourcesCategory $sharedResourcesCategory): static
  1750.         {
  1751.             if (!$this->sharedResourcesCategories->contains($sharedResourcesCategory)) {
  1752.                 $this->sharedResourcesCategories->add($sharedResourcesCategory);
  1753.                 $sharedResourcesCategory->setCreatedBy($this);
  1754.             }
  1755.             return $this;
  1756.         }
  1757.         public function removeSharedResourcesCategory(SharedResourcesCategory $sharedResourcesCategory): static
  1758.         {
  1759.             if ($this->sharedResourcesCategories->removeElement($sharedResourcesCategory)) {
  1760.                 // set the owning side to null (unless already changed)
  1761.                 if ($sharedResourcesCategory->getCreatedBy() === $this) {
  1762.                     $sharedResourcesCategory->setCreatedBy(null);
  1763.                 }
  1764.             }
  1765.             return $this;
  1766.         }
  1767.         /**
  1768.          * @return Collection<int, CompanyResource>
  1769.          */
  1770.         public function getCompanyResources(): Collection
  1771.         {
  1772.             return $this->companyResources;
  1773.         }
  1774.         public function addCompanyResource(CompanyResource $companyResource): static
  1775.         {
  1776.             if (!$this->companyResources->contains($companyResource)) {
  1777.                 $this->companyResources->add($companyResource);
  1778.                 $companyResource->setCreatedBy($this);
  1779.             }
  1780.             return $this;
  1781.         }
  1782.         public function removeCompanyResource(CompanyResource $companyResource): static
  1783.         {
  1784.             if ($this->companyResources->removeElement($companyResource)) {
  1785.                 // set the owning side to null (unless already changed)
  1786.                 if ($companyResource->getCreatedBy() === $this) {
  1787.                     $companyResource->setCreatedBy(null);
  1788.                 }
  1789.             }
  1790.             return $this;
  1791.         }
  1792.         // public function getFilePermissions(): ?FilePermissions
  1793.         // {
  1794.         //     return $this->filePermissions;
  1795.         // }
  1796.         // public function setFilePermissions(?FilePermissions $filePermissions): static
  1797.         // {
  1798.         //     $this->filePermissions = $filePermissions;
  1799.         //     return $this;
  1800.         // }
  1801.         /**
  1802.          * @return Collection<int, ResourceDeliverableHistory>
  1803.          */
  1804.         public function getResourceDeliverableHistories(): Collection
  1805.         {
  1806.             return $this->resourceDeliverableHistories;
  1807.         }
  1808.         public function addResourceDeliverableHistory(ResourceDeliverableHistory $resourceDeliverableHistory): static
  1809.         {
  1810.             if (!$this->resourceDeliverableHistories->contains($resourceDeliverableHistory)) {
  1811.                 $this->resourceDeliverableHistories->add($resourceDeliverableHistory);
  1812.                 $resourceDeliverableHistory->setCreatedBy($this);
  1813.             }
  1814.             return $this;
  1815.         }
  1816.         public function removeResourceDeliverableHistory(ResourceDeliverableHistory $resourceDeliverableHistory): static
  1817.         {
  1818.             if ($this->resourceDeliverableHistories->removeElement($resourceDeliverableHistory)) {
  1819.                 // set the owning side to null (unless already changed)
  1820.                 if ($resourceDeliverableHistory->getCreatedBy() === $this) {
  1821.                     $resourceDeliverableHistory->setCreatedBy(null);
  1822.                 }
  1823.             }
  1824.             return $this;
  1825.         }
  1826.         /**
  1827.          * @return Collection<int, FilesResourceDeliverableHistory>
  1828.          */
  1829.         public function getFilesResourceDeliverableHistories(): Collection
  1830.         {
  1831.             return $this->filesResourceDeliverableHistories;
  1832.         }
  1833.         public function addFilesResourceDeliverableHistory(FilesResourceDeliverableHistory $filesResourceDeliverableHistory): static
  1834.         {
  1835.             if (!$this->filesResourceDeliverableHistories->contains($filesResourceDeliverableHistory)) {
  1836.                 $this->filesResourceDeliverableHistories->add($filesResourceDeliverableHistory);
  1837.                 $filesResourceDeliverableHistory->setCreatedBy($this);
  1838.             }
  1839.             return $this;
  1840.         }
  1841.         public function removeFilesResourceDeliverableHistory(FilesResourceDeliverableHistory $filesResourceDeliverableHistory): static
  1842.         {
  1843.             if ($this->filesResourceDeliverableHistories->removeElement($filesResourceDeliverableHistory)) {
  1844.                 // set the owning side to null (unless already changed)
  1845.                 if ($filesResourceDeliverableHistory->getCreatedBy() === $this) {
  1846.                     $filesResourceDeliverableHistory->setCreatedBy(null);
  1847.                 }
  1848.             }
  1849.             return $this;
  1850.         }
  1851.         /**
  1852.          * @return Collection<int, FilePermissions>
  1853.          */
  1854.         public function getFilePermissions(): Collection
  1855.         {
  1856.             return $this->filePermissions;
  1857.         }
  1858.         public function addFilePermission(FilePermissions $filePermission): static
  1859.         {
  1860.             if (!$this->filePermissions->contains($filePermission)) {
  1861.                 $this->filePermissions->add($filePermission);
  1862.                 $filePermission->addUser($this);
  1863.             }
  1864.             return $this;
  1865.         }
  1866.         public function removeFilePermission(FilePermissions $filePermission): static
  1867.         {
  1868.             if ($this->filePermissions->removeElement($filePermission)) {
  1869.                 $filePermission->removeUser($this);
  1870.             }
  1871.             return $this;
  1872.         }
  1873.         /**
  1874.          * @return Collection<int, FolderPermissions>
  1875.          */
  1876.         public function getFolderPermissions(): Collection
  1877.         {
  1878.             return $this->folderPermissions;
  1879.         }
  1880.         public function addFolderPermission(FolderPermissions $folderPermission): static
  1881.         {
  1882.             if (!$this->folderPermissions->contains($folderPermission)) {
  1883.                 $this->folderPermissions->add($folderPermission);
  1884.                 $folderPermission->addUser($this);
  1885.             }
  1886.             return $this;
  1887.         }
  1888.         public function removeFolderPermission(FolderPermissions $folderPermission): static
  1889.         {
  1890.             if ($this->folderPermissions->removeElement($folderPermission)) {
  1891.                 $folderPermission->removeUser($this);
  1892.             }
  1893.             return $this;
  1894.         }
  1895.         /**
  1896.          * @return Collection<int, FolderPermissions>
  1897.          */
  1898.         public function getFolderPermissionsCreatedBy(): Collection
  1899.         {
  1900.             return $this->folderPermissionsCreatedBy;
  1901.         }
  1902.         public function addFolderPermissionsCreatedBy(FolderPermissions $folderPermissionsCreatedBy): static
  1903.         {
  1904.             if (!$this->folderPermissionsCreatedBy->contains($folderPermissionsCreatedBy)) {
  1905.                 $this->folderPermissionsCreatedBy->add($folderPermissionsCreatedBy);
  1906.                 $folderPermissionsCreatedBy->setCreatedBy($this);
  1907.             }
  1908.             return $this;
  1909.         }
  1910.         public function removeFolderPermissionsCreatedBy(FolderPermissions $folderPermissionsCreatedBy): static
  1911.         {
  1912.             if ($this->folderPermissionsCreatedBy->removeElement($folderPermissionsCreatedBy)) {
  1913.                 // set the owning side to null (unless already changed)
  1914.                 if ($folderPermissionsCreatedBy->getCreatedBy() === $this) {
  1915.                     $folderPermissionsCreatedBy->setCreatedBy(null);
  1916.                 }
  1917.             }
  1918.             return $this;
  1919.         }
  1920.         /**
  1921.          * @return Collection<int, FilePermissions>
  1922.          */
  1923.         public function getFilePermissionsCreatedBy(): Collection
  1924.         {
  1925.             return $this->filePermissionsCreatedBy;
  1926.         }
  1927.         public function addFilePermissionsCreatedBy(FilePermissions $filePermissionsCreatedBy): static
  1928.         {
  1929.             if (!$this->filePermissionsCreatedBy->contains($filePermissionsCreatedBy)) {
  1930.                 $this->filePermissionsCreatedBy->add($filePermissionsCreatedBy);
  1931.                 $filePermissionsCreatedBy->setCreatedBy($this);
  1932.             }
  1933.             return $this;
  1934.         }
  1935.         public function removeFilePermissionsCreatedBy(FilePermissions $filePermissionsCreatedBy): static
  1936.         {
  1937.             if ($this->filePermissionsCreatedBy->removeElement($filePermissionsCreatedBy)) {
  1938.                 // set the owning side to null (unless already changed)
  1939.                 if ($filePermissionsCreatedBy->getCreatedBy() === $this) {
  1940.                     $filePermissionsCreatedBy->setCreatedBy(null);
  1941.                 }
  1942.             }
  1943.             return $this;
  1944.         }
  1945.     
  1946. }