src/Entity/User.php line 27

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Model\UserModel;
  4. use App\Entity\ReseauSociaux\Comments;
  5. use App\Entity\ReseauSociaux\Conversation;
  6. use App\Entity\ReseauSociaux\Espace;
  7. use App\Entity\ReseauSociaux\Message;
  8. use App\Entity\ReseauSociaux\Notifications;
  9. use App\Entity\ReseauSociaux\Publication;
  10. use App\Entity\ReseauSociaux\PostLike;
  11. use App\Entity\ReseauSociaux\SharePost;
  12. use Doctrine\ORM\Mapping as ORM;
  13. use App\Repository\UserRepository;
  14. use Doctrine\Common\Collections\Collection;
  15. use Doctrine\Common\Collections\ArrayCollection;
  16. use Symfony\Component\Serializer\Annotation\Groups;
  17. use Symfony\Component\Validator\Constraints as Assert;
  18. use Symfony\Component\Security\Core\User\UserInterface;
  19. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  20. /**
  21.  * @ORM\Entity(repositoryClass=UserRepository::class)
  22.  * @UniqueEntity(fields={"email"}, message="Cette adresse mail est déjà utilisée")
  23.  */
  24. class User extends UserModel implements UserInterface
  25. {
  26.     /**
  27.      * @ORM\Id()
  28.      * @ORM\GeneratedValue()
  29.      * @ORM\Column(type="integer")
  30.      * @Groups({"post:read", "connect:read","show:read", "publication:read", "message:read", "commentaire:read", "notif:read"})
  31.      */
  32.     private $id;
  33.     /**
  34.      * @ORM\Column(type="string", length=10, nullable=true)
  35.      */
  36.     private $civility;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true)
  39.      *
  40.      * @Assert\NotBlank(message="Veuillez renseigner votre prénom")
  41.      * @Groups({"post:read","connect:read","show:read", "publication:read", "commentaire:read", "notif:read","message:read"})
  42.      */
  43.     private $firstName;
  44.     /**
  45.      * @ORM\Column(type="string", length=255, nullable=true)
  46.      *
  47.      * @Assert\NotBlank(message="Veuillez renseigner votre nom")
  48.      * @Groups({"post:read","connect:read","show:read", "publication:read", "commentaire:read", "notif:read","message:read"})
  49.      */
  50.     private $lastName;
  51.     /**
  52.      * @ORM\Column(type="string", length=10)
  53.      * @Groups("show:read")
  54.      */
  55.     private $phone;
  56.     /**
  57.      * @ORM\Column(type="date", nullable=true)
  58.      */
  59.     private $weddingDate;
  60.     /**
  61.      * @ORM\Column(type="string", length=255, nullable=true)
  62.      * @Groups({"post:read","connect:read", "publication:read", "show:read", "commentaire:read", "notif:read"})
  63.      */
  64.     private $image;
  65.     /**
  66.      * @ORM\OneToMany(targetEntity=Command::class, mappedBy="client")
  67.      */
  68.     private $commands;
  69.     /**
  70.      * @ORM\Column(type="string", length=255, nullable=true)
  71.      */
  72.     private $idStripe;
  73.     /**
  74.      * @ORM\OneToMany(targetEntity=WishList::class, mappedBy="user")
  75.      */
  76.     private $wishLists;
  77.     /**
  78.      * @ORM\OneToMany(targetEntity=Avis::class, mappedBy="client")
  79.      */
  80.     private $avis;
  81.     /**
  82.      * @ORM\OneToMany(targetEntity=Messaging::class, mappedBy="messageUser")     * 
  83.      */
  84.     private $messagings;
  85.     /**
  86.      * @ORM\OneToMany(targetEntity=Ticket::class, mappedBy="createdBy", orphanRemoval=true)
  87.      */
  88.     private $tickets;
  89.     /**
  90.      * @ORM\OneToMany(targetEntity=TableUser::class, mappedBy="userClient", cascade={"remove"})
  91.      */
  92.     private $tableUsers;
  93.     /**
  94.      * @ORM\OneToMany(targetEntity=Litige::class, mappedBy="user")
  95.      */
  96.     private $litiges;
  97.     /**
  98.      * @ORM\Column(type="string", length=255, nullable=true)
  99.      */
  100.     private $livraisonAdress;
  101.     /**
  102.      * @ORM\Column(type="string", length=255, nullable=true)
  103.      */
  104.     private $livraisonZipCode;
  105.     /**
  106.      * @ORM\Column(type="string", length=255, nullable=true)
  107.      */
  108.     private $livraisonCity;
  109.     /**
  110.      * @ORM\Column(type="datetime", nullable=true, options={"default": "CURRENT_TIMESTAMP"})
  111.      * @Assert\NotBlank(message="Veuillez renseigner votre date de naissance !!")
  112.      */
  113.     private $birthAt;
  114.     /**
  115.      * @ORM\Column(type="string", length=3, nullable=true)
  116.      * @Assert\NotBlank(message="Veuillez renseigner votre nationalité !!")
  117.      */
  118.     private $nationality;
  119.     /**
  120.      * @ORM\Column(type="string", length=3, nullable=true)
  121.      * @Assert\NotBlank(message="Veuillez renseigner votre pays de résidence !!")
  122.      */
  123.     private $countryResidence;
  124.     /**
  125.      * @ORM\Column(type="string", length=255, nullable=true)
  126.      */
  127.     private $mangoId;
  128.     /**
  129.      * @ORM\Column(type="boolean", nullable=true)
  130.      */
  131.     private $isValid;
  132.     /**
  133.      * @ORM\Column(type="string", length=255, nullable=true)
  134.      */
  135.     private $serviceAddress;
  136.     /**
  137.      * @ORM\Column(type="string", length=5, nullable=true)
  138.      */
  139.     private $serviceZipCode;
  140.     /**
  141.      * @ORM\Column(type="string", length=255, nullable=true)
  142.      */
  143.     private $serviceCity;
  144.     /**
  145.      * @ORM\OneToMany(targetEntity=Annonce::class, mappedBy="users")
  146.      */
  147.     private $annonces;
  148.     /**
  149.      * @ORM\OneToMany(targetEntity=Location::class, mappedBy="product", orphanRemoval=true)
  150.      */
  151.     private $locations;
  152.     /**
  153.      * @ORM\OneToMany(targetEntity=Reservation::class, mappedBy="client", orphanRemoval=true)
  154.      */
  155.     private $reservations;
  156.     /**
  157.      * @ORM\Column(type="boolean", nullable=true)
  158.      * @Groups("post:read","connect:read","show:read")
  159.      */
  160.     private $statuCon;
  161.     /**
  162.      * @ORM\Column(type="datetime", nullable=true)
  163.      * @Groups("post:read","connect:read")
  164.      */
  165.     private $etatNetwork;
  166.     /**
  167.      * @ORM\OneToMany(targetEntity=Caution::class, mappedBy="user")
  168.      */
  169.     private $cautions;
  170.     /**
  171.      * @ORM\OneToMany(targetEntity=Message::class, mappedBy="sender")
  172.      */
  173.     private $messages;
  174.     /**
  175.      * @ORM\OneToMany(targetEntity=Conversation::class, mappedBy="utilisateur1")
  176.      */
  177.     private $conversations;
  178.     /**
  179.      * @ORM\OneToMany(targetEntity=Espace::class, mappedBy="propriotaire")
  180.      * @Groups("post:read")
  181.      */
  182.     private $espaces;
  183.     /**
  184.      * @ORM\OneToMany(targetEntity=Publication::class, mappedBy="client")
  185.      */
  186.     private $publications;
  187.     /**
  188.      * @ORM\ManyToMany(targetEntity=Espace::class, inversedBy="users")
  189.      * @Groups("post:read")
  190.      */
  191.     private $follow;
  192.     /**
  193.      * @ORM\OneToMany(targetEntity=Comments::class, mappedBy="author")
  194.      */
  195.     private $comments;
  196.     /**
  197.      * @ORM\OneToMany(targetEntity=Notifications::class, mappedBy="user")
  198.      */
  199.     private $notifications;
  200.     /**
  201.      * @ORM\OneToMany(targetEntity=PostLike::class, mappedBy="user")
  202.      */
  203.     private $likes;
  204.     /**
  205.      * @ORM\OneToMany(targetEntity=SharePost::class, mappedBy="author")
  206.      */
  207.     private $share;
  208.     /**
  209.      * @ORM\OneToMany(targetEntity=PendingLocation::class, mappedBy="user")
  210.      */
  211.     private $pendingLocations;
  212.     /**
  213.      * @ORM\OneToMany(targetEntity=PendingReservation::class, mappedBy="user")
  214.      */
  215.     private $pendingReservations;
  216.     /**
  217.      * @ORM\OneToMany(targetEntity=Notification::class, mappedBy="customer")
  218.      */
  219.     private $notificationReservation;
  220.     /**
  221.      * @ORM\Column(type="json")
  222.      * @Groups({"show:read"})
  223.      */
  224.     protected $roles = [];
  225.     /**
  226.      * @Groups({"show:read"})
  227.      */
  228.     public function getRoles(): array
  229.     {
  230.         $roles $this->roles;
  231.         // guarantee every user at least has ROLE_USER
  232.         $roles[] = 'ROLE_USER';
  233.         return array_unique($roles);
  234.     }
  235.     public function setRoles(array $roles): self
  236.     {
  237.         $this->roles $roles;
  238.         return $this;
  239.     }
  240.     public function __construct()
  241.     {
  242.         $this->commands = new ArrayCollection();
  243.         $this->wishLists = new ArrayCollection();
  244.         $this->avis = new ArrayCollection();
  245.         $this->messagings = new ArrayCollection();
  246.         $this->tickets = new ArrayCollection();
  247.         $this->tableUsers = new ArrayCollection();
  248.         $this->litiges = new ArrayCollection();
  249.         $this->isValid false;
  250.         $this->annonces = new ArrayCollection();
  251.         $this->locations = new ArrayCollection();
  252.         $this->reservations = new ArrayCollection();
  253.         $this->cautions = new ArrayCollection();
  254.         $this->messages = new ArrayCollection();
  255.         $this->conversations = new ArrayCollection();
  256.         $this->espaces = new ArrayCollection();
  257.         $this->publications = new ArrayCollection();
  258.         $this->follow = new ArrayCollection();
  259.         $this->comments = new ArrayCollection();
  260.         $this->notifications = new ArrayCollection();
  261.         $this->likes = new ArrayCollection();
  262.         $this->share = new ArrayCollection();
  263.         $this->pendingLocations = new ArrayCollection();
  264.         $this->pendingReservations = new ArrayCollection();
  265.         $this->notificationReservation = new ArrayCollection();
  266.     }
  267.     /**
  268.      * @Groups({"show:read", "publication:read"})
  269.      */
  270.     public function getId(): ?int
  271.     {
  272.         return $this->id;
  273.     }
  274.     public function getCivility(): ?string
  275.     {
  276.         return $this->civility;
  277.     }
  278.     public function setCivility(?string $civility): self
  279.     {
  280.         $this->civility $civility;
  281.         return $this;
  282.     }
  283.     /**
  284.      * @Groups("show:read", "publication:read")
  285.      */
  286.     public function getFirstName(): ?string
  287.     {
  288.         return $this->firstName;
  289.     }
  290.     public function setFirstName(?string $firstName): self
  291.     {
  292.         $this->firstName $firstName;
  293.         return $this;
  294.     }
  295.     /**
  296.      * @Groups("show:read", "publication:read")
  297.      */
  298.     public function getLastName(): ?string
  299.     {
  300.         return $this->lastName;
  301.     }
  302.     public function setLastName(?string $lastName): self
  303.     {
  304.         $this->lastName $lastName;
  305.         return $this;
  306.     }
  307.     public function getPhone(): ?string
  308.     {
  309.         return $this->phone;
  310.     }
  311.     public function setPhone(?string $phone): self
  312.     {
  313.         $this->phone $phone;
  314.         return $this;
  315.     }
  316.     public function getWeddingDate(): ?\DateTimeInterface
  317.     {
  318.         return $this->weddingDate;
  319.     }
  320.     public function setWeddingDate(?\DateTimeInterface $weddingDate): self
  321.     {
  322.         $this->weddingDate $weddingDate;
  323.         return $this;
  324.     }
  325.     /**
  326.      * @Groups("show:read", "publication:read")
  327.      */
  328.     public function getImage(): ?string
  329.     {
  330.         return $this->image;
  331.     }
  332.     public function setImage(?string $image): self
  333.     {
  334.         $this->image $image;
  335.         return $this;
  336.     }
  337.     /**
  338.      * @return Collection|Command[]
  339.      */
  340.     public function getCommands(): Collection
  341.     {
  342.         return $this->commands;
  343.     }
  344.     public function addCommand(Command $command): self
  345.     {
  346.         if (!$this->commands->contains($command)) {
  347.             $this->commands[] = $command;
  348.             $command->setClient($this);
  349.         }
  350.         return $this;
  351.     }
  352.     public function removeCommand(Command $command): self
  353.     {
  354.         if ($this->commands->contains($command)) {
  355.             $this->commands->removeElement($command);
  356.             // set the owning side to null (unless already changed)
  357.             if ($command->getClient() === $this) {
  358.                 $command->setClient(null);
  359.             }
  360.         }
  361.         return $this;
  362.     }
  363.     public function getIdStripe(): ?string
  364.     {
  365.         return $this->idStripe;
  366.     }
  367.     public function setIdStripe(?string $idStripe): self
  368.     {
  369.         $this->idStripe $idStripe;
  370.         return $this;
  371.     }
  372.     /**
  373.      * @return Collection|WishList[]
  374.      */
  375.     public function getWishLists(): Collection
  376.     {
  377.         return $this->wishLists;
  378.     }
  379.     public function addWishList(WishList $wishList): self
  380.     {
  381.         if (!$this->wishLists->contains($wishList)) {
  382.             $this->wishLists[] = $wishList;
  383.             $wishList->setUser($this);
  384.         }
  385.         return $this;
  386.     }
  387.     public function removeWishList(WishList $wishList): self
  388.     {
  389.         if ($this->wishLists->contains($wishList)) {
  390.             $this->wishLists->removeElement($wishList);
  391.             // set the owning side to null (unless already changed)
  392.             if ($wishList->getUser() === $this) {
  393.                 $wishList->setUser(null);
  394.             }
  395.         }
  396.         return $this;
  397.     }
  398.     /**
  399.      * @return Collection|Avis[]
  400.      */
  401.     public function getAvis(): Collection
  402.     {
  403.         return $this->avis;
  404.     }
  405.     public function addAvi(Avis $avi): self
  406.     {
  407.         if (!$this->avis->contains($avi)) {
  408.             $this->avis[] = $avi;
  409.             $avi->setClient($this);
  410.         }
  411.         return $this;
  412.     }
  413.     public function removeAvi(Avis $avi): self
  414.     {
  415.         if ($this->avis->contains($avi)) {
  416.             $this->avis->removeElement($avi);
  417.             // set the owning side to null (unless already changed)
  418.             if ($avi->getClient() === $this) {
  419.                 $avi->setClient(null);
  420.             }
  421.         }
  422.         return $this;
  423.     }
  424.     /**
  425.      * @return Collection|Messaging[]
  426.      */
  427.     public function getMessagings(): Collection
  428.     {
  429.         return $this->messagings;
  430.     }
  431.     public function addMessaging(Messaging $messaging): self
  432.     {
  433.         if (!$this->messagings->contains($messaging)) {
  434.             $this->messagings[] = $messaging;
  435.             $messaging->setMessageUser($this);
  436.         }
  437.         return $this;
  438.     }
  439.     public function removeMessaging(Messaging $messaging): self
  440.     {
  441.         if ($this->messagings->contains($messaging)) {
  442.             $this->messagings->removeElement($messaging);
  443.             // set the owning side to null (unless already changed)
  444.             if ($messaging->getMessageUser() === $this) {
  445.                 $messaging->setMessageUser(null);
  446.             }
  447.         }
  448.         return $this;
  449.     }
  450.     /**
  451.      * @return Collection|Ticket[]
  452.      */
  453.     public function getTickets(): Collection
  454.     {
  455.         return $this->tickets;
  456.     }
  457.     public function addTicket(Ticket $ticket): self
  458.     {
  459.         if (!$this->tickets->contains($ticket)) {
  460.             $this->tickets[] = $ticket;
  461.             $ticket->setCreatedBy($this);
  462.         }
  463.         return $this;
  464.     }
  465.     public function removeTicket(Ticket $ticket): self
  466.     {
  467.         if ($this->tickets->contains($ticket)) {
  468.             $this->tickets->removeElement($ticket);
  469.             // set the owning side to null (unless already changed)
  470.             if ($ticket->getCreatedBy() === $this) {
  471.                 $ticket->setCreatedBy(null);
  472.             }
  473.         }
  474.         return $this;
  475.     }
  476.     public function displayName()
  477.     {
  478.         return $this->firstName ' ' $this->lastName ' - ' $this->email;
  479.     }
  480.     /**
  481.      * @return Collection|TableUser[]
  482.      */
  483.     public function getTableUsers(): Collection
  484.     {
  485.         return $this->tableUsers;
  486.     }
  487.     public function addTableUser(TableUser $tableUser): self
  488.     {
  489.         if (!$this->tableUsers->contains($tableUser)) {
  490.             $this->tableUsers[] = $tableUser;
  491.             $tableUser->setUserClient($this);
  492.         }
  493.         return $this;
  494.     }
  495.     public function removeTableUser(TableUser $tableUser): self
  496.     {
  497.         if ($this->tableUsers->contains($tableUser)) {
  498.             $this->tableUsers->removeElement($tableUser);
  499.             // set the owning side to null (unless already changed)
  500.             if ($tableUser->getUserClient() === $this) {
  501.                 $tableUser->setUserClient(null);
  502.             }
  503.         }
  504.         return $this;
  505.     }
  506.     /**
  507.      * @return Collection|Litige[]
  508.      */
  509.     public function getLitiges(): Collection
  510.     {
  511.         return $this->litiges;
  512.     }
  513.     public function addLitige(Litige $litige): self
  514.     {
  515.         if (!$this->litiges->contains($litige)) {
  516.             $this->litiges[] = $litige;
  517.             $litige->setUser($this);
  518.         }
  519.         return $this;
  520.     }
  521.     public function removeLitige(Litige $litige): self
  522.     {
  523.         if ($this->litiges->contains($litige)) {
  524.             $this->litiges->removeElement($litige);
  525.             // set the owning side to null (unless already changed)
  526.             if ($litige->getUser() === $this) {
  527.                 $litige->setUser(null);
  528.             }
  529.         }
  530.         return $this;
  531.     }
  532.     public function getLivraisonAdress(): ?string
  533.     {
  534.         return $this->livraisonAdress;
  535.     }
  536.     public function setLivraisonAdress(?string $livraisonAdress): self
  537.     {
  538.         $this->livraisonAdress $livraisonAdress;
  539.         return $this;
  540.     }
  541.     public function getLivraisonZipCode(): ?string
  542.     {
  543.         return $this->livraisonZipCode;
  544.     }
  545.     public function setLivraisonZipCode(?string $livraisonZipCode): self
  546.     {
  547.         $this->livraisonZipCode $livraisonZipCode;
  548.         return $this;
  549.     }
  550.     public function getLivraisonCity(): ?string
  551.     {
  552.         return $this->livraisonCity;
  553.     }
  554.     public function setLivraisonCity(?string $livraisonCity): self
  555.     {
  556.         $this->livraisonCity $livraisonCity;
  557.         return $this;
  558.     }
  559.     public function getBirthAt(): ?\DateTimeInterface
  560.     {
  561.         return $this->birthAt;
  562.     }
  563.     public function setBirthAt(?\DateTimeInterface $birthAt): self
  564.     {
  565.         $this->birthAt $birthAt;
  566.         return $this;
  567.     }
  568.     public function getNationality(): ?string
  569.     {
  570.         return $this->nationality;
  571.     }
  572.     public function setNationality(?string $nationality): self
  573.     {
  574.         $this->nationality $nationality;
  575.         return $this;
  576.     }
  577.     public function getCountryResidence(): ?string
  578.     {
  579.         return $this->countryResidence;
  580.     }
  581.     public function setCountryResidence(?string $countryResidence): self
  582.     {
  583.         $this->countryResidence $countryResidence;
  584.         return $this;
  585.     }
  586.     public function getMangoId(): ?string
  587.     {
  588.         return $this->mangoId;
  589.     }
  590.     public function setMangoId(string $mangoId): self
  591.     {
  592.         $this->mangoId $mangoId;
  593.         return $this;
  594.     }
  595.     public function getIsValid(): ?bool
  596.     {
  597.         return $this->isValid;
  598.     }
  599.     public function setIsValid(?bool $isValid): self
  600.     {
  601.         $this->isValid $isValid;
  602.         return $this;
  603.     }
  604.     public function getServiceAddress(): ?string
  605.     {
  606.         return $this->serviceAddress;
  607.     }
  608.     public function setServiceAddress(?string $serviceAddress): self
  609.     {
  610.         $this->serviceAddress $serviceAddress;
  611.         return $this;
  612.     }
  613.     public function getServiceZipCode(): ?string
  614.     {
  615.         return $this->serviceZipCode;
  616.     }
  617.     public function setServiceZipCode(?string $serviceZipCode): self
  618.     {
  619.         $this->serviceZipCode $serviceZipCode;
  620.         return $this;
  621.     }
  622.     public function getServiceCity(): ?string
  623.     {
  624.         return $this->serviceCity;
  625.     }
  626.     public function setServiceCity(?string $serviceCity): self
  627.     {
  628.         $this->serviceCity $serviceCity;
  629.         return $this;
  630.     }
  631.     /**
  632.      * @return Collection|Annonce[]
  633.      */
  634.     public function getAnnonces(): Collection
  635.     {
  636.         return $this->annonces;
  637.     }
  638.     public function addAnnonce(Annonce $annonce): self
  639.     {
  640.         if (!$this->annonces->contains($annonce)) {
  641.             $this->annonces[] = $annonce;
  642.             $annonce->setUsers($this);
  643.         }
  644.         return $this;
  645.     }
  646.     public function removeAnnonce(Annonce $annonce): self
  647.     {
  648.         if ($this->annonces->removeElement($annonce)) {
  649.             // set the owning side to null (unless already changed)
  650.             if ($annonce->getUsers() === $this) {
  651.                 $annonce->setUsers(null);
  652.             }
  653.         }
  654.         return $this;
  655.     }
  656.     /**
  657.      * @return Collection|Location[]
  658.      */
  659.     public function getLocations(): Collection
  660.     {
  661.         return $this->locations;
  662.     }
  663.     public function addLocation(Location $location): self
  664.     {
  665.         if (!$this->locations->contains($location)) {
  666.             $this->locations[] = $location;
  667.             $location->setProduct($this);
  668.         }
  669.         return $this;
  670.     }
  671.     public function removeLocation(Location $location): self
  672.     {
  673.         if ($this->locations->removeElement($location)) {
  674.             // set the owning side to null (unless already changed)
  675.             if ($location->getProduct() === $this) {
  676.                 $location->setProduct(null);
  677.             }
  678.         }
  679.         return $this;
  680.     }
  681.     /**
  682.      * @return Collection|Reservation[]
  683.      */
  684.     public function getReservations(): Collection
  685.     {
  686.         return $this->reservations;
  687.     }
  688.     public function addReservation(Reservation $reservation): self
  689.     {
  690.         if (!$this->reservations->contains($reservation)) {
  691.             $this->reservations[] = $reservation;
  692.             $reservation->setClient($this);
  693.         }
  694.         return $this;
  695.     }
  696.     public function removeReservation(Reservation $reservation): self
  697.     {
  698.         if ($this->reservations->removeElement($reservation)) {
  699.             // set the owning side to null (unless already changed)
  700.             if ($reservation->getClient() === $this) {
  701.                 $reservation->setClient(null);
  702.             }
  703.         }
  704.         return $this;
  705.     }
  706.     /*public function getStatusUser(): ?bool
  707.     {
  708.         return $this->status_User;
  709.     }*/
  710.     public function getStatuCon(): ?bool
  711.     {
  712.         return $this->statuCon;
  713.     }
  714.     public function setStatuCon(?bool $statuCon): self
  715.     {
  716.         $this->statuCon $statuCon;
  717.         return $this;
  718.     }
  719.     public function getEtatNetwork(): ?\DateTimeInterface
  720.     {
  721.         return $this->etatNetwork;
  722.     }
  723.     public function setEtatNetwork(\DateTimeInterface $etatNetwork): self
  724.     {
  725.         $this->etatNetwork $etatNetwork;
  726.         return $this;
  727.     }
  728.     public function __toString()
  729.     {
  730.         return $this->getFirstName();
  731.     }
  732.     /**
  733.      * @return Collection|Caution[]
  734.      */
  735.     public function getCautions(): Collection
  736.     {
  737.         return $this->cautions;
  738.     }
  739.     public function addCaution(Caution $caution): self
  740.     {
  741.         if (!$this->cautions->contains($caution)) {
  742.             $this->cautions[] = $caution;
  743.             $caution->setUser($this);
  744.         }
  745.         return $this;
  746.     }
  747.     public function removeCaution(Caution $caution): self
  748.     {
  749.         if ($this->cautions->removeElement($caution)) {
  750.             // set the owning side to null (unless already changed)
  751.             if ($caution->getUser() === $this) {
  752.                 $caution->setUser(null);
  753.             }
  754.         }
  755.         return $this;
  756.     }
  757.     /**
  758.      * @return Collection|Message[]
  759.      */
  760.     public function getMessages(): Collection
  761.     {
  762.         return $this->messages;
  763.     }
  764.     public function addMessage(Message $message): self
  765.     {
  766.         if (!$this->messages->contains($message)) {
  767.             $this->messages[] = $message;
  768.             $message->setSender($this);
  769.         }
  770.         return $this;
  771.     }
  772.     public function removeMessage(Message $message): self
  773.     {
  774.         if ($this->messages->removeElement($message)) {
  775.             // set the owning side to null (unless already changed)
  776.             if ($message->getSender() === $this) {
  777.                 $message->setSender(null);
  778.             }
  779.         }
  780.         return $this;
  781.     }
  782.     /**
  783.      * @return Collection|Conversation[]
  784.      */
  785.     public function getConversations(): Collection
  786.     {
  787.         return $this->conversations;
  788.     }
  789.     public function addConversation(Conversation $conversation): self
  790.     {
  791.         if (!$this->conversations->contains($conversation)) {
  792.             $this->conversations[] = $conversation;
  793.             $conversation->setUtilisateur1($this);
  794.         }
  795.         return $this;
  796.     }
  797.     public function removeConversation(Conversation $conversation): self
  798.     {
  799.         if ($this->conversations->removeElement($conversation)) {
  800.             // set the owning side to null (unless already changed)
  801.             if ($conversation->getUtilisateur1() === $this) {
  802.                 $conversation->setUtilisateur1(null);
  803.             }
  804.         }
  805.         return $this;
  806.     }
  807.     /**
  808.      * @return Collection|Espace[]
  809.      */
  810.     public function getEspaces(): Collection
  811.     {
  812.         return $this->espaces;
  813.     }
  814.     public function addEspace(Espace $espace): self
  815.     {
  816.         if (!$this->espaces->contains($espace)) {
  817.             $this->espaces[] = $espace;
  818.             $espace->setPropriotaire($this);
  819.         }
  820.         return $this;
  821.     }
  822.     public function removeEspace(Espace $espace): self
  823.     {
  824.         if ($this->espaces->removeElement($espace)) {
  825.             // set the owning side to null (unless already changed)
  826.             if ($espace->getPropriotaire() === $this) {
  827.                 $espace->setPropriotaire(null);
  828.             }
  829.         }
  830.         return $this;
  831.     }
  832.     /**
  833.      * @return Collection|Publication[]
  834.      */
  835.     public function getPublications(): Collection
  836.     {
  837.         return $this->publications;
  838.     }
  839.     public function addPublication(Publication $publication): self
  840.     {
  841.         if (!$this->publications->contains($publication)) {
  842.             $this->publications[] = $publication;
  843.             $publication->setClient($this);
  844.         }
  845.         return $this;
  846.     }
  847.     public function removePublication(Publication $publication): self
  848.     {
  849.         if ($this->publications->removeElement($publication)) {
  850.             // set the owning side to null (unless already changed)
  851.             if ($publication->getClient() === $this) {
  852.                 $publication->setClient(null);
  853.             }
  854.         }
  855.         return $this;
  856.     }
  857.     /**
  858.      * @return Collection|Espace[]
  859.      */
  860.     public function getFollow(): Collection
  861.     {
  862.         return $this->follow;
  863.     }
  864.     public function addFollow(Espace $follow): self
  865.     {
  866.         if (!$this->follow->contains($follow)) {
  867.             $this->follow[] = $follow;
  868.         }
  869.         return $this;
  870.     }
  871.     public function removeFollow(Espace $follow): self
  872.     {
  873.         $this->follow->removeElement($follow);
  874.         return $this;
  875.     }
  876.     /**
  877.      * @return Collection|Comments[]
  878.      */
  879.     public function getComments(): Collection
  880.     {
  881.         return $this->comments;
  882.     }
  883.     public function addComment(Comments $comment): self
  884.     {
  885.         if (!$this->comments->contains($comment)) {
  886.             $this->comments[] = $comment;
  887.             $comment->setAuthor($this);
  888.         }
  889.         return $this;
  890.     }
  891.     public function removeComment(Comments $comment): self
  892.     {
  893.         if ($this->comments->removeElement($comment)) {
  894.             // set the owning side to null (unless already changed)
  895.             if ($comment->getAuthor() === $this) {
  896.                 $comment->setAuthor(null);
  897.             }
  898.         }
  899.         return $this;
  900.     }
  901.     /**
  902.      * @return Collection|Notifications[]
  903.      */
  904.     public function getNotifications(): Collection
  905.     {
  906.         return $this->notifications;
  907.     }
  908.     public function addNotification(Notifications $notification): self
  909.     {
  910.         if (!$this->notifications->contains($notification)) {
  911.             $this->notifications[] = $notification;
  912.             $notification->setUser($this);
  913.         }
  914.         return $this;
  915.     }
  916.     public function removeNotification(Notifications $notification): self
  917.     {
  918.         if ($this->notifications->removeElement($notification)) {
  919.             // set the owning side to null (unless already changed)
  920.             if ($notification->getUser() === $this) {
  921.                 $notification->setUser(null);
  922.             }
  923.         }
  924.         return $this;
  925.     }
  926.     /**
  927.      * @return Collection|PostLike[]
  928.      */
  929.     public function getLikes(): Collection
  930.     {
  931.         return $this->likes;
  932.     }
  933.     public function addLike(PostLike $like): self
  934.     {
  935.         if (!$this->likes->contains($like)) {
  936.             $this->likes[] = $like;
  937.             $like->setUser($this);
  938.         }
  939.         return $this;
  940.     }
  941.     public function removeLike(PostLike $like): self
  942.     {
  943.         if ($this->likes->removeElement($like)) {
  944.             // set the owning side to null (unless already changed)
  945.             if ($like->getUser() === $this) {
  946.                 $like->setUser(null);
  947.             }
  948.         }
  949.         return $this;
  950.     }
  951.     /**
  952.      * @return Collection|SharePost[]
  953.      */
  954.     public function getShare(): Collection
  955.     {
  956.         return $this->share;
  957.     }
  958.     public function addShare(SharePost $share): self
  959.     {
  960.         if (!$this->share->contains($share)) {
  961.             $this->share[] = $share;
  962.             $share->setAuthor($this);
  963.         }
  964.         return $this;
  965.     }
  966.     public function removeShare(SharePost $share): self
  967.     {
  968.         if ($this->share->removeElement($share)) {
  969.             // set the owning side to null (unless already changed)
  970.             if ($share->getAuthor() === $this) {
  971.                 $share->setAuthor(null);
  972.             }
  973.         }
  974.         return $this;
  975.     }
  976.     /**
  977.      * @return Collection<int, PendingLocation>
  978.      */
  979.     public function getPendingLocations(): Collection
  980.     {
  981.         return $this->pendingLocations;
  982.     }
  983.     public function addPendingLocation(PendingLocation $pendingLocation): self
  984.     {
  985.         if (!$this->pendingLocations->contains($pendingLocation)) {
  986.             $this->pendingLocations[] = $pendingLocation;
  987.             $pendingLocation->setUser($this);
  988.         }
  989.         return $this;
  990.     }
  991.     public function removePendingLocation(PendingLocation $pendingLocation): self
  992.     {
  993.         if ($this->pendingLocations->removeElement($pendingLocation)) {
  994.             // set the owning side to null (unless already changed)
  995.             if ($pendingLocation->getUser() === $this) {
  996.                 $pendingLocation->setUser(null);
  997.             }
  998.         }
  999.         return $this;
  1000.     }
  1001.     /**
  1002.      * @return Collection<int, PendingReservation>
  1003.      */
  1004.     public function getPendingReservations(): Collection
  1005.     {
  1006.         return $this->pendingReservations;
  1007.     }
  1008.     public function addPendingReservation(PendingReservation $pendingReservation): self
  1009.     {
  1010.         if (!$this->pendingReservations->contains($pendingReservation)) {
  1011.             $this->pendingReservations[] = $pendingReservation;
  1012.             $pendingReservation->setUser($this);
  1013.         }
  1014.         return $this;
  1015.     }
  1016.     public function removePendingReservation(PendingReservation $pendingReservation): self
  1017.     {
  1018.         if ($this->pendingReservations->removeElement($pendingReservation)) {
  1019.             // set the owning side to null (unless already changed)
  1020.             if ($pendingReservation->getUser() === $this) {
  1021.                 $pendingReservation->setUser(null);
  1022.             }
  1023.         }
  1024.         return $this;
  1025.     }
  1026.     /**
  1027.      * @return Collection<int, Notification>
  1028.      */
  1029.     public function getNotificationReservation(): Collection
  1030.     {
  1031.         return $this->notificationReservation;
  1032.     }
  1033.     public function addNotificationReservation(Notification $notificationReservation): self
  1034.     {
  1035.         if (!$this->notificationReservation->contains($notificationReservation)) {
  1036.             $this->notificationReservation[] = $notificationReservation;
  1037.             $notificationReservation->setCustomer($this);
  1038.         }
  1039.         return $this;
  1040.     }
  1041.     public function removeNotificationReservation(Notification $notificationReservation): self
  1042.     {
  1043.         if ($this->notificationReservation->removeElement($notificationReservation)) {
  1044.             // set the owning side to null (unless already changed)
  1045.             if ($notificationReservation->getCustomer() === $this) {
  1046.                 $notificationReservation->setCustomer(null);
  1047.             }
  1048.         }
  1049.         return $this;
  1050.     }
  1051. }