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