src/Entity/Locataire.php line 15

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LocataireRepository;
  4. use App\Traits\TimeStampTrait;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. #[ORM\Entity(repositoryClassLocataireRepository::class)]
  10. #[ORM\HasLifecycleCallbacks]
  11. class Locataire
  12. {
  13.     use TimeStampTrait;
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column(type'integer')]
  17.     private $id;
  18.     #[ORM\Column(length100nullabletrue)]
  19.     private ?string $name null;
  20.     #[ORM\Column(length100nullabletrue)]
  21.     private ?string $lastname null;
  22.     #[ORM\Column(length100nullabletrue)]
  23.     private ?string $firstname null;
  24.     #[ORM\Column(length100nullabletrue)]
  25.     private ?string $identificationId null;
  26.     #[ORM\Column(nullabletrue)]
  27.     private ?bool $status null;
  28.     #[ORM\Column(length100nullabletrue)]
  29.     private ?string $code null;
  30.     #[ORM\ManyToOne(inversedBy'locataire')]
  31.     private ?User $createdby null;
  32.     #[ORM\Column(length100nullabletrue)]
  33.     private ?string $phone null;
  34.     #[ORM\OneToMany(mappedBy'locataire'targetEntityLocation::class, cascade: ['all'], fetch'EAGER')]
  35.     private Collection $locations;
  36.     #[ORM\Column(nullabletrue)]
  37.     private ?bool $occuper null;
  38.     #[ORM\ManyToOne(inversedBy'locataires')]
  39.     private ?Entreprise $marchand null;
  40.     #[ORM\Column(length100nullabletrue)]
  41.     private ?string $email null;
  42.     #[ORM\Column(length25nullabletrue)]
  43.     private ?string $salutation null;
  44.     #[ORM\Column(length25nullabletrue)]
  45.     private ?string $typeIdentitfication null;
  46.     #[ORM\Column(length255nullabletrue)]
  47.     private ?string $note null;
  48.     #[ORM\ManyToMany(targetEntitySociete::class, inversedBy'locataires')]
  49.     private Collection $society;
  50.     #[ORM\Column(nullabletrue)]
  51.     private ?bool $notif null;
  52.     #[ORM\Column(nullabletrue)]
  53.     private ?bool $isLoginGenerate null;
  54.     #[ORM\OneToMany(mappedBy'locataire'targetEntityLocataireUser::class)]
  55.     private Collection $locataireUsers;
  56.     #[ORM\ManyToMany(targetEntityAnnouncement::class, mappedBy'locataire')]
  57.     private Collection $announcements;
  58.     #[ORM\Column(length255nullabletrue)]
  59.     private ?string $picture null;
  60.     #[ORM\OneToMany(mappedBy'locataire'targetEntityNotificationView::class)]
  61.     private Collection $notificationViews;
  62.     #[ORM\OneToMany(mappedBy'locataire'targetEntityChargeAllocation::class)]
  63.     private Collection $chargeAllocations;
  64.     public function __construct()
  65.     {
  66.         $this->locations = new ArrayCollection();
  67.         $this->society = new ArrayCollection();
  68.         $this->locataireUsers = new ArrayCollection();
  69.         $this->announcements = new ArrayCollection();
  70.         $this->notificationViews = new ArrayCollection();
  71.         $this->chargeAllocations = new ArrayCollection();
  72.     }
  73.     public function getId()
  74.     {
  75.         return $this->id;
  76.     }
  77.     public function setId($id): void
  78.     {
  79.         $this->id $id;
  80.     }
  81.     /**
  82.      * @return string|null
  83.      */
  84.     public function getName(): ?string
  85.     {
  86.         return $this->name;
  87.     }
  88.     /**
  89.      * @param string|null $name
  90.      */
  91.     public function setName(?string $name): void
  92.     {
  93.         $this->name $name;
  94.     }
  95.     /**
  96.      * @return string|null
  97.      */
  98.     public function getLastname(): ?string
  99.     {
  100.         return $this->lastname;
  101.     }
  102.     /**
  103.      * @param string|null $lastname
  104.      */
  105.     public function setLastname(?string $lastname): void
  106.     {
  107.         $this->lastname $lastname;
  108.     }
  109.     /**
  110.      * @return string|null
  111.      */
  112.     public function getFirstname(): ?string
  113.     {
  114.         return $this->firstname;
  115.     }
  116.     /**
  117.      * @param string|null $firstname
  118.      */
  119.     public function setFirstname(?string $firstname): void
  120.     {
  121.         $this->firstname $firstname;
  122.     }
  123.     /**
  124.      * @return string|null
  125.      */
  126.     public function getIdentificationId(): ?string
  127.     {
  128.         return $this->identificationId;
  129.     }
  130.     /**
  131.      * @param string|null $identificationId
  132.      */
  133.     public function setIdentificationId(?string $identificationId): void
  134.     {
  135.         $this->identificationId $identificationId;
  136.     }
  137.     /**
  138.      * @return bool|null
  139.      */
  140.     public function getStatus(): ?bool
  141.     {
  142.         return $this->status;
  143.     }
  144.     /**
  145.      * @param bool|null $status
  146.      */
  147.     public function setStatus(?bool $status): void
  148.     {
  149.         $this->status $status;
  150.     }
  151.     /**
  152.      * @return string|null
  153.      */
  154.     public function getCode(): ?string
  155.     {
  156.         return $this->code;
  157.     }
  158.     /**
  159.      * @param string|null $code
  160.      */
  161.     public function setCode(?string $code): void
  162.     {
  163.         $this->code $code;
  164.     }
  165.     public function getCreatedby(): ?User
  166.     {
  167.         return $this->createdby;
  168.     }
  169.     public function setCreatedby(?User $createdby): static
  170.     {
  171.         $this->createdby $createdby;
  172.         return $this;
  173.     }
  174.     /**
  175.      * @return string|null
  176.      */
  177.     public function getPhone(): ?string
  178.     {
  179.         return $this->phone;
  180.     }
  181.     /**
  182.      * @param string|null $phone
  183.      */
  184.     public function setPhone(?string $phone): void
  185.     {
  186.         $this->phone $phone;
  187.     }
  188.     /**
  189.      * @return ArrayCollection|Collection
  190.      */
  191.     public function getLocations(): ArrayCollection|Collection
  192.     {
  193.         return $this->locations;
  194.     }
  195.     /**
  196.      * @param ArrayCollection|Collection $locations
  197.      */
  198.     public function setLocations(ArrayCollection|Collection $locations): void
  199.     {
  200.         $this->locations $locations;
  201.     }
  202.     /**
  203.      * @return bool|null
  204.      */
  205.     public function getOccuper(): ?bool
  206.     {
  207.         return $this->occuper;
  208.     }
  209.     /**
  210.      * @param bool|null $occuper
  211.      */
  212.     public function setOccuper(?bool $occuper): void
  213.     {
  214.         $this->occuper $occuper;
  215.     }
  216.     /**
  217.      * @return Entreprise|null
  218.      */
  219.     public function getMarchand(): ?Entreprise
  220.     {
  221.         return $this->marchand;
  222.     }
  223.     /**
  224.      * @param Entreprise|null $marchand
  225.      */
  226.     public function setMarchand(?Entreprise $marchand): void
  227.     {
  228.         $this->marchand $marchand;
  229.     }
  230.     /**
  231.      * @return string|null
  232.      */
  233.     public function getEmail(): ?string
  234.     {
  235.         return $this->email;
  236.     }
  237.     /**
  238.      * @param string|null $email
  239.      */
  240.     public function setEmail(?string $email): void
  241.     {
  242.         $this->email $email;
  243.     }
  244.     public function __toString()
  245.     {
  246.         return $this->firstname." ".$this->name." ".$this->lastname;
  247.     }
  248.     public function getSalutation(): ?string
  249.     {
  250.         return $this->salutation;
  251.     }
  252.     public function setSalutation(?string $salutation): static
  253.     {
  254.         $this->salutation $salutation;
  255.         return $this;
  256.     }
  257.     public function getTypeIdentitfication(): ?string
  258.     {
  259.         return $this->typeIdentitfication;
  260.     }
  261.     public function setTypeIdentitfication(?string $typeIdentitfication): static
  262.     {
  263.         $this->typeIdentitfication $typeIdentitfication;
  264.         return $this;
  265.     }
  266.     public function getNote(): ?string
  267.     {
  268.         return $this->note;
  269.     }
  270.     public function setNote(?string $note): static
  271.     {
  272.         $this->note $note;
  273.         return $this;
  274.     }
  275.     /**
  276.      * @return Collection<int, Societe>
  277.      */
  278.     public function getSociety(): Collection
  279.     {
  280.         return $this->society;
  281.     }
  282.     public function addSociety(Societe $society): static
  283.     {
  284.         if (!$this->society->contains($society)) {
  285.             $this->society->add($society);
  286.         }
  287.         return $this;
  288.     }
  289.     public function removeSociety(Societe $society): static
  290.     {
  291.         $this->society->removeElement($society);
  292.         return $this;
  293.     }
  294.     public function isNotif(): ?bool
  295.     {
  296.         return $this->notif;
  297.     }
  298.     public function setNotif(?bool $notif): static
  299.     {
  300.         $this->notif $notif;
  301.         return $this;
  302.     }
  303.     public function isIsLoginGenerate(): ?bool
  304.     {
  305.         return $this->isLoginGenerate;
  306.     }
  307.     public function setIsLoginGenerate(?bool $isLoginGenerate): static
  308.     {
  309.         $this->isLoginGenerate $isLoginGenerate;
  310.         return $this;
  311.     }
  312.     /**
  313.      * @return Collection<int, LocataireUser>
  314.      */
  315.     public function getLocataireUsers(): Collection
  316.     {
  317.         return $this->locataireUsers;
  318.     }
  319.     public function addLocataireUser(LocataireUser $locataireUser): static
  320.     {
  321.         if (!$this->locataireUsers->contains($locataireUser)) {
  322.             $this->locataireUsers->add($locataireUser);
  323.             $locataireUser->setLocataire($this);
  324.         }
  325.         return $this;
  326.     }
  327.     public function removeLocataireUser(LocataireUser $locataireUser): static
  328.     {
  329.         if ($this->locataireUsers->removeElement($locataireUser)) {
  330.             // set the owning side to null (unless already changed)
  331.             if ($locataireUser->getLocataire() === $this) {
  332.                 $locataireUser->setLocataire(null);
  333.             }
  334.         }
  335.         return $this;
  336.     }
  337.     /**
  338.      * @return Collection<int, Announcement>
  339.      */
  340.     public function getAnnouncements(): Collection
  341.     {
  342.         return $this->announcements;
  343.     }
  344.     public function addAnnouncement(Announcement $announcement): static
  345.     {
  346.         if (!$this->announcements->contains($announcement)) {
  347.             $this->announcements->add($announcement);
  348.             $announcement->addLocataire($this);
  349.         }
  350.         return $this;
  351.     }
  352.     public function removeAnnouncement(Announcement $announcement): static
  353.     {
  354.         if ($this->announcements->removeElement($announcement)) {
  355.             $announcement->removeLocataire($this);
  356.         }
  357.         return $this;
  358.     }
  359.     public function getPicture(): ?string
  360.     {
  361.         return $this->picture;
  362.     }
  363.     public function setPicture(?string $picture): static
  364.     {
  365.         $this->picture $picture;
  366.         return $this;
  367.     }
  368.     /**
  369.      * @return Collection<int, NotificationView>
  370.      */
  371.     public function getNotificationViews(): Collection
  372.     {
  373.         return $this->notificationViews;
  374.     }
  375.     public function addNotificationView(NotificationView $notificationView): static
  376.     {
  377.         if (!$this->notificationViews->contains($notificationView)) {
  378.             $this->notificationViews->add($notificationView);
  379.             $notificationView->setLocataire($this);
  380.         }
  381.         return $this;
  382.     }
  383.     public function removeNotificationView(NotificationView $notificationView): static
  384.     {
  385.         if ($this->notificationViews->removeElement($notificationView)) {
  386.             // set the owning side to null (unless already changed)
  387.             if ($notificationView->getLocataire() === $this) {
  388.                 $notificationView->setLocataire(null);
  389.             }
  390.         }
  391.         return $this;
  392.     }
  393.     /**
  394.      * @return Collection<int, ChargeAllocation>
  395.      */
  396.     public function getChargeAllocations(): Collection
  397.     {
  398.         return $this->chargeAllocations;
  399.     }
  400.     public function addChargeAllocation(ChargeAllocation $chargeAllocation): static
  401.     {
  402.         if (!$this->chargeAllocations->contains($chargeAllocation)) {
  403.             $this->chargeAllocations->add($chargeAllocation);
  404.             $chargeAllocation->setLocataire($this);
  405.         }
  406.         return $this;
  407.     }
  408.     public function removeChargeAllocation(ChargeAllocation $chargeAllocation): static
  409.     {
  410.         if ($this->chargeAllocations->removeElement($chargeAllocation)) {
  411.             // set the owning side to null (unless already changed)
  412.             if ($chargeAllocation->getLocataire() === $this) {
  413.                 $chargeAllocation->setLocataire(null);
  414.             }
  415.         }
  416.         return $this;
  417.     }
  418. }