src/Entity/Locataire.php line 15
<?phpnamespace App\Entity;use App\Repository\LocataireRepository;use App\Traits\TimeStampTrait;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: LocataireRepository::class)]#[ORM\HasLifecycleCallbacks]class Locataire{use TimeStampTrait;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column(type: 'integer')]private $id;#[ORM\Column(length: 100, nullable: true)]private ?string $name = null;#[ORM\Column(length: 100, nullable: true)]private ?string $lastname = null;#[ORM\Column(length: 100, nullable: true)]private ?string $firstname = null;#[ORM\Column(length: 100, nullable: true)]private ?string $identificationId = null;#[ORM\Column(nullable: true)]private ?bool $status = null;#[ORM\Column(length: 100, nullable: true)]private ?string $code = null;#[ORM\ManyToOne(inversedBy: 'locataire')]private ?User $createdby = null;#[ORM\Column(length: 100, nullable: true)]private ?string $phone = null;#[ORM\OneToMany(mappedBy: 'locataire', targetEntity: Location::class, cascade: ['all'], fetch: 'EAGER')]private Collection $locations;#[ORM\Column(nullable: true)]private ?bool $occuper = null;#[ORM\ManyToOne(inversedBy: 'locataires')]private ?Entreprise $marchand = null;#[ORM\Column(length: 100, nullable: true)]private ?string $email = null;#[ORM\Column(length: 25, nullable: true)]private ?string $salutation = null;#[ORM\Column(length: 25, nullable: true)]private ?string $typeIdentitfication = null;#[ORM\Column(length: 255, nullable: true)]private ?string $note = null;#[ORM\ManyToMany(targetEntity: Societe::class, inversedBy: 'locataires')]private Collection $society;#[ORM\Column(nullable: true)]private ?bool $notif = null;#[ORM\Column(nullable: true)]private ?bool $isLoginGenerate = null;#[ORM\OneToMany(mappedBy: 'locataire', targetEntity: LocataireUser::class)]private Collection $locataireUsers;#[ORM\ManyToMany(targetEntity: Announcement::class, mappedBy: 'locataire')]private Collection $announcements;#[ORM\Column(length: 255, nullable: true)]private ?string $picture = null;#[ORM\OneToMany(mappedBy: 'locataire', targetEntity: NotificationView::class)]private Collection $notificationViews;#[ORM\OneToMany(mappedBy: 'locataire', targetEntity: ChargeAllocation::class)]private Collection $chargeAllocations;public function __construct(){$this->locations = new ArrayCollection();$this->society = new ArrayCollection();$this->locataireUsers = new ArrayCollection();$this->announcements = new ArrayCollection();$this->notificationViews = new ArrayCollection();$this->chargeAllocations = new ArrayCollection();}public function getId(){return $this->id;}public function setId($id): void{$this->id = $id;}/*** @return string|null*/public function getName(): ?string{return $this->name;}/*** @param string|null $name*/public function setName(?string $name): void{$this->name = $name;}/*** @return string|null*/public function getLastname(): ?string{return $this->lastname;}/*** @param string|null $lastname*/public function setLastname(?string $lastname): void{$this->lastname = $lastname;}/*** @return string|null*/public function getFirstname(): ?string{return $this->firstname;}/*** @param string|null $firstname*/public function setFirstname(?string $firstname): void{$this->firstname = $firstname;}/*** @return string|null*/public function getIdentificationId(): ?string{return $this->identificationId;}/*** @param string|null $identificationId*/public function setIdentificationId(?string $identificationId): void{$this->identificationId = $identificationId;}/*** @return bool|null*/public function getStatus(): ?bool{return $this->status;}/*** @param bool|null $status*/public function setStatus(?bool $status): void{$this->status = $status;}/*** @return string|null*/public function getCode(): ?string{return $this->code;}/*** @param string|null $code*/public function setCode(?string $code): void{$this->code = $code;}public function getCreatedby(): ?User{return $this->createdby;}public function setCreatedby(?User $createdby): static{$this->createdby = $createdby;return $this;}/*** @return string|null*/public function getPhone(): ?string{return $this->phone;}/*** @param string|null $phone*/public function setPhone(?string $phone): void{$this->phone = $phone;}/*** @return ArrayCollection|Collection*/public function getLocations(): ArrayCollection|Collection{return $this->locations;}/*** @param ArrayCollection|Collection $locations*/public function setLocations(ArrayCollection|Collection $locations): void{$this->locations = $locations;}/*** @return bool|null*/public function getOccuper(): ?bool{return $this->occuper;}/*** @param bool|null $occuper*/public function setOccuper(?bool $occuper): void{$this->occuper = $occuper;}/*** @return Entreprise|null*/public function getMarchand(): ?Entreprise{return $this->marchand;}/*** @param Entreprise|null $marchand*/public function setMarchand(?Entreprise $marchand): void{$this->marchand = $marchand;}/*** @return string|null*/public function getEmail(): ?string{return $this->email;}/*** @param string|null $email*/public function setEmail(?string $email): void{$this->email = $email;}public function __toString(){return $this->firstname." ".$this->name." ".$this->lastname;}public function getSalutation(): ?string{return $this->salutation;}public function setSalutation(?string $salutation): static{$this->salutation = $salutation;return $this;}public function getTypeIdentitfication(): ?string{return $this->typeIdentitfication;}public function setTypeIdentitfication(?string $typeIdentitfication): static{$this->typeIdentitfication = $typeIdentitfication;return $this;}public function getNote(): ?string{return $this->note;}public function setNote(?string $note): static{$this->note = $note;return $this;}/*** @return Collection<int, Societe>*/public function getSociety(): Collection{return $this->society;}public function addSociety(Societe $society): static{if (!$this->society->contains($society)) {$this->society->add($society);}return $this;}public function removeSociety(Societe $society): static{$this->society->removeElement($society);return $this;}public function isNotif(): ?bool{return $this->notif;}public function setNotif(?bool $notif): static{$this->notif = $notif;return $this;}public function isIsLoginGenerate(): ?bool{return $this->isLoginGenerate;}public function setIsLoginGenerate(?bool $isLoginGenerate): static{$this->isLoginGenerate = $isLoginGenerate;return $this;}/*** @return Collection<int, LocataireUser>*/public function getLocataireUsers(): Collection{return $this->locataireUsers;}public function addLocataireUser(LocataireUser $locataireUser): static{if (!$this->locataireUsers->contains($locataireUser)) {$this->locataireUsers->add($locataireUser);$locataireUser->setLocataire($this);}return $this;}public function removeLocataireUser(LocataireUser $locataireUser): static{if ($this->locataireUsers->removeElement($locataireUser)) {// set the owning side to null (unless already changed)if ($locataireUser->getLocataire() === $this) {$locataireUser->setLocataire(null);}}return $this;}/*** @return Collection<int, Announcement>*/public function getAnnouncements(): Collection{return $this->announcements;}public function addAnnouncement(Announcement $announcement): static{if (!$this->announcements->contains($announcement)) {$this->announcements->add($announcement);$announcement->addLocataire($this);}return $this;}public function removeAnnouncement(Announcement $announcement): static{if ($this->announcements->removeElement($announcement)) {$announcement->removeLocataire($this);}return $this;}public function getPicture(): ?string{return $this->picture;}public function setPicture(?string $picture): static{$this->picture = $picture;return $this;}/*** @return Collection<int, NotificationView>*/public function getNotificationViews(): Collection{return $this->notificationViews;}public function addNotificationView(NotificationView $notificationView): static{if (!$this->notificationViews->contains($notificationView)) {$this->notificationViews->add($notificationView);$notificationView->setLocataire($this);}return $this;}public function removeNotificationView(NotificationView $notificationView): static{if ($this->notificationViews->removeElement($notificationView)) {// set the owning side to null (unless already changed)if ($notificationView->getLocataire() === $this) {$notificationView->setLocataire(null);}}return $this;}/*** @return Collection<int, ChargeAllocation>*/public function getChargeAllocations(): Collection{return $this->chargeAllocations;}public function addChargeAllocation(ChargeAllocation $chargeAllocation): static{if (!$this->chargeAllocations->contains($chargeAllocation)) {$this->chargeAllocations->add($chargeAllocation);$chargeAllocation->setLocataire($this);}return $this;}public function removeChargeAllocation(ChargeAllocation $chargeAllocation): static{if ($this->chargeAllocations->removeElement($chargeAllocation)) {// set the owning side to null (unless already changed)if ($chargeAllocation->getLocataire() === $this) {$chargeAllocation->setLocataire(null);}}return $this;}}