src/Entity/User.php line 20
<?phpnamespace App\Entity;use App\Repository\UserRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;use Symfony\Component\Security\Core\User\UserInterface;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: UserRepository::class)]#[ORM\Table(name: '`user`')]#[UniqueEntity(fields: ['email'], message: 'Cette adresse email est déjà utilisée.')]#[UniqueEntity(fields: ['phone'], message: 'Ce numéro de téléphone est déjà utilisé.')]class User implements UserInterface, PasswordAuthenticatedUserInterface{CONST GOD_ADMIN = "ROLE_GOD_ADMIN";CONST ADMIN = "ROLE_ADMIN";CONST COMPTABLE = "ROLE_COMPTABLE";CONST TENANT = "ROLE_TENANT";CONST SUPER_AGENT ="ROLE_SUPER_AGENT";CONST LESSOR = "ROLE_LESSOR";CONST AGENT = "ROLE_AGENT";CONST CONSULAT = "ROLE_CONSULAT";CONST RESIDENT = "ROLE_LESSOR_RESIDENT";#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 180, unique: true)]private ?string $email = null;#[ORM\Column]private array $roles = [];/*** @var string The hashed password*/#[ORM\Column]private ?string $password = "0";protected $beforeRole;#[ORM\Column(length: 255, nullable: true)]private ?string $fullName = null;#[ORM\Column(length: 255, nullable: true)]private ?string $phone = null;#[ORM\Column]private ?bool $isActive = true;#[ORM\Column(length: 255, nullable: true)]private ?string $firstName = null;#[ORM\Column(length: 255, nullable: true)]private ?string $lastName = null;#[ORM\Column(length: 255, nullable: true)]private ?string $country = null;#[ORM\Column(length: 255, nullable: true)]private ?string $city = null;#[ORM\Column(length: 255, nullable: true)]private ?string $lessorType = null;#[ORM\Column]private ?bool $registrationFinalized = false;#[ORM\Column(length: 255, nullable: true)]private ?string $nationality = null;#[ORM\Column(length: 255, nullable: true)]private ?string $agentType = null;#[ORM\Column(length: 255, nullable: true)]private ?string $representativeName = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $signAt = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $editedAt = null;#[ORM\OneToMany(mappedBy: 'propertyManager', targetEntity: Building::class)]private Collection $buildings;#[ORM\Column(length: 255, nullable: true)]private ?string $customerType = null;#[ORM\Column(length: 255, nullable: true)]private ?string $headOffice = null;#[ORM\Column(length: 255, nullable: true)]private ?string $numberTva = null;#[ORM\Column(length: 255, nullable: true)]private ?string $companyType = null;#[ORM\Column(length: 255, nullable: true)]private ?string $street = null;#[ORM\Column(length: 255, nullable: true)]private ?string $streetNumber = null;#[ORM\OneToMany(mappedBy: 'tenant', targetEntity: Building::class)]private Collection $tenantBuildings;#[ORM\Column(length: 255, nullable: true)]private ?string $adress2 = null;#[ORM\Column(length: 255, nullable: true)]private ?string $adress1 = null;#[ORM\Column(length: 255, nullable: true)]private ?string $lastPostalCode = null;#[ORM\Column(length: 255, nullable: true)]private ?string $lastCity = null;#[ORM\Column(length: 255, nullable: true)]private ?string $lastCountry = null;#[ORM\Column(length: 255, nullable: true)]private ?string $visaType = null;#[ORM\Column(length: 255, nullable: true)]private ?string $postalCode = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $birthDate = null;#[ORM\Column(length: 255, nullable: true)]private ?string $civility = null;#[ORM\OneToMany(mappedBy: 'tenant', targetEntity: RentalHistory::class)]private Collection $rentalHistories;#[ORM\OneToMany(mappedBy: 'agent', targetEntity: AgentCountryCovered::class, cascade: ['persist', 'remove'])]private Collection $agentCountryCovereds;#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'managed')]private ?self $managedBy = null;#[ORM\OneToMany(mappedBy: 'managedBy', targetEntity: self::class)]private Collection $managed;#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'teamWithAgent')]private ?self $teamWith;#[ORM\OneToMany(mappedBy: 'teamWith', targetEntity: self::class)]private Collection $teamWithAgent;#[ORM\OneToMany(mappedBy: 'user', targetEntity: Document::class,cascade: ['persist', 'remove'])]private Collection $documents;#[ORM\OneToMany(mappedBy: 'user', targetEntity: BuildingReportingHistory::class)]private Collection $buildingReportingHistoriesUser;#[ORM\OneToMany(mappedBy: 'user', targetEntity: RefusedVisa::class)]private Collection $refusedVisas;#[ORM\OneToMany(mappedBy: 'user', targetEntity: HousingCertificate::class)]private Collection $housingCertificates;#[ORM\OneToMany(mappedBy: 'tenant', targetEntity: BuildingFolder::class)]private Collection $buildingFolders;#[ORM\OneToMany(mappedBy: 'administrator', targetEntity: Residence::class)]private Collection $residences;#[ORM\Column(length: 255, nullable: true)]private ?string $nameLegal = null;#[ORM\Column(length: 255, nullable: true)]private ?string $firstNameLegal = null;#[ORM\Column(length: 255, nullable: true)]private ?string $phoneLegal = null;#[ORM\Column(length: 255, nullable: true)]private ?string $emailLegal = null;#[ORM\Column(length: 255, nullable: true)]private ?string $activity = null;#[ORM\OneToMany(mappedBy: 'requester', targetEntity: WantedVisio::class)]private Collection $wantedVisios;#[ORM\OneToMany(mappedBy: 'user', targetEntity: LikedBuilding::class)]private Collection $likedBuildings;#[ORM\Column]private ?bool $firstLease = true;#[ORM\Column]private ?bool $commercialMail =false;#[ORM\Column(nullable: true)]private ?int $packAttestation = null;#[ORM\Column(length: 255, nullable: true)]private ?string $agentEnderControl =null;#[ORM\Column(length: 255, nullable: true)]private ?string $consulatCountry = null;#[ORM\Column(nullable: true)]private ?int $stepProfil = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $dateStartAt = null;#[ORM\Column(nullable: true)]private ?int $rentalDuration = null;#[ORM\Column(length: 255, nullable: true)]private ?string $status = null;#[ORM\Column(length: 255, nullable: true)]private ?string $formationName = null;#[ORM\Column(length: 255, nullable: true)]private ?string $schoolName = null;#[ORM\Column(length: 255, nullable: true)]private ?string $schoolAddress = null;#[ORM\Column(length: 255, nullable: true)]private ?string $studyLevel = null;#[ORM\Column(length: 255, nullable: true)]private ?string $company = null;#[ORM\Column(length: 255, nullable: true)]private ?string $employementContract = null;#[ORM\Column(length: 255, nullable: true)]private ?string $trialPeriod = null;#[ORM\Column(nullable: true)]private ?int $netMonthlySalary = null;#[ORM\Column(length: 255, nullable: true)]private ?string $guarantorType = null;#[ORM\Column(length: 255, nullable: true)]private ?string $physicalGuarantorType = null;#[ORM\Column(length: 255, nullable: true)]private ?string $statutResidencePrincipale = null;#[ORM\Column(nullable: true)]private ?int $mensualRent = null;#[ORM\Column(length: 255, nullable: true)]private ?string $contractType = null;#[ORM\Column(length: 255, nullable: true)]private ?string $finishedTrialPeriod = null;#[ORM\Column(nullable: true)]private ?string $income = null;#[ORM\Column(length: 255, nullable: true)]private ?string $additionalIncomeSources = null;#[ORM\Column(length: 255, nullable: true)]private ?string $additionalIncomeSourcesStudent = null;#[ORM\Column(length: 255, nullable: true)]private ?string $guarantorStatus = null;#[ORM\Column(length: 255, nullable: true)]private ?string $professionalGuarantee = null;#[ORM\Column(length: 255, nullable: true)]private ?string $physicalGuarantorNationality = null;#[ORM\Column(length: 255, nullable: true)]private ?string $applicationMessage = null;#[ORM\Column(type: 'string', length: 255, nullable: true)]private ?string $localAgreementNumber = null;#[ORM\Column(name: 'company_address', type: 'string', length: 255, nullable: true)]private ?string $companyAddress = null;#[ORM\Column(name: 'representative_title', type: 'string', length: 255, nullable: true)]private ?string $representativeTitle = null;#[ORM\Column(name: 'representative_first_name', type: 'string', length: 255, nullable: true)]private ?string $representativeFirstName = null;#[ORM\OneToMany(mappedBy: 'userId', targetEntity: HistoryUser::class)]private Collection $historyUsers;#[ORM\OneToMany(mappedBy: 'user', targetEntity: Invoice::class, cascade: ['persist', 'remove'])]private Collection $invoices;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $sendSMS = null;private ?string $validationCodeEmail = null;private ?string $validationCodePhone = null;public function getValidationCodeEmail(): ?string{return $this->validationCodeEmail;}public function setValidationCodeEmail(?string $validationCodeEmail): self{$this->validationCodeEmail = $validationCodeEmail;return $this;}public function getValidationCodePhone(): ?string{return $this->validationCodePhone;}public function setValidationCodePhone(?string $validationCodePhone): self{$this->validationCodePhone = $validationCodePhone;return $this;}public function __construct(){$this->signAt = new \DateTimeImmutable('now', new \DateTimeZone('Europe/Paris'));$this->editedAt = new \DateTime('now', new \DateTimeZone('Europe/Paris'));$this->buildings = new ArrayCollection();$this->tenantBuildings = new ArrayCollection();$this->rentalHistories = new ArrayCollection();$this->agentCountryCovereds = new ArrayCollection();$this->managed = new ArrayCollection();$this->teamWithAgent = new ArrayCollection();$this->documents = new ArrayCollection();$this->buildingReportingHistoriesUser = new ArrayCollection();$this->refusedVisas = new ArrayCollection();$this->housingCertificates = new ArrayCollection();$this->buildingFolders = new ArrayCollection();$this->residences = new ArrayCollection();$this->wantedVisios = new ArrayCollection();$this->likedBuildings = new ArrayCollection();$this->invoices = new ArrayCollection();$this->setFirstLease(true);}public function getLocalAgreementNumber(): ?string{return $this->localAgreementNumber;}public function setLocalAgreementNumber(?string $localAgreementNumber): self{$this->localAgreementNumber = $localAgreementNumber;return $this;}public function getRepresentativeFirstName(): ?string{return $this->representativeFirstName;}public function setRepresentativeFirstName(?string $representativeFirstName): self{$this->representativeFirstName = $representativeFirstName;return $this;}public function getCompanyAddress(): ?string{return $this->companyAddress;}public function setCompanyAddress(?string $companyAddress): self{$this->companyAddress = $companyAddress;return $this;}public function getRepresentativeTitle(): ?string{return $this->representativeTitle;}public function setRepresentativeTitle(?string $representativeTitle): self{$this->representativeTitle = $representativeTitle;return $this;}public function __toString(): string{return $this->getLastName() . " " . $this->getFirstName();}public function getId(): ?int{return $this->id;}public function getCommercialMail(): ?bool{return $this->commercialMail;}public function setCommercialMail(bool $commercialMail): self{$this->commercialMail = $commercialMail;return $this;}public function getFirstLease(): ?bool{return $this->firstLease;}public function setFirstLease(bool $firstLease): self{$this->firstLease = $firstLease;return $this;}public function getEmail(): ?string{return $this->email;}public function setEmail(string $email): self{$this->email = $email;return $this;}/*** A visual identifier that represents this user.** @see UserInterface*/public function getUserIdentifier(): string{return (string) $this->email;}/*** @see UserInterface*/public function getRoles(): array{$roles = $this->roles;// guarantee every user at least has ROLE_USER$roles[] = 'ROLE_USER';return array_unique($roles);}public function setRoles(array $roles): self{$this->roles = $roles;return $this;}public function asRole(string $role): bool{if (in_array($role, $this->getRoles(), true)) {return true;} else {return false;}}/*** @see PasswordAuthenticatedUserInterface*/public function getPassword(): string{return $this->password;}public function setPassword(string $password): self{$this->password = $password;return $this;}/*** @see UserInterface*/public function eraseCredentials(){// If you store any temporary, sensitive data on the user, clear it here// $this->plainPassword = null;}/*** @return mixed*/public function getBeforeRole(){return $this->beforeRole;}/*** @param mixed $beforeRole*/public function setBeforeRole($beforeRole): void{$this->beforeRole = $beforeRole;}public function getFullName(): ?string{return $this->fullName;}public function setFullName(?string $fullName): self{$this->fullName = $fullName;return $this;}public function getPhone(): ?string{return $this->phone;}public function setPhone(?string $phone): self{$this->phone = $phone;return $this;}public function isIsActive(): ?bool{return $this->isActive;}public function setIsActive(bool $isActive): self{$this->isActive = $isActive;return $this;}public function getFirstName(): ?string{return $this->firstName;}public function setFirstName(?string $firstName): self{$this->firstName = $firstName;return $this;}public function getLastName(): ?string{return $this->lastName;}public function setLastName(?string $lastName): self{$this->lastName = $lastName;return $this;}public function getCountry(): ?string{return $this->country;}public function setCountry(?string $country): self{$this->country = $country;return $this;}public function getCity(): ?string{return $this->city;}public function setCity(?string $city): self{$this->city = $city;return $this;}public function getLessorType(): ?string{return $this->lessorType;}public function setLessorType(?string $lessorType): self{$this->lessorType = $lessorType;return $this;}public function isRegistrationFinalized(): ?bool{return $this->registrationFinalized;}public function setRegistrationFinalized(bool $registrationFinalized): self{$this->registrationFinalized = $registrationFinalized;return $this;}public function getNationality(): ?string{return $this->nationality;}public function setNationality(?string $nationality): self{$this->nationality = $nationality;return $this;}public function getAgentType(): ?string{return $this->agentType;}public function setAgentType(?string $agentType): self{$this->agentType = $agentType;return $this;}public function getRepresentativeName(): ?string{return $this->representativeName;}public function setRepresentativeName(?string $representativeName): self{$this->representativeName = $representativeName;return $this;}public function getSignAt(): ?\DateTimeInterface{return $this->signAt;}public function setSignAt(?\DateTimeInterface $signAt): self{$this->signAt = $signAt;return $this;}public function getEditedAt(): ?\DateTimeInterface{return $this->editedAt;}public function setEditedAt(\DateTimeInterface $editedAt): self{$this->editedAt = $editedAt;return $this;}/*** @return Collection<int, Building>*/public function getBuildings(): Collection{return $this->buildings;}public function addBuilding(Building $building): self{if (!$this->buildings->contains($building)) {$this->buildings->add($building);$building->setPropertyManager($this);}return $this;}public function removeBuilding(Building $building): self{if ($this->buildings->removeElement($building)) {// set the owning side to null (unless already changed)if ($building->getPropertyManager() === $this) {$building->setPropertyManager(null);}}return $this;}public function getCustomerType(): ?string{return $this->customerType;}public function setCustomerType(?string $customerType): self{$this->customerType = $customerType;return $this;}public function getHeadOffice(): ?string{return $this->headOffice;}public function setHeadOffice(string $headOffice): self{$this->headOffice = $headOffice;return $this;}public function getNumberTva(): ?string{return $this->numberTva;}public function setNumberTva(?string $numberTva): self{$this->numberTva = $numberTva;return $this;}public function getCompanyType(): ?string{return $this->companyType;}public function setCompanyType(?string $companyType): self{$this->companyType = $companyType;return $this;}public function getStreet(): ?string{return $this->street;}public function setStreet(?string $street): self{$this->street = $street;return $this;}public function getStreetNumber(): ?string{return $this->streetNumber;}public function setStreetNumber(?string $streetNumber): self{$this->streetNumber = $streetNumber;return $this;}/*** @return Collection<int, Building>*/public function getTenantBuildings(): Collection{return $this->tenantBuildings;}public function addTenantBuilding(Building $tenantBuilding): self{if (!$this->tenantBuildings->contains($tenantBuilding)) {$this->tenantBuildings->add($tenantBuilding);$tenantBuilding->setTenant($this);}return $this;}public function removeTenantBuilding(Building $tenantBuilding): self{if ($this->tenantBuildings->removeElement($tenantBuilding)) {// set the owning side to null (unless already changed)if ($tenantBuilding->getTenant() === $this) {$tenantBuilding->setTenant(null);}}return $this;}public function getAdress2(): ?string{return $this->adress2;}public function setAdress2(?string $adress2): self{$this->adress2 = $adress2;return $this;}public function getAdress1(): ?string{return $this->adress1;}public function setAdress1(?string $adress1): self{$this->adress1 = $adress1;return $this;}public function getLastPostalCode(): ?string{return $this->lastPostalCode;}public function setLastPostalCode(?string $lastPostalCode): self{$this->lastPostalCode = $lastPostalCode;return $this;}public function getLastCity(): ?string{return $this->lastCity;}public function setLastCity(?string $lastCity): self{$this->lastCity = $lastCity;return $this;}public function getLastCountry(): ?string{return $this->lastCountry;}public function setLastCountry(?string $lastCountry): self{$this->lastCountry = $lastCountry;return $this;}public function getVisaType(): ?string{return $this->visaType;}public function setVisaType(?string $visaType): self{$this->visaType = $visaType;return $this;}public function getPostalCode(): ?string{return $this->postalCode;}public function setPostalCode(?string $postalCode): self{$this->postalCode = $postalCode;return $this;}public function getBirthDate(): ?\DateTimeInterface{return $this->birthDate;}public function setBirthDate(?\DateTimeInterface $birthDate): self{$this->birthDate = $birthDate;return $this;}public function getCivility(): ?string{return $this->civility;}public function setCivility(?string $civility): self{$this->civility = $civility;return $this;}/*** @return Collection|Invoice[]*/public function getInvoices(): Collection{return $this->invoices;}public function addInvoice(Invoice $invoice): self{if (!$this->invoices->contains($invoice)) {$this->invoices->add($invoice);$invoice->setUser($this);}return $this;}public function removeInvoice(Invoice $invoice): self{if ($this->invoices->removeElement($invoice)) {// set the owning side to null (unless already changed)if ($invoice->getUser() === $this) {$invoice->setUser(null);}}return $this;}/*** @return Collection<int, RentalHistory>*/public function getRentalHistories(): Collection{return $this->rentalHistories;}public function addRentalHistory(RentalHistory $rentalHistory): self{if (!$this->rentalHistories->contains($rentalHistory)) {$this->rentalHistories->add($rentalHistory);$rentalHistory->setTenant($this);}return $this;}public function removeRentalHistory(RentalHistory $rentalHistory): self{if ($this->rentalHistories->removeElement($rentalHistory)) {// set the owning side to null (unless already changed)if ($rentalHistory->getTenant() === $this) {$rentalHistory->setTenant(null);}}return $this;}/*** @return Collection<int, AgentCountryCovered>*/public function getAgentCountryCovereds(): Collection{return $this->agentCountryCovereds;}public function addAgentCountryCovered(AgentCountryCovered $agentCountryCovered): self{if (!$this->agentCountryCovereds->contains($agentCountryCovered)) {$this->agentCountryCovereds->add($agentCountryCovered);$agentCountryCovered->setAgent($this);}return $this;}public function removeAgentCountryCovered(AgentCountryCovered $agentCountryCovered): self{if ($this->agentCountryCovereds->removeElement($agentCountryCovered)) {// set the owning side to null (unless already changed)if ($agentCountryCovered->getAgent() === $this) {$agentCountryCovered->setAgent(null);}}return $this;}public function getManagedBy(): ?self{return $this->managedBy;}public function setManagedBy(?self $managedBy): self{$this->managedBy = $managedBy;return $this;}/*** @return Collection<int, self>*/public function getManaged(): Collection{return $this->managed;}public function addManaged(self $managed): self{if (!$this->managed->contains($managed)) {$this->managed->add($managed);$managed->setManagedBy($this);}return $this;}public function removeManaged(self $managed): self{if ($this->managed->removeElement($managed)) {// set the owning side to null (unless already changed)if ($managed->getManagedBy() === $this) {$managed->setManagedBy(null);}}return $this;}public function getTeamWith(): ?self{return $this->teamWith;}public function setTeamWith(?self $teamWith): self{$this->teamWith = $teamWith;return $this;}/*** @return Collection<int, self>*/public function getTeamWithAgent(): Collection{return $this->teamWithAgent;}public function addTeamWithAgent(self $teamWithAgent): self{if (!$this->teamWithAgent->contains($teamWithAgent)) {$this->teamWithAgent->add($teamWithAgent);$teamWithAgent->setTeamWith($this);}return $this;}public function removeTeamWithAgent(self $teamWithAgent): self{if ($this->teamWithAgent->removeElement($teamWithAgent)) {// set the owning side to null (unless already changed)if ($teamWithAgent->getTeamWith() === $this) {$teamWithAgent->setTeamWith(null);}}return $this;}/*** @return Collection<int, Document>*/public function getDocuments(): Collection{return $this->documents;}public function addDocument(Document $document): self{if (!$this->documents->contains($document)) {$this->documents->add($document);$document->setUser($this);}return $this;}public function removeDocument(Document $document): self{if ($this->documents->removeElement($document)) {// set the owning side to null (unless already changed)if ($document->getUser() === $this) {$document->setUser(null);}}return $this;}/*** @return Collection<int, BuildingReportingHistory>*/public function getBuildingReportingHistoriesUser(): Collection{return $this->buildingReportingHistoriesUser;}public function addBuildingReportingHistory(BuildingReportingHistory $buildingReportingHistoriesUser): self{if (!$this->buildingReportingHistoriesUser->contains($buildingReportingHistoriesUser)) {$this->buildingReportingHistoriesUser->add($buildingReportingHistoriesUser);$buildingReportingHistoriesUser->setUser($this);}return $this;}public function removeBuildingReportingHistory(BuildingReportingHistory $buildingReportingHistoriesUser): self{if ($this->buildingReportingHistoriesUser->removeElement($buildingReportingHistoriesUser)) {// set the owning side to null (unless already changed)if ($buildingReportingHistoriesUser->getUser() === $this) {$buildingReportingHistoriesUser->setUser(null);}}return $this;}/*** @return Collection<int, RefusedVisa>*/public function getRefusedVisas(): Collection{return $this->refusedVisas;}public function addRefusedVisa(RefusedVisa $refusedVisa): self{if (!$this->refusedVisas->contains($refusedVisa)) {$this->refusedVisas->add($refusedVisa);$refusedVisa->setUser($this);}return $this;}public function removeRefusedVisa(RefusedVisa $refusedVisa): self{if ($this->refusedVisas->removeElement($refusedVisa)) {// set the owning side to null (unless already changed)if ($refusedVisa->getUser() === $this) {$refusedVisa->setUser(null);}}return $this;}/*** @return Collection<int, HousingCertificate>*/public function getHousingCertificates(): Collection{return $this->housingCertificates;}public function addHousingCertificate(HousingCertificate $housingCertificate): self{if (!$this->housingCertificates->contains($housingCertificate)) {$this->housingCertificates->add($housingCertificate);$housingCertificate->setUser($this);}return $this;}public function removeHousingCertificate(HousingCertificate $housingCertificate): self{if ($this->housingCertificates->removeElement($housingCertificate)) {// set the owning side to null (unless already changed)if ($housingCertificate->getUser() === $this) {$housingCertificate->setUser(null);}}return $this;}/*** @return Collection<int, BuildingFolder>*/public function getBuildingFolders(): Collection{return $this->buildingFolders;}public function addBuildingFolder(BuildingFolder $buildingFolder): self{if (!$this->buildingFolders->contains($buildingFolder)) {$this->buildingFolders->add($buildingFolder);$buildingFolder->setTenant($this);}return $this;}public function removeBuildingFolder(BuildingFolder $buildingFolder): self{if ($this->buildingFolders->removeElement($buildingFolder)) {// set the owning side to null (unless already changed)if ($buildingFolder->getTenant() === $this) {$buildingFolder->setTenant(null);}}return $this;}/*** @return Collection<int, Residence>*/public function getResidences(): Collection{return $this->residences;}public function addResidence(Residence $residence): self{if (!$this->residences->contains($residence)) {$this->residences->add($residence);$residence->setAdministrator($this);}return $this;}public function removeResidence(Residence $residence): self{if ($this->residences->removeElement($residence)) {// set the owning side to null (unless already changed)if ($residence->getAdministrator() === $this) {$residence->setAdministrator(null);}}return $this;}public function getNameLegal(): ?string{return $this->nameLegal;}public function setNameLegal(?string $nameLegal): self{$this->nameLegal = $nameLegal;return $this;}public function getFirstNameLegal(): ?string{return $this->firstNameLegal;}public function setFirstNameLegal(?string $firstNameLegal): self{$this->firstNameLegal = $firstNameLegal;return $this;}public function getPhoneLegal(): ?string{return $this->phoneLegal;}public function setPhoneLegal(?string $phoneLegal): self{$this->phoneLegal = $phoneLegal;return $this;}public function getEmailLegal(): ?string{return $this->emailLegal;}public function setEmailLegal(?string $emailLegal): self{$this->emailLegal = $emailLegal;return $this;}public function getActivity(): ?string{return $this->activity;}public function setActivity(?string $activity): self{$this->activity = $activity;return $this;}/*** @return Collection<int, WantedVisio>*/public function getWantedVisios(): Collection{return $this->wantedVisios;}public function addWantedVisio(WantedVisio $wantedVisio): self{if (!$this->wantedVisios->contains($wantedVisio)) {$this->wantedVisios->add($wantedVisio);$wantedVisio->setRequester($this);}return $this;}public function removeWantedVisio(WantedVisio $wantedVisio): self{if ($this->wantedVisios->removeElement($wantedVisio)) {// set the owning side to null (unless already changed)if ($wantedVisio->getRequester() === $this) {$wantedVisio->setRequester(null);}}return $this;}/*** @return Collection<int, LikedBuilding>*/public function getLikedBuildings(): Collection{return $this->likedBuildings;}public function addLikedBuilding(LikedBuilding $likedBuilding): self{if (!$this->likedBuildings->contains($likedBuilding)) {$this->likedBuildings->add($likedBuilding);$likedBuilding->setUser($this);}return $this;}public function removeLikedBuilding(LikedBuilding $likedBuilding): self{if ($this->likedBuildings->removeElement($likedBuilding)) {// set the owning side to null (unless already changed)if ($likedBuilding->getUser() === $this) {$likedBuilding->setUser(null);}}return $this;}public function getPackAttestation(): ?int{return $this->packAttestation;}public function setPackAttestation(int $packAttestation): static{$this->packAttestation = $packAttestation;return $this;}public function getAgentEnderControl(): ?string{return $this->agentEnderControl;}public function setAgentEnderControl(?string $agentEnderControl): static{$this->agentEnderControl = $agentEnderControl;return $this;}public function getConsulatCountry(): ?string{return $this->consulatCountry;}public function setConsulatCountry(?string $consulatCountry): static{$this->consulatCountry = $consulatCountry;return $this;}public function getStepProfil(): ?int{return $this->stepProfil;}public function setStepProfil(int $stepProfil): static{$this->stepProfil = $stepProfil;return $this;}public function getDateStartAt(): ?\DateTimeInterface{return $this->dateStartAt;}public function setDateStartAt(?\DateTimeInterface $dateStartAt): self{$this->dateStartAt = $dateStartAt;return $this;}public function getRentalDuration(): ?int{return $this->rentalDuration;}public function setRentalDuration(int $rentalDuration): static{$this->rentalDuration = $rentalDuration;return $this;}public function getStatus(): ?string{return $this->status;}public function setStatus(?string $status): static{$this->status = $status;return $this;}public function getFormationName(): ?string{return $this->formationName;}public function setFormationName(?string $formationName): static{$this->formationName = $formationName;return $this;}public function getSchoolName(): ?string{return $this->schoolName;}public function setSchoolName(?string $schoolName): static{$this->schoolName = $schoolName;return $this;}public function getSchoolAddress(): ?string{return $this->schoolAddress;}public function setSchoolAddress(?string $schoolAddress): static{$this->schoolAddress = $schoolAddress;return $this;}public function getStudylevel(): ?string{return $this->studyLevel;}public function setStudylevel(?string $studyLevel): static{$this->studyLevel = $studyLevel;return $this;}public function getCompany(): ?string{return $this->company;}public function setCompany(?string $company): static{$this->company = $company;return $this;}public function getEmployementContract(): ?string{return $this->employementContract;}public function setEmployementContract(?string $employementContract): static{$this->employementContract = $employementContract;return $this;}public function getTrialPeriod(): ?string{return $this->trialPeriod;}public function setTrialPeriod(?string $trialPeriod): static{$this->trialPeriod = $trialPeriod;return $this;}public function getNetMonthlySalary(): ?int{return $this->netMonthlySalary;}public function setNetMonthlySalary(?int $netMonthlySalary): static{$this->netMonthlySalary = $netMonthlySalary;return $this;}public function getGuarantorType(): ?string{return $this->guarantorType;}public function setGuarantorType(?string $guarantorType): static{$this->guarantorType = $guarantorType;return $this;}public function getPhysicalGuarantorType(): ?string{return $this->physicalGuarantorType;}public function setPhysicalGuarantorType(?string $physicalGuarantorType): static{$this->physicalGuarantorType = $physicalGuarantorType;return $this;}public function getStatutResidencePrincipale(): ?string{return $this->statutResidencePrincipale;}public function setStatutResidencePrincipale(?string $statutResidencePrincipale): static{$this->statutResidencePrincipale = $statutResidencePrincipale;return $this;}public function getMensualRent(): ?int{return $this->mensualRent;}public function setMensualRent(?int $mensualRent): static{$this->mensualRent = $mensualRent;return $this;}public function getContractType(): ?string{return $this->contractType;}public function setContractType(?string $contractType): static{$this->contractType = $contractType;return $this;}public function getFinishedTrialPeriod(): ?string{return $this->finishedTrialPeriod;}public function setFinishedTrialPeriod(?string $finishedTrialPeriod): static{$this->finishedTrialPeriod = $finishedTrialPeriod;return $this;}public function getIncome(): ?string{return $this->income;}public function setIncome(?string $income): static{$this->income = $income;return $this;}public function getAdditionalIncomeSources(): ?string{return $this->additionalIncomeSources;}public function setAdditionalIncomeSources(?string $additionalIncomeSources): static{$this->additionalIncomeSources = $additionalIncomeSources;return $this;}public function getAdditionalIncomeSourcesStudent(): ?string{return $this->additionalIncomeSourcesStudent;}public function setAdditionalIncomeSourcesStudent(?string $additionalIncomeSourcesStudent): static{$this->additionalIncomeSourcesStudent = $additionalIncomeSourcesStudent;return $this;}public function getGuarantorStatus(): ?string{return $this->guarantorStatus;}public function setGuarantorStatus(?string $guarantorStatus): static{$this->guarantorStatus = $guarantorStatus;return $this;}public function getProfessionalGuarantee(): ?string{return $this->professionalGuarantee;}public function setProfessionalGuarantee(?string $professionalGuarantee): static{$this->professionalGuarantee = $professionalGuarantee;return $this;}public function getPhysicalGuarantorNationality(): ?string{return $this->physicalGuarantorNationality;}public function setPhysicalGuarantorNationality(?string $physicalGuarantorNationality): static{$this->physicalGuarantorNationality = $physicalGuarantorNationality;return $this;}public function getApplicationMessage(): ?string{return $this->applicationMessage;}public function setApplicationMessage(?string $applicationMessage): static{$this->applicationMessage = $applicationMessage;return $this;}public function getSendSMS(): ?\DateTimeInterface{return $this->sendSMS;}public function setSendSMS(?\DateTimeInterface $sendSMS): self{$this->sendSMS = $sendSMS;return $this;}public function getSortedHistoryUsers(): Collection{// Convert the Collection to an array for sorting$historyUsersArray = $this->historyUsers->toArray();// Sort by date in descending orderusort($historyUsersArray, function ($a, $b) {return $b->getId()<=> $a->getId(); // Latest dates first});// Limit to the last 5 records$historyUsersArray = array_slice($historyUsersArray, 0, 5);// Return a new ArrayCollection with the sorted and limited resultsreturn new ArrayCollection($historyUsersArray);}public function getAllSortedHistoryUsers(): Collection{// Convert the Collection to an array for sorting$historyUsersArray = $this->historyUsers->toArray();// Sort by date in descending orderusort($historyUsersArray, function ($a, $b) {return $b->getId() <=> $a->getId(); // Latest dates first});// Return a new ArrayCollection with the sorted and limited resultsreturn new ArrayCollection($historyUsersArray);}/*** @return Collection<int, HistoryUser>*/public function getHistoryUsers(): Collection{return $this->historyUsers;}public function addHistoryUser(HistoryUser $historyUser): static{if (!$this->historyUsers->contains($historyUser)) {$this->historyUsers->add($historyUser);$historyUser->setUserId($this);}return $this;}public function removeHistoryUser(HistoryUser $historyUser): static{if ($this->historyUsers->removeElement($historyUser)) {// set the owning side to null (unless already changed)if ($historyUser->getUserId() === $this) {$historyUser->setUserId(null);}}return $this;}}