src/Entity/User.php line 20

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  10. use Symfony\Component\Security\Core\User\UserInterface;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. #[ORM\Entity(repositoryClassUserRepository::class)]
  13. #[ORM\Table(name'`user`')]
  14. #[UniqueEntity(fields: ['email'], message'Cette adresse email est déjà utilisée.')]
  15. #[UniqueEntity(fields: ['phone'], message'Ce numéro de téléphone est déjà utilisé.')]
  16. class User implements UserInterfacePasswordAuthenticatedUserInterface
  17. {
  18.     CONST GOD_ADMIN "ROLE_GOD_ADMIN";
  19.     CONST ADMIN "ROLE_ADMIN";
  20.     CONST COMPTABLE "ROLE_COMPTABLE";
  21.     CONST TENANT "ROLE_TENANT";
  22.     CONST SUPER_AGENT ="ROLE_SUPER_AGENT";
  23.     CONST LESSOR "ROLE_LESSOR";
  24.     CONST AGENT "ROLE_AGENT";
  25.     CONST CONSULAT "ROLE_CONSULAT";
  26.     CONST RESIDENT "ROLE_LESSOR_RESIDENT";
  27.     #[ORM\Id]
  28.     #[ORM\GeneratedValue]
  29.     #[ORM\Column]
  30.     private ?int $id null;
  31.     #[ORM\Column(length180uniquetrue)]
  32.     private ?string $email null;
  33.     #[ORM\Column]
  34.     private array $roles = [];
  35.     /**
  36.      * @var string The hashed password
  37.      */
  38.     #[ORM\Column]
  39.     private ?string $password "0";
  40.     protected $beforeRole;
  41.     #[ORM\Column(length255nullabletrue)]
  42.     private ?string $fullName null;
  43.     #[ORM\Column(length255nullabletrue)]
  44.     private ?string $phone null;
  45.     #[ORM\Column]
  46.     private ?bool $isActive true;
  47.     #[ORM\Column(length255nullabletrue)]
  48.     private ?string $firstName null;
  49.     #[ORM\Column(length255nullabletrue)]
  50.     private ?string $lastName null;
  51.     #[ORM\Column(length255nullabletrue)]
  52.     private ?string $country null;
  53.     #[ORM\Column(length255nullabletrue)]
  54.     private ?string $city null;
  55.     #[ORM\Column(length255nullabletrue)]
  56.     private ?string $lessorType null;
  57.     #[ORM\Column]
  58.     private ?bool $registrationFinalized false;
  59.     #[ORM\Column(length255nullabletrue)]
  60.     private ?string $nationality null;
  61.     #[ORM\Column(length255nullabletrue)]
  62.     private ?string $agentType null;
  63.     #[ORM\Column(length255nullabletrue)]
  64.     private ?string $representativeName null;
  65.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  66.     private ?\DateTimeInterface $signAt null;
  67.     
  68.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  69.     private ?\DateTimeInterface $editedAt null;
  70.     #[ORM\OneToMany(mappedBy'propertyManager'targetEntityBuilding::class)]
  71.     private Collection $buildings;
  72.     #[ORM\Column(length255nullabletrue)]
  73.     private ?string $customerType null;
  74.     #[ORM\Column(length255nullabletrue)]
  75.     private ?string $headOffice null;
  76.     #[ORM\Column(length255nullabletrue)]
  77.     private ?string $numberTva null;
  78.     #[ORM\Column(length255nullabletrue)]
  79.     private ?string $companyType null;
  80.     #[ORM\Column(length255nullabletrue)]
  81.     private ?string $street null;
  82.     #[ORM\Column(length255nullabletrue)]
  83.     private ?string $streetNumber null;
  84.     #[ORM\OneToMany(mappedBy'tenant'targetEntityBuilding::class)]
  85.     private Collection $tenantBuildings;
  86.     #[ORM\Column(length255nullabletrue)]
  87.     private ?string $adress2 null;
  88.     #[ORM\Column(length255nullabletrue)]
  89.     private ?string $adress1 null;
  90.     #[ORM\Column(length255nullabletrue)]
  91.     private ?string $lastPostalCode null;
  92.     #[ORM\Column(length255nullabletrue)]
  93.     private ?string $lastCity null;
  94.     #[ORM\Column(length255nullabletrue)]
  95.     private ?string $lastCountry null;
  96.     #[ORM\Column(length255nullabletrue)]
  97.     private ?string $visaType null;
  98.     #[ORM\Column(length255nullabletrue)]
  99.     private ?string $postalCode null;
  100.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  101.     private ?\DateTimeInterface $birthDate null;
  102.     #[ORM\Column(length255nullabletrue)]
  103.     private ?string $civility null;
  104.     #[ORM\OneToMany(mappedBy'tenant'targetEntityRentalHistory::class)]
  105.     private Collection $rentalHistories;
  106.     #[ORM\OneToMany(mappedBy'agent'targetEntityAgentCountryCovered::class, cascade: ['persist''remove'])]
  107.     private Collection $agentCountryCovereds;
  108.     #[ORM\ManyToOne(targetEntityself::class, inversedBy'managed')]
  109.     private ?self $managedBy null;
  110.     #[ORM\OneToMany(mappedBy'managedBy'targetEntityself::class)]
  111.     private Collection $managed;
  112.     #[ORM\ManyToOne(targetEntityself::class, inversedBy'teamWithAgent')]
  113.     private ?self $teamWith;
  114.     #[ORM\OneToMany(mappedBy'teamWith'targetEntityself::class)]
  115.     private Collection $teamWithAgent;
  116.     #[ORM\OneToMany(mappedBy'user'targetEntityDocument::class,cascade: ['persist''remove'])]
  117.     private Collection $documents;
  118.     #[ORM\OneToMany(mappedBy'user'targetEntityBuildingReportingHistory::class)]
  119.     private Collection $buildingReportingHistoriesUser;
  120.     #[ORM\OneToMany(mappedBy'user'targetEntityRefusedVisa::class)]
  121.     private Collection $refusedVisas;
  122.     #[ORM\OneToMany(mappedBy'user'targetEntityHousingCertificate::class)]
  123.     private Collection $housingCertificates;
  124.     #[ORM\OneToMany(mappedBy'tenant'targetEntityBuildingFolder::class)]
  125.     private Collection $buildingFolders;
  126.     #[ORM\OneToMany(mappedBy'administrator'targetEntityResidence::class)]
  127.     private Collection $residences;
  128.     #[ORM\Column(length255nullabletrue)]
  129.     private ?string $nameLegal null;
  130.     #[ORM\Column(length255nullabletrue)]
  131.     private ?string $firstNameLegal null;
  132.     #[ORM\Column(length255nullabletrue)]
  133.     private ?string $phoneLegal null;
  134.     #[ORM\Column(length255nullabletrue)]
  135.     private ?string $emailLegal null;
  136.     #[ORM\Column(length255nullabletrue)]
  137.     private ?string $activity null;
  138.     #[ORM\OneToMany(mappedBy'requester'targetEntityWantedVisio::class)]
  139.     private Collection $wantedVisios;
  140.     #[ORM\OneToMany(mappedBy'user'targetEntityLikedBuilding::class)]
  141.     private Collection $likedBuildings;
  142.     #[ORM\Column]
  143.     private ?bool $firstLease true;
  144.     #[ORM\Column]
  145.     private ?bool $commercialMail =false;
  146.     #[ORM\Column(nullabletrue)]
  147.     private ?int $packAttestation null;
  148.     #[ORM\Column(length255nullabletrue)]
  149.     private ?string $agentEnderControl =null;
  150.     #[ORM\Column(length255nullabletrue)]
  151.     private ?string $consulatCountry null;
  152.     #[ORM\Column(nullabletrue)]
  153.     private ?int $stepProfil null;
  154.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  155.     private ?\DateTimeInterface $dateStartAt null;
  156.     
  157.     #[ORM\Column(nullabletrue)]
  158.     private ?int $rentalDuration null;
  159.     
  160.     #[ORM\Column(length255nullabletrue)]
  161.     private ?string $status null;
  162.     #[ORM\Column(length255nullabletrue)]
  163.     private ?string $formationName null;
  164.     #[ORM\Column(length255nullabletrue)]
  165.     private ?string $schoolName null;
  166.     #[ORM\Column(length255nullabletrue)]
  167.     private ?string $schoolAddress null;
  168.     #[ORM\Column(length255nullabletrue)]
  169.     private ?string $studyLevel null;
  170.     #[ORM\Column(length255nullabletrue)]
  171.     private ?string $company null;
  172.     #[ORM\Column(length255nullabletrue)]
  173.     private ?string $employementContract null;
  174.     #[ORM\Column(length255nullabletrue)]
  175.     private ?string $trialPeriod null;
  176.     #[ORM\Column(nullabletrue)]
  177.     private ?int $netMonthlySalary null;
  178.     #[ORM\Column(length255nullabletrue)]
  179.     private ?string $guarantorType null;
  180.     #[ORM\Column(length255nullabletrue)]
  181.     private ?string $physicalGuarantorType null;
  182.     #[ORM\Column(length255nullabletrue)]
  183.     private ?string $statutResidencePrincipale null;
  184.     #[ORM\Column(nullabletrue)]
  185.     private ?int $mensualRent null;
  186.     #[ORM\Column(length255nullabletrue)]
  187.     private ?string $contractType null;
  188.     #[ORM\Column(length255nullabletrue)]
  189.     private ?string $finishedTrialPeriod null;
  190.     #[ORM\Column(nullabletrue)]
  191.     private ?string $income null;
  192.     #[ORM\Column(length255nullabletrue)]
  193.     private ?string $additionalIncomeSources null;
  194.     #[ORM\Column(length255nullabletrue)]
  195.     private ?string $additionalIncomeSourcesStudent null;
  196.     
  197.     #[ORM\Column(length255nullabletrue)]
  198.     private ?string $guarantorStatus null;
  199.     #[ORM\Column(length255nullabletrue)]
  200.     private ?string $professionalGuarantee null;
  201.     #[ORM\Column(length255nullabletrue)]
  202.     private ?string $physicalGuarantorNationality null;
  203.     #[ORM\Column(length255nullabletrue)]
  204.     private ?string $applicationMessage null;
  205.     #[ORM\Column(type'string'length255nullabletrue)]
  206.     private ?string $localAgreementNumber null;
  207.     #[ORM\Column(name'company_address'type'string'length255nullabletrue)]
  208.     private ?string $companyAddress null;
  209.     #[ORM\Column(name'representative_title'type'string'length255nullabletrue)]
  210.     private ?string $representativeTitle null;
  211.     #[ORM\Column(name'representative_first_name'type'string'length255nullabletrue)]
  212.     private ?string $representativeFirstName null;
  213.     #[ORM\OneToMany(mappedBy'userId'targetEntityHistoryUser::class)]
  214.     private Collection $historyUsers;
  215.     #[ORM\OneToMany(mappedBy'user'targetEntityInvoice::class, cascade: ['persist''remove'])]
  216.     private Collection $invoices;
  217.     
  218.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  219.     private ?\DateTimeInterface $sendSMS null;
  220.     
  221.     private ?string $validationCodeEmail null;
  222.     private ?string $validationCodePhone null;
  223.     public function getValidationCodeEmail(): ?string
  224.     {
  225.         return $this->validationCodeEmail;
  226.     }
  227.     public function setValidationCodeEmail(?string $validationCodeEmail): self
  228.     {
  229.         $this->validationCodeEmail $validationCodeEmail;
  230.         return $this;
  231.     }
  232.     public function getValidationCodePhone(): ?string
  233.     {
  234.         return $this->validationCodePhone;
  235.     }
  236.     public function setValidationCodePhone(?string $validationCodePhone): self
  237.     {
  238.         $this->validationCodePhone $validationCodePhone;
  239.         return $this;
  240.     }
  241.     public function __construct()
  242.     {
  243.         $this->signAt = new \DateTimeImmutable('now', new \DateTimeZone('Europe/Paris'));
  244.         $this->editedAt = new \DateTime('now', new \DateTimeZone('Europe/Paris'));
  245.         $this->buildings = new ArrayCollection();
  246.         $this->tenantBuildings = new ArrayCollection();
  247.         $this->rentalHistories = new ArrayCollection();
  248.         $this->agentCountryCovereds = new ArrayCollection();
  249.         $this->managed = new ArrayCollection();
  250.         $this->teamWithAgent = new ArrayCollection();
  251.         $this->documents = new ArrayCollection();
  252.         $this->buildingReportingHistoriesUser = new ArrayCollection();
  253.         $this->refusedVisas = new ArrayCollection();
  254.         $this->housingCertificates = new ArrayCollection();
  255.         $this->buildingFolders = new ArrayCollection();
  256.         $this->residences = new ArrayCollection();
  257.         $this->wantedVisios = new ArrayCollection();
  258.         $this->likedBuildings = new ArrayCollection();
  259.         $this->invoices = new ArrayCollection();
  260.         $this->setFirstLease(true);
  261.     }
  262.     
  263.     public function getLocalAgreementNumber(): ?string
  264.     {
  265.         return $this->localAgreementNumber;
  266.     }
  267.     public function setLocalAgreementNumber(?string $localAgreementNumber): self
  268.     {
  269.         $this->localAgreementNumber $localAgreementNumber;
  270.         return $this;
  271.     }
  272.     public function getRepresentativeFirstName(): ?string
  273.     {
  274.         return $this->representativeFirstName;
  275.     }
  276.     public function setRepresentativeFirstName(?string $representativeFirstName): self
  277.     {
  278.         $this->representativeFirstName $representativeFirstName;
  279.         return $this;
  280.     }
  281.     public function getCompanyAddress(): ?string
  282.     {
  283.         return $this->companyAddress;
  284.     }
  285.     public function setCompanyAddress(?string $companyAddress): self
  286.     {
  287.         $this->companyAddress $companyAddress;
  288.         return $this;
  289.     }
  290.     public function getRepresentativeTitle(): ?string
  291.     {
  292.         return $this->representativeTitle;
  293.     }
  294.     public function setRepresentativeTitle(?string $representativeTitle): self
  295.     {
  296.         $this->representativeTitle $representativeTitle;
  297.         return $this;
  298.     }
  299.     
  300.     public function __toString(): string
  301.     {
  302.         return $this->getLastName() . " " $this->getFirstName();
  303.     }
  304.     public function getId(): ?int
  305.     {
  306.         return $this->id;
  307.     }
  308.     public function getCommercialMail(): ?bool
  309.     {
  310.         return $this->commercialMail;
  311.     }
  312.     public function setCommercialMail(bool $commercialMail): self
  313.     {
  314.         $this->commercialMail $commercialMail;
  315.         return $this;
  316.     }
  317.     
  318.     public function getFirstLease(): ?bool
  319.     {
  320.         return $this->firstLease;
  321.     }
  322.     public function setFirstLease(bool $firstLease): self
  323.     {
  324.         $this->firstLease $firstLease;
  325.         return $this;
  326.     }
  327.     public function getEmail(): ?string
  328.     {
  329.         return $this->email;
  330.     }
  331.     public function setEmail(string $email): self
  332.     {
  333.         $this->email $email;
  334.         return $this;
  335.     }
  336.     /**
  337.      * A visual identifier that represents this user.
  338.      *
  339.      * @see UserInterface
  340.      */
  341.     public function getUserIdentifier(): string
  342.     {
  343.         return (string) $this->email;
  344.     }
  345.     /**
  346.      * @see UserInterface
  347.      */
  348.     public function getRoles(): array
  349.     {
  350.         $roles $this->roles;
  351.         // guarantee every user at least has ROLE_USER
  352.         $roles[] = 'ROLE_USER';
  353.         return array_unique($roles);
  354.     }
  355.     public function setRoles(array $roles): self
  356.     {
  357.         $this->roles $roles;
  358.         return $this;
  359.     }
  360.     public function asRole(string $role): bool
  361.     {
  362.         if (in_array($role$this->getRoles(), true)) {
  363.             return true;
  364.         } else {
  365.             return false;
  366.         }
  367.     }
  368.     /**
  369.      * @see PasswordAuthenticatedUserInterface
  370.      */
  371.     public function getPassword(): string
  372.     {
  373.         return $this->password;
  374.     }
  375.     public function setPassword(string $password): self
  376.     {
  377.         $this->password $password;
  378.         return $this;
  379.     }
  380.     /**
  381.      * @see UserInterface
  382.      */
  383.     public function eraseCredentials()
  384.     {
  385.         // If you store any temporary, sensitive data on the user, clear it here
  386.         // $this->plainPassword = null;
  387.     }
  388.     /**
  389.      * @return mixed
  390.      */
  391.     public function getBeforeRole()
  392.     {
  393.         return $this->beforeRole;
  394.     }
  395.     /**
  396.      * @param mixed $beforeRole
  397.      */
  398.     public function setBeforeRole($beforeRole): void
  399.     {
  400.         $this->beforeRole $beforeRole;
  401.     }
  402.     public function getFullName(): ?string
  403.     {
  404.         return $this->fullName;
  405.     }
  406.     public function setFullName(?string $fullName): self
  407.     {
  408.         $this->fullName $fullName;
  409.         return $this;
  410.     }
  411.     public function getPhone(): ?string
  412.     {
  413.         return $this->phone;
  414.     }
  415.     public function setPhone(?string $phone): self
  416.     {
  417.         $this->phone $phone;
  418.         return $this;
  419.     }
  420.     public function isIsActive(): ?bool
  421.     {
  422.         return $this->isActive;
  423.     }
  424.     public function setIsActive(bool $isActive): self
  425.     {
  426.         $this->isActive $isActive;
  427.         return $this;
  428.     }
  429.     public function getFirstName(): ?string
  430.     {
  431.         return $this->firstName;
  432.     }
  433.     public function setFirstName(?string $firstName): self
  434.     {
  435.         $this->firstName $firstName;
  436.         return $this;
  437.     }
  438.     public function getLastName(): ?string
  439.     {
  440.         return $this->lastName;
  441.     }
  442.     public function setLastName(?string $lastName): self
  443.     {
  444.         $this->lastName $lastName;
  445.         return $this;
  446.     }
  447.     public function getCountry(): ?string
  448.     {
  449.         return $this->country;
  450.     }
  451.     public function setCountry(?string $country): self
  452.     {
  453.         $this->country $country;
  454.         return $this;
  455.     }
  456.     public function getCity(): ?string
  457.     {
  458.         return $this->city;
  459.     }
  460.     public function setCity(?string $city): self
  461.     {
  462.         $this->city $city;
  463.         return $this;
  464.     }
  465.     public function getLessorType(): ?string
  466.     {
  467.         return $this->lessorType;
  468.     }
  469.     public function setLessorType(?string $lessorType): self
  470.     {
  471.         $this->lessorType $lessorType;
  472.         return $this;
  473.     }
  474.     public function isRegistrationFinalized(): ?bool
  475.     {
  476.         return $this->registrationFinalized;
  477.     }
  478.     public function setRegistrationFinalized(bool $registrationFinalized): self
  479.     {
  480.         $this->registrationFinalized $registrationFinalized;
  481.         return $this;
  482.     }
  483.     public function getNationality(): ?string
  484.     {
  485.         return $this->nationality;
  486.     }
  487.     public function setNationality(?string $nationality): self
  488.     {
  489.         $this->nationality $nationality;
  490.         return $this;
  491.     }
  492.     public function getAgentType(): ?string
  493.     {
  494.         return $this->agentType;
  495.     }
  496.     public function setAgentType(?string $agentType): self
  497.     {
  498.         $this->agentType $agentType;
  499.         return $this;
  500.     }
  501.     public function getRepresentativeName(): ?string
  502.     {
  503.         return $this->representativeName;
  504.     }
  505.     public function setRepresentativeName(?string $representativeName): self
  506.     {
  507.         $this->representativeName $representativeName;
  508.         return $this;
  509.     }
  510.     public function getSignAt(): ?\DateTimeInterface
  511.     {
  512.         return $this->signAt;
  513.     }
  514.     public function setSignAt(?\DateTimeInterface $signAt): self
  515.     {
  516.         $this->signAt $signAt;
  517.         return $this;
  518.     }
  519.     
  520.     public function getEditedAt(): ?\DateTimeInterface
  521.     {
  522.         return $this->editedAt;
  523.     }
  524.     public function setEditedAt(\DateTimeInterface $editedAt): self
  525.     {
  526.         $this->editedAt $editedAt;
  527.         return $this;
  528.     }
  529.     /**
  530.      * @return Collection<int, Building>
  531.      */
  532.     public function getBuildings(): Collection
  533.     {
  534.         return $this->buildings;
  535.     }
  536.     public function addBuilding(Building $building): self
  537.     {
  538.         if (!$this->buildings->contains($building)) {
  539.             $this->buildings->add($building);
  540.             $building->setPropertyManager($this);
  541.         }
  542.         return $this;
  543.     }
  544.     public function removeBuilding(Building $building): self
  545.     {
  546.         if ($this->buildings->removeElement($building)) {
  547.             // set the owning side to null (unless already changed)
  548.             if ($building->getPropertyManager() === $this) {
  549.                 $building->setPropertyManager(null);
  550.             }
  551.         }
  552.         return $this;
  553.     }
  554.     public function getCustomerType(): ?string
  555.     {
  556.         return $this->customerType;
  557.     }
  558.     public function setCustomerType(?string $customerType): self
  559.     {
  560.         $this->customerType $customerType;
  561.         return $this;
  562.     }
  563.     public function getHeadOffice(): ?string
  564.     {
  565.         return $this->headOffice;
  566.     }
  567.     public function setHeadOffice(string $headOffice): self
  568.     {
  569.         $this->headOffice $headOffice;
  570.         return $this;
  571.     }
  572.     public function getNumberTva(): ?string
  573.     {
  574.         return $this->numberTva;
  575.     }
  576.     public function setNumberTva(?string $numberTva): self
  577.     {
  578.         $this->numberTva $numberTva;
  579.         return $this;
  580.     }
  581.     public function getCompanyType(): ?string
  582.     {
  583.         return $this->companyType;
  584.     }
  585.     public function setCompanyType(?string $companyType): self
  586.     {
  587.         $this->companyType $companyType;
  588.         return $this;
  589.     }
  590.     public function getStreet(): ?string
  591.     {
  592.         return $this->street;
  593.     }
  594.     public function setStreet(?string $street): self
  595.     {
  596.         $this->street $street;
  597.         return $this;
  598.     }
  599.     public function getStreetNumber(): ?string
  600.     {
  601.         return $this->streetNumber;
  602.     }
  603.     public function setStreetNumber(?string $streetNumber): self
  604.     {
  605.         $this->streetNumber $streetNumber;
  606.         return $this;
  607.     }
  608.     /**
  609.      * @return Collection<int, Building>
  610.      */
  611.     public function getTenantBuildings(): Collection
  612.     {
  613.         return $this->tenantBuildings;
  614.     }
  615.     public function addTenantBuilding(Building $tenantBuilding): self
  616.     {
  617.         if (!$this->tenantBuildings->contains($tenantBuilding)) {
  618.             $this->tenantBuildings->add($tenantBuilding);
  619.             $tenantBuilding->setTenant($this);
  620.         }
  621.         return $this;
  622.     }
  623.     public function removeTenantBuilding(Building $tenantBuilding): self
  624.     {
  625.         if ($this->tenantBuildings->removeElement($tenantBuilding)) {
  626.             // set the owning side to null (unless already changed)
  627.             if ($tenantBuilding->getTenant() === $this) {
  628.                 $tenantBuilding->setTenant(null);
  629.             }
  630.         }
  631.         return $this;
  632.     }
  633.     public function getAdress2(): ?string
  634.     {
  635.         return $this->adress2;
  636.     }
  637.     public function setAdress2(?string $adress2): self
  638.     {
  639.         $this->adress2 $adress2;
  640.         return $this;
  641.     }
  642.     public function getAdress1(): ?string
  643.     {
  644.         return $this->adress1;
  645.     }
  646.     public function setAdress1(?string $adress1): self
  647.     {
  648.         $this->adress1 $adress1;
  649.         return $this;
  650.     }
  651.     public function getLastPostalCode(): ?string
  652.     {
  653.         return $this->lastPostalCode;
  654.     }
  655.     public function setLastPostalCode(?string $lastPostalCode): self
  656.     {
  657.         $this->lastPostalCode $lastPostalCode;
  658.         return $this;
  659.     }
  660.     public function getLastCity(): ?string
  661.     {
  662.         return $this->lastCity;
  663.     }
  664.     public function setLastCity(?string $lastCity): self
  665.     {
  666.         $this->lastCity $lastCity;
  667.         return $this;
  668.     }
  669.     public function getLastCountry(): ?string
  670.     {
  671.         return $this->lastCountry;
  672.     }
  673.     public function setLastCountry(?string $lastCountry): self
  674.     {
  675.         $this->lastCountry $lastCountry;
  676.         return $this;
  677.     }
  678.     public function getVisaType(): ?string
  679.     {
  680.         return $this->visaType;
  681.     }
  682.     public function setVisaType(?string $visaType): self
  683.     {
  684.         $this->visaType $visaType;
  685.         return $this;
  686.     }
  687.     public function getPostalCode(): ?string
  688.     {
  689.         return $this->postalCode;
  690.     }
  691.     public function setPostalCode(?string $postalCode): self
  692.     {
  693.         $this->postalCode $postalCode;
  694.         return $this;
  695.     }
  696.     public function getBirthDate(): ?\DateTimeInterface
  697.     {
  698.         return $this->birthDate;
  699.     }
  700.     public function setBirthDate(?\DateTimeInterface $birthDate): self
  701.     {
  702.         $this->birthDate $birthDate;
  703.         return $this;
  704.     }
  705.     public function getCivility(): ?string
  706.     {
  707.         return $this->civility;
  708.     }
  709.     public function setCivility(?string $civility): self
  710.     {
  711.         $this->civility $civility;
  712.         return $this;
  713.     }
  714.     /**
  715.      * @return Collection|Invoice[]
  716.      */
  717.     public function getInvoices(): Collection
  718.     {
  719.         return $this->invoices;
  720.     }
  721.     public function addInvoice(Invoice $invoice): self
  722.     {
  723.         if (!$this->invoices->contains($invoice)) {
  724.             $this->invoices->add($invoice);
  725.             $invoice->setUser($this);
  726.         }
  727.         return $this;
  728.     }
  729.     public function removeInvoice(Invoice $invoice): self
  730.     {
  731.         if ($this->invoices->removeElement($invoice)) {
  732.             // set the owning side to null (unless already changed)
  733.             if ($invoice->getUser() === $this) {
  734.                 $invoice->setUser(null);
  735.             }
  736.         }
  737.         return $this;
  738.     }
  739.     
  740.     /**
  741.      * @return Collection<int, RentalHistory>
  742.      */
  743.     public function getRentalHistories(): Collection
  744.     {
  745.         return $this->rentalHistories;
  746.     }
  747.     public function addRentalHistory(RentalHistory $rentalHistory): self
  748.     {
  749.         if (!$this->rentalHistories->contains($rentalHistory)) {
  750.             $this->rentalHistories->add($rentalHistory);
  751.             $rentalHistory->setTenant($this);
  752.         }
  753.         return $this;
  754.     }
  755.     public function removeRentalHistory(RentalHistory $rentalHistory): self
  756.     {
  757.         if ($this->rentalHistories->removeElement($rentalHistory)) {
  758.             // set the owning side to null (unless already changed)
  759.             if ($rentalHistory->getTenant() === $this) {
  760.                 $rentalHistory->setTenant(null);
  761.             }
  762.         }
  763.         return $this;
  764.     }
  765.     /**
  766.      * @return Collection<int, AgentCountryCovered>
  767.      */
  768.     public function getAgentCountryCovereds(): Collection
  769.     {
  770.         return $this->agentCountryCovereds;
  771.     }
  772.     public function addAgentCountryCovered(AgentCountryCovered $agentCountryCovered): self
  773.     {
  774.         if (!$this->agentCountryCovereds->contains($agentCountryCovered)) {
  775.             $this->agentCountryCovereds->add($agentCountryCovered);
  776.             $agentCountryCovered->setAgent($this);
  777.         }
  778.         return $this;
  779.     }
  780.     public function removeAgentCountryCovered(AgentCountryCovered $agentCountryCovered): self
  781.     {
  782.         if ($this->agentCountryCovereds->removeElement($agentCountryCovered)) {
  783.             // set the owning side to null (unless already changed)
  784.             if ($agentCountryCovered->getAgent() === $this) {
  785.                 $agentCountryCovered->setAgent(null);
  786.             }
  787.         }
  788.         return $this;
  789.     }
  790.     public function getManagedBy(): ?self
  791.     {
  792.         return $this->managedBy;
  793.     }
  794.     public function setManagedBy(?self $managedBy): self
  795.     {
  796.         $this->managedBy $managedBy;
  797.         return $this;
  798.     }
  799.     /**
  800.      * @return Collection<int, self>
  801.      */
  802.     public function getManaged(): Collection
  803.     {
  804.         return $this->managed;
  805.     }
  806.     public function addManaged(self $managed): self
  807.     {
  808.         if (!$this->managed->contains($managed)) {
  809.             $this->managed->add($managed);
  810.             $managed->setManagedBy($this);
  811.         }
  812.         return $this;
  813.     }
  814.     public function removeManaged(self $managed): self
  815.     {
  816.         if ($this->managed->removeElement($managed)) {
  817.             // set the owning side to null (unless already changed)
  818.             if ($managed->getManagedBy() === $this) {
  819.                 $managed->setManagedBy(null);
  820.             }
  821.         }
  822.         return $this;
  823.     }
  824.     public function getTeamWith(): ?self
  825.     {
  826.         return $this->teamWith;
  827.     }
  828.     public function setTeamWith(?self $teamWith): self
  829.     {
  830.         $this->teamWith $teamWith;
  831.         return $this;
  832.     }
  833.     /**
  834.      * @return Collection<int, self>
  835.      */
  836.     public function getTeamWithAgent(): Collection
  837.     {
  838.         return $this->teamWithAgent;
  839.     }
  840.     public function addTeamWithAgent(self $teamWithAgent): self
  841.     {
  842.         if (!$this->teamWithAgent->contains($teamWithAgent)) {
  843.             $this->teamWithAgent->add($teamWithAgent);
  844.             $teamWithAgent->setTeamWith($this);
  845.         }
  846.         return $this;
  847.     }
  848.     public function removeTeamWithAgent(self $teamWithAgent): self
  849.     {
  850.         if ($this->teamWithAgent->removeElement($teamWithAgent)) {
  851.             // set the owning side to null (unless already changed)
  852.             if ($teamWithAgent->getTeamWith() === $this) {
  853.                 $teamWithAgent->setTeamWith(null);
  854.             }
  855.         }
  856.         return $this;
  857.     }
  858.     /**
  859.      * @return Collection<int, Document>
  860.      */
  861.     public function getDocuments(): Collection
  862.     {
  863.         return $this->documents;
  864.     }
  865.     public function addDocument(Document $document): self
  866.     {
  867.         if (!$this->documents->contains($document)) {
  868.             $this->documents->add($document);
  869.             $document->setUser($this);
  870.         }
  871.         return $this;
  872.     }
  873.     public function removeDocument(Document $document): self
  874.     {
  875.         if ($this->documents->removeElement($document)) {
  876.             // set the owning side to null (unless already changed)
  877.             if ($document->getUser() === $this) {
  878.                 $document->setUser(null);
  879.             }
  880.         }
  881.         return $this;
  882.     }
  883.     /**
  884.      * @return Collection<int, BuildingReportingHistory>
  885.      */
  886.     public function getBuildingReportingHistoriesUser(): Collection
  887.     {
  888.         return $this->buildingReportingHistoriesUser;
  889.     }
  890.     public function addBuildingReportingHistory(BuildingReportingHistory $buildingReportingHistoriesUser): self
  891.     {
  892.         if (!$this->buildingReportingHistoriesUser->contains($buildingReportingHistoriesUser)) {
  893.             $this->buildingReportingHistoriesUser->add($buildingReportingHistoriesUser);
  894.             $buildingReportingHistoriesUser->setUser($this);
  895.         }
  896.         return $this;
  897.     }
  898.     public function removeBuildingReportingHistory(BuildingReportingHistory $buildingReportingHistoriesUser): self
  899.     {
  900.         if ($this->buildingReportingHistoriesUser->removeElement($buildingReportingHistoriesUser)) {
  901.             // set the owning side to null (unless already changed)
  902.             if ($buildingReportingHistoriesUser->getUser() === $this) {
  903.                 $buildingReportingHistoriesUser->setUser(null);
  904.             }
  905.         }
  906.         return $this;
  907.     }
  908.     /**
  909.      * @return Collection<int, RefusedVisa>
  910.      */
  911.     public function getRefusedVisas(): Collection
  912.     {
  913.         return $this->refusedVisas;
  914.     }
  915.     public function addRefusedVisa(RefusedVisa $refusedVisa): self
  916.     {
  917.         if (!$this->refusedVisas->contains($refusedVisa)) {
  918.             $this->refusedVisas->add($refusedVisa);
  919.             $refusedVisa->setUser($this);
  920.         }
  921.         return $this;
  922.     }
  923.     public function removeRefusedVisa(RefusedVisa $refusedVisa): self
  924.     {
  925.         if ($this->refusedVisas->removeElement($refusedVisa)) {
  926.             // set the owning side to null (unless already changed)
  927.             if ($refusedVisa->getUser() === $this) {
  928.                 $refusedVisa->setUser(null);
  929.             }
  930.         }
  931.         return $this;
  932.     }
  933.     /**
  934.      * @return Collection<int, HousingCertificate>
  935.      */
  936.     public function getHousingCertificates(): Collection
  937.     {
  938.         return $this->housingCertificates;
  939.     }
  940.     public function addHousingCertificate(HousingCertificate $housingCertificate): self
  941.     {
  942.         if (!$this->housingCertificates->contains($housingCertificate)) {
  943.             $this->housingCertificates->add($housingCertificate);
  944.             $housingCertificate->setUser($this);
  945.         }
  946.         return $this;
  947.     }
  948.     public function removeHousingCertificate(HousingCertificate $housingCertificate): self
  949.     {
  950.         if ($this->housingCertificates->removeElement($housingCertificate)) {
  951.             // set the owning side to null (unless already changed)
  952.             if ($housingCertificate->getUser() === $this) {
  953.                 $housingCertificate->setUser(null);
  954.             }
  955.         }
  956.         return $this;
  957.     }
  958.     /**
  959.      * @return Collection<int, BuildingFolder>
  960.      */
  961.     public function getBuildingFolders(): Collection
  962.     {
  963.         return $this->buildingFolders;
  964.     }
  965.     public function addBuildingFolder(BuildingFolder $buildingFolder): self
  966.     {
  967.         if (!$this->buildingFolders->contains($buildingFolder)) {
  968.             $this->buildingFolders->add($buildingFolder);
  969.             $buildingFolder->setTenant($this);
  970.         }
  971.         return $this;
  972.     }
  973.     public function removeBuildingFolder(BuildingFolder $buildingFolder): self
  974.     {
  975.         if ($this->buildingFolders->removeElement($buildingFolder)) {
  976.             // set the owning side to null (unless already changed)
  977.             if ($buildingFolder->getTenant() === $this) {
  978.                 $buildingFolder->setTenant(null);
  979.             }
  980.         }
  981.         return $this;
  982.     }
  983.     /**
  984.      * @return Collection<int, Residence>
  985.      */
  986.     public function getResidences(): Collection
  987.     {
  988.         return $this->residences;
  989.     }
  990.     public function addResidence(Residence $residence): self
  991.     {
  992.         if (!$this->residences->contains($residence)) {
  993.             $this->residences->add($residence);
  994.             $residence->setAdministrator($this);
  995.         }
  996.         return $this;
  997.     }
  998.     public function removeResidence(Residence $residence): self
  999.     {
  1000.         if ($this->residences->removeElement($residence)) {
  1001.             // set the owning side to null (unless already changed)
  1002.             if ($residence->getAdministrator() === $this) {
  1003.                 $residence->setAdministrator(null);
  1004.             }
  1005.         }
  1006.         return $this;
  1007.     }
  1008.     public function getNameLegal(): ?string
  1009.     {
  1010.         return $this->nameLegal;
  1011.     }
  1012.     public function setNameLegal(?string $nameLegal): self
  1013.     {
  1014.         $this->nameLegal $nameLegal;
  1015.         return $this;
  1016.     }
  1017.     public function getFirstNameLegal(): ?string
  1018.     {
  1019.         return $this->firstNameLegal;
  1020.     }
  1021.     public function setFirstNameLegal(?string $firstNameLegal): self
  1022.     {
  1023.         $this->firstNameLegal $firstNameLegal;
  1024.         return $this;
  1025.     }
  1026.     public function getPhoneLegal(): ?string
  1027.     {
  1028.         return $this->phoneLegal;
  1029.     }
  1030.     public function setPhoneLegal(?string $phoneLegal): self
  1031.     {
  1032.         $this->phoneLegal $phoneLegal;
  1033.         return $this;
  1034.     }
  1035.     public function getEmailLegal(): ?string
  1036.     {
  1037.         return $this->emailLegal;
  1038.     }
  1039.     public function setEmailLegal(?string $emailLegal): self
  1040.     {
  1041.         $this->emailLegal $emailLegal;
  1042.         return $this;
  1043.     }
  1044.     public function getActivity(): ?string
  1045.     {
  1046.         return $this->activity;
  1047.     }
  1048.     public function setActivity(?string $activity): self
  1049.     {
  1050.         $this->activity $activity;
  1051.         return $this;
  1052.     }
  1053.     /**
  1054.      * @return Collection<int, WantedVisio>
  1055.      */
  1056.     public function getWantedVisios(): Collection
  1057.     {
  1058.         return $this->wantedVisios;
  1059.     }
  1060.     public function addWantedVisio(WantedVisio $wantedVisio): self
  1061.     {
  1062.         if (!$this->wantedVisios->contains($wantedVisio)) {
  1063.             $this->wantedVisios->add($wantedVisio);
  1064.             $wantedVisio->setRequester($this);
  1065.         }
  1066.         return $this;
  1067.     }
  1068.     public function removeWantedVisio(WantedVisio $wantedVisio): self
  1069.     {
  1070.         if ($this->wantedVisios->removeElement($wantedVisio)) {
  1071.             // set the owning side to null (unless already changed)
  1072.             if ($wantedVisio->getRequester() === $this) {
  1073.                 $wantedVisio->setRequester(null);
  1074.             }
  1075.         }
  1076.         return $this;
  1077.     }
  1078.     /**
  1079.      * @return Collection<int, LikedBuilding>
  1080.      */
  1081.     public function getLikedBuildings(): Collection
  1082.     {
  1083.         return $this->likedBuildings;
  1084.     }
  1085.     public function addLikedBuilding(LikedBuilding $likedBuilding): self
  1086.     {
  1087.         if (!$this->likedBuildings->contains($likedBuilding)) {
  1088.             $this->likedBuildings->add($likedBuilding);
  1089.             $likedBuilding->setUser($this);
  1090.         }
  1091.         return $this;
  1092.     }
  1093.     public function removeLikedBuilding(LikedBuilding $likedBuilding): self
  1094.     {
  1095.         if ($this->likedBuildings->removeElement($likedBuilding)) {
  1096.             // set the owning side to null (unless already changed)
  1097.             if ($likedBuilding->getUser() === $this) {
  1098.                 $likedBuilding->setUser(null);
  1099.             }
  1100.         }
  1101.         return $this;
  1102.     }
  1103.     public function getPackAttestation(): ?int
  1104.     {
  1105.         return $this->packAttestation;
  1106.     }
  1107.     public function setPackAttestation(int $packAttestation): static
  1108.     {
  1109.         $this->packAttestation $packAttestation;
  1110.         return $this;
  1111.     }
  1112.     public function getAgentEnderControl(): ?string
  1113.     {
  1114.         return $this->agentEnderControl;
  1115.     }
  1116.     public function setAgentEnderControl(?string $agentEnderControl): static
  1117.     {
  1118.         $this->agentEnderControl $agentEnderControl;
  1119.         return $this;
  1120.     }
  1121.     public function getConsulatCountry(): ?string
  1122.     {
  1123.         return $this->consulatCountry;
  1124.     }
  1125.     public function setConsulatCountry(?string $consulatCountry): static
  1126.     {
  1127.         $this->consulatCountry $consulatCountry;
  1128.         return $this;
  1129.     }
  1130.     public function getStepProfil(): ?int
  1131.     {
  1132.         return $this->stepProfil;
  1133.     }
  1134.     public function setStepProfil(int $stepProfil): static
  1135.     {
  1136.         $this->stepProfil $stepProfil;
  1137.         return $this;
  1138.     }
  1139.     public function getDateStartAt(): ?\DateTimeInterface
  1140.     {
  1141.         return $this->dateStartAt;
  1142.     }
  1143.     public function setDateStartAt(?\DateTimeInterface $dateStartAt): self
  1144.     {
  1145.         $this->dateStartAt $dateStartAt;
  1146.         return $this;
  1147.     }
  1148.     public function getRentalDuration(): ?int
  1149.     {
  1150.         return $this->rentalDuration;
  1151.     }
  1152.     public function setRentalDuration(int $rentalDuration): static
  1153.     {
  1154.         $this->rentalDuration $rentalDuration;
  1155.         return $this;
  1156.     }
  1157.     public function getStatus(): ?string
  1158.     {
  1159.         return $this->status;
  1160.     }
  1161.     public function setStatus(?string $status): static
  1162.     {
  1163.         $this->status $status;
  1164.         return $this;
  1165.     }
  1166.     public function getFormationName(): ?string
  1167.     {
  1168.         return $this->formationName;
  1169.     }
  1170.     public function setFormationName(?string $formationName): static
  1171.     {
  1172.         $this->formationName $formationName;
  1173.         return $this;
  1174.     }
  1175.     public function getSchoolName(): ?string
  1176.     {
  1177.         return $this->schoolName;
  1178.     }
  1179.     public function setSchoolName(?string $schoolName): static
  1180.     {
  1181.         $this->schoolName $schoolName;
  1182.         return $this;
  1183.     }
  1184.     public function getSchoolAddress(): ?string
  1185.     {
  1186.         return $this->schoolAddress;
  1187.     }
  1188.     public function setSchoolAddress(?string $schoolAddress): static
  1189.     {
  1190.         $this->schoolAddress $schoolAddress;
  1191.         return $this;
  1192.     }
  1193.     public function getStudylevel(): ?string
  1194.     {
  1195.         return $this->studyLevel;
  1196.     }
  1197.     public function setStudylevel(?string $studyLevel): static
  1198.     {
  1199.         $this->studyLevel $studyLevel;
  1200.         return $this;
  1201.     }
  1202.     public function getCompany(): ?string
  1203.     {
  1204.         return $this->company;
  1205.     }
  1206.     public function setCompany(?string $company): static
  1207.     {
  1208.         $this->company $company;
  1209.         return $this;
  1210.     }
  1211.     public function getEmployementContract(): ?string
  1212.     {
  1213.         return $this->employementContract;
  1214.     }
  1215.     public function setEmployementContract(?string $employementContract): static
  1216.     {
  1217.         $this->employementContract $employementContract;
  1218.         return $this;
  1219.     }
  1220.     public function getTrialPeriod(): ?string
  1221.     {
  1222.         return $this->trialPeriod;
  1223.     }
  1224.     public function setTrialPeriod(?string $trialPeriod): static
  1225.     {
  1226.         $this->trialPeriod $trialPeriod;
  1227.         return $this;
  1228.     }
  1229.     public function getNetMonthlySalary(): ?int
  1230.     {
  1231.         return $this->netMonthlySalary;
  1232.     }
  1233.     public function setNetMonthlySalary(?int $netMonthlySalary): static
  1234.     {
  1235.         $this->netMonthlySalary $netMonthlySalary;
  1236.         return $this;
  1237.     }
  1238.     public function getGuarantorType(): ?string
  1239.     {
  1240.         return $this->guarantorType;
  1241.     }
  1242.     public function setGuarantorType(?string $guarantorType): static
  1243.     {
  1244.         $this->guarantorType $guarantorType;
  1245.         return $this;
  1246.     }
  1247.     public function getPhysicalGuarantorType(): ?string
  1248.     {
  1249.         return $this->physicalGuarantorType;
  1250.     }
  1251.     public function setPhysicalGuarantorType(?string $physicalGuarantorType): static
  1252.     {
  1253.         $this->physicalGuarantorType $physicalGuarantorType;
  1254.         return $this;
  1255.     }
  1256.     public function getStatutResidencePrincipale(): ?string
  1257.     {
  1258.         return $this->statutResidencePrincipale;
  1259.     }
  1260.     public function setStatutResidencePrincipale(?string $statutResidencePrincipale): static
  1261.     {
  1262.         $this->statutResidencePrincipale $statutResidencePrincipale;
  1263.         return $this;
  1264.     }
  1265.     public function getMensualRent(): ?int
  1266.     {
  1267.         return $this->mensualRent;
  1268.     }
  1269.     public function setMensualRent(?int $mensualRent): static
  1270.     {
  1271.         $this->mensualRent $mensualRent;
  1272.         return $this;
  1273.     }
  1274.     public function getContractType(): ?string
  1275.     {
  1276.         return $this->contractType;
  1277.     }
  1278.     public function setContractType(?string $contractType): static
  1279.     {
  1280.         $this->contractType $contractType;
  1281.         return $this;
  1282.     }
  1283.     public function getFinishedTrialPeriod(): ?string
  1284.     {
  1285.         return $this->finishedTrialPeriod;
  1286.     }
  1287.     public function setFinishedTrialPeriod(?string $finishedTrialPeriod): static
  1288.     {
  1289.         $this->finishedTrialPeriod $finishedTrialPeriod;
  1290.         return $this;
  1291.     }
  1292.     public function getIncome(): ?string
  1293.     {
  1294.         return $this->income;
  1295.     }
  1296.     public function setIncome(?string $income): static
  1297.     {
  1298.         $this->income $income;
  1299.         return $this;
  1300.     }
  1301.     public function getAdditionalIncomeSources(): ?string
  1302.     {
  1303.         return $this->additionalIncomeSources;
  1304.     }
  1305.     public function setAdditionalIncomeSources(?string $additionalIncomeSources): static
  1306.     {
  1307.         $this->additionalIncomeSources $additionalIncomeSources;
  1308.         return $this;
  1309.     }
  1310.     public function getAdditionalIncomeSourcesStudent(): ?string
  1311.     {
  1312.         return $this->additionalIncomeSourcesStudent;
  1313.     }
  1314.     public function setAdditionalIncomeSourcesStudent(?string $additionalIncomeSourcesStudent): static
  1315.     {
  1316.         $this->additionalIncomeSourcesStudent $additionalIncomeSourcesStudent;
  1317.         return $this;
  1318.     }
  1319.     public function getGuarantorStatus(): ?string
  1320.     {
  1321.         return $this->guarantorStatus;
  1322.     }
  1323.     public function setGuarantorStatus(?string $guarantorStatus): static
  1324.     {
  1325.         $this->guarantorStatus $guarantorStatus;
  1326.         return $this;
  1327.     }
  1328.     public function getProfessionalGuarantee(): ?string
  1329.     {
  1330.         return $this->professionalGuarantee;
  1331.     }
  1332.     public function setProfessionalGuarantee(?string $professionalGuarantee): static
  1333.     {
  1334.         $this->professionalGuarantee $professionalGuarantee;
  1335.         return $this;
  1336.     }
  1337.     public function getPhysicalGuarantorNationality(): ?string
  1338.     {
  1339.         return $this->physicalGuarantorNationality;
  1340.     }
  1341.     public function setPhysicalGuarantorNationality(?string $physicalGuarantorNationality): static
  1342.     {
  1343.         $this->physicalGuarantorNationality $physicalGuarantorNationality;
  1344.         return $this;
  1345.     }
  1346.     public function getApplicationMessage(): ?string
  1347.     {
  1348.         return $this->applicationMessage;
  1349.     }
  1350.     public function setApplicationMessage(?string $applicationMessage): static
  1351.     {
  1352.         $this->applicationMessage $applicationMessage;
  1353.         return $this;
  1354.     }
  1355.     
  1356.     public function getSendSMS(): ?\DateTimeInterface
  1357.     {
  1358.         return $this->sendSMS;
  1359.     }
  1360.     public function setSendSMS(?\DateTimeInterface $sendSMS): self
  1361.     {
  1362.         $this->sendSMS $sendSMS;
  1363.         return $this;
  1364.     }
  1365.     public function getSortedHistoryUsers(): Collection
  1366.     {
  1367.         // Convert the Collection to an array for sorting
  1368.         $historyUsersArray $this->historyUsers->toArray();
  1369.         // Sort by date in descending order
  1370.         usort($historyUsersArray, function ($a$b) {
  1371.             return $b->getId()<=> $a->getId(); // Latest dates first
  1372.         });
  1373.         // Limit to the last 5 records
  1374.         $historyUsersArray array_slice($historyUsersArray05);
  1375.         // Return a new ArrayCollection with the sorted and limited results
  1376.         return new ArrayCollection($historyUsersArray);
  1377.     }
  1378.     public function getAllSortedHistoryUsers(): Collection
  1379.     {
  1380.         // Convert the Collection to an array for sorting
  1381.         $historyUsersArray $this->historyUsers->toArray();
  1382.         // Sort by date in descending order
  1383.         usort($historyUsersArray, function ($a$b) {
  1384.             return $b->getId() <=> $a->getId(); // Latest dates first
  1385.         });
  1386.         // Return a new ArrayCollection with the sorted and limited results
  1387.         return new ArrayCollection($historyUsersArray);
  1388.     }
  1389.     /**
  1390.      * @return Collection<int, HistoryUser>
  1391.      */
  1392.     public function getHistoryUsers(): Collection
  1393.     {
  1394.         return $this->historyUsers;
  1395.     }
  1396.     public function addHistoryUser(HistoryUser $historyUser): static
  1397.     {
  1398.         if (!$this->historyUsers->contains($historyUser)) {
  1399.             $this->historyUsers->add($historyUser);
  1400.             $historyUser->setUserId($this);
  1401.         }
  1402.         return $this;
  1403.     }
  1404.     public function removeHistoryUser(HistoryUser $historyUser): static
  1405.     {
  1406.         if ($this->historyUsers->removeElement($historyUser)) {
  1407.             // set the owning side to null (unless already changed)
  1408.             if ($historyUser->getUserId() === $this) {
  1409.                 $historyUser->setUserId(null);
  1410.             }
  1411.         }
  1412.         return $this;
  1413.     }
  1414. }