src/Entity/User.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Serializable;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Repository\UserRepository;
  6. use Doctrine\ORM\Mapping\InheritanceType;
  7. use Doctrine\ORM\Mapping\DiscriminatorMap;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping\DiscriminatorColumn;
  10. use Doctrine\Common\Collections\ArrayCollection;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. use Symfony\Component\Security\Core\User\UserInterface;
  13. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  14. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  15. #[ORM\Entity(repositoryClassUserRepository::class)]
  16. #[UniqueEntity(fields: ['email'], message'Un compte existe déjà avec cet email')]
  17. #[InheritanceType('JOINED')]
  18. #[DiscriminatorColumn(name'type'type'string')]
  19. #[DiscriminatorMap(['coach' => 'Coach''club' => 'Club''operator' => 'Operator''user' => 'User''trainee' => 'Trainee''admin' => 'Admin'])]
  20. abstract class User implements UserInterfacePasswordAuthenticatedUserInterface
  21. {
  22.     #[ORM\Id]
  23.     #[ORM\GeneratedValue]
  24.     #[ORM\Column(type'integer')]
  25.     private $id;
  26.     #[ORM\Column(type'string'length255)]
  27.     private $firstname;
  28.     #[ORM\Column(type'string'length255)]
  29.     private $lastname;
  30.     #[ORM\Column(type'string'length50nullabletrue)]
  31.     private $telephone;
  32.     #[ORM\Column(type'string'length180uniquetrue)]
  33.     private $email;
  34.     /**
  35.      * @var string The hashed password
  36.      */
  37.     #[ORM\Column(type'string')]
  38.     private $password;
  39.     #[ORM\Column(type'boolean')]
  40.     private $activated;
  41.     #[ORM\Column(type'boolean')]
  42.     private $notification;
  43.     #[ORM\OneToOne(targetEntityAddress::class, inversedBy'owner'cascade: ['persist''remove'])]
  44.     private $address;
  45.     #[ORM\Column(type'datetime'nullabletrue)]
  46.     private $registeredAt;
  47.     #[ORM\Column(type'string'length255)]
  48.     private $token;
  49.     #[ORM\ManyToMany(targetEntityRole::class, inversedBy'users')]
  50.     private $userRoles;
  51.     #[ORM\Column(type'string'length255)]
  52.     private $photo;
  53.     #[ORM\Column(type'string'length255)]
  54.     private $slug;
  55.     #[ORM\Column(type'boolean')]
  56.     private $isPro;
  57.     #[ORM\OneToMany(targetEntitySubscription::class, mappedBy'pro')]
  58.     private $subscriptions;
  59.     #[ORM\OneToMany(targetEntityCourse::class, mappedBy'owner')]
  60.     private $courses;
  61.     #[ORM\OneToOne(targetEntityProInfo::class, inversedBy'pro'cascade: ['persist''remove'])]
  62.     private $proInfo;
  63.     #[ORM\Column(type'boolean'nullabletrue)]
  64.     private $hasAccess;
  65.     #[ORM\ManyToMany(targetEntityLanguage::class, inversedBy'users')]
  66.     private $languages;
  67.     #[ORM\OneToOne(targetEntityStripeInfo::class, inversedBy'user'cascade: ['persist''remove'])]
  68.     private $stripeInfo;
  69.     #[ORM\OneToMany(targetEntityMessage::class, mappedBy'sender')]
  70.     private $sentMessages;
  71.     #[ORM\OneToMany(targetEntityParticipant::class, mappedBy'user')]
  72.     private $participations;
  73.     #[ORM\OneToMany(targetEntityConversation::class, mappedBy'trainee')]
  74.     private $traineeConversations;
  75.     #[ORM\OneToMany(targetEntityConversation::class, mappedBy'pro')]
  76.     private $proConversations;
  77.     #[ORM\OneToMany(targetEntityProViewsStat::class, mappedBy'pro'orphanRemovaltrue)]
  78.     private $proViewsStats;
  79.     #[ORM\Column(type'string'length255)]
  80.     private $status;
  81.     #[ORM\Column(type'boolean')]
  82.     private $hasAcceptedTerms;
  83.     #[ORM\ManyToMany(targetEntityTrainee::class, mappedBy'proFavorites')]
  84.     private $traineesFavorites;
  85.     #[ORM\OneToMany(targetEntityInvoice::class, mappedBy'pro')]
  86.     private $invoices;
  87.     #[ORM\Column(type'boolean'nullabletrue)]
  88.     private $isAmbassador;
  89.     #[ORM\Column(type'string'length255)]
  90.     private $language;
  91.     #[ORM\OneToMany(targetEntityAddress::class, mappedBy'pro'orphanRemovaltrue)]
  92.     private $areas;
  93.     #[ORM\Column(length255nullabletrue)]
  94.     private ?string $timezone null;
  95.     #[ORM\Column(length255nullabletrue)]
  96.     private ?string $phoneCode null;
  97.     #[ORM\Column(nullabletrue)]
  98.     private ?bool $newsletter null;
  99.     #[ORM\OneToMany(mappedBy'pro'targetEntityProDescription::class)]
  100.     private Collection $proDescriptions;
  101.     #[ORM\ManyToMany(targetEntityNote::class, mappedBy'associatedPros')]
  102.     private Collection $notes;
  103.     #[ORM\OneToMany(mappedBy'pro'targetEntityNoteRequest::class)]
  104.     private Collection $noteRequests;
  105.     public function __construct()
  106.     {
  107.         $this->userRoles = new ArrayCollection();
  108.         $this->subscriptions = new ArrayCollection();
  109.         $this->courses = new ArrayCollection();
  110.         $this->languages = new ArrayCollection();
  111.         $this->sentMessages = new ArrayCollection();
  112.         $this->participations = new ArrayCollection();
  113.         $this->traineeConversations = new ArrayCollection();
  114.         $this->proConversations = new ArrayCollection();
  115.         $this->proViewsStats = new ArrayCollection();
  116.         $this->traineesFavorites = new ArrayCollection();
  117.         $this->invoices = new ArrayCollection();
  118.         $this->areas = new ArrayCollection();
  119.         $this->proDescriptions = new ArrayCollection();
  120.         $this->notes = new ArrayCollection();
  121.         $this->noteRequests = new ArrayCollection();
  122.     }
  123.     //Getters and Setters
  124.     public function getId(): ?int
  125.     {
  126.         return $this->id;
  127.     }
  128.     public function fullname() {
  129.         return $this->firstname ' ' $this->lastname;
  130.     }
  131.     public function getProType() {
  132.         if ($this instanceof Coach) {
  133.             $type 'coach';
  134.         } else if ($this instanceof Club) {
  135.             $type 'club';
  136.         } else {
  137.             $type 'operator';
  138.         }
  139.         return $type;
  140.     }
  141.     public function getCurrentSubscription() {
  142.         return $this->subscriptions->last() ?? null;
  143.     }
  144.     /**
  145.      * Get the value of firstname
  146.      */ 
  147.     public function getFirstname()
  148.     {
  149.         return $this->firstname;
  150.     }
  151.     /**
  152.      * Set the value of firstname
  153.      *
  154.      * @return  self
  155.      */ 
  156.     public function setFirstname($firstname)
  157.     {
  158.         $this->firstname $firstname;
  159.         return $this;
  160.     }
  161.     /**
  162.      * Get the value of lastname
  163.      */ 
  164.     public function getLastname()
  165.     {
  166.         return $this->lastname;
  167.     }
  168.     /**
  169.      * Set the value of lastname
  170.      *
  171.      * @return  self
  172.      */ 
  173.     public function setLastname($lastname)
  174.     {
  175.         $this->lastname $lastname;
  176.         return $this;
  177.     }
  178.     /**
  179.      * Get the value of telephone
  180.      */ 
  181.     public function getTelephone()
  182.     {
  183.         return $this->telephone;
  184.     }
  185.     /**
  186.      * Set the value of telephone
  187.      *
  188.      * @return  self
  189.      */ 
  190.     public function setTelephone($telephone)
  191.     {
  192.         $this->telephone $telephone;
  193.         return $this;
  194.     }
  195.     public function getEmail(): ?string
  196.     {
  197.         return $this->email;
  198.     }
  199.     public function setEmail(string $email): self
  200.     {
  201.         $this->email $email;
  202.         return $this;
  203.     }
  204.     /**
  205.      * @see UserInterface
  206.      */
  207.     public function getPassword(): string
  208.     {
  209.         return (string) $this->password;
  210.     }
  211.     public function setPassword(string $password): self
  212.     {
  213.         $this->password $password;
  214.         return $this;
  215.     }
  216.     /**
  217.      * Get the value of activated
  218.      */ 
  219.     public function getActivated()
  220.     {
  221.         return $this->activated;
  222.     }
  223.     /**
  224.      * Set the value of activated
  225.      *
  226.      * @return  self
  227.      */ 
  228.     public function setActivated($activated)
  229.     {
  230.         $this->activated $activated;
  231.         return $this;
  232.     }
  233.     /**
  234.      * Get the value of notification
  235.      */ 
  236.     public function getNotification()
  237.     {
  238.         return $this->notification;
  239.     }
  240.     /**
  241.      * Set the value of notification
  242.      *
  243.      * @return  self
  244.      */ 
  245.     public function setNotification($notification)
  246.     {
  247.         $this->notification $notification;
  248.         return $this;
  249.     }
  250.     public function getAddress(): ?Address
  251.     {
  252.         return $this->address;
  253.     }
  254.     public function setAddress(?Address $address): self
  255.     {
  256.         $this->address $address;
  257.         return $this;
  258.     }
  259.     public function getRegisteredAt(): ?\DateTimeInterface
  260.     {
  261.         return $this->registeredAt;
  262.     }
  263.     public function setRegisteredAt(?\DateTimeInterface $registeredAt): self
  264.     {
  265.         $this->registeredAt $registeredAt;
  266.         return $this;
  267.     }
  268.     public function getToken(): ?string
  269.     {
  270.         return $this->token;
  271.     }
  272.     public function setToken(string $token): self
  273.     {
  274.         $this->token $token;
  275.         return $this;
  276.     }
  277.     public function getSalt(){}
  278.     public function eraseCredentials(){}
  279.     public function getRoles()
  280.     {
  281.         $roles $this->userRoles->map(function($role){
  282.             return $role->getTitle();
  283.         })->toArray();
  284.         $roles[] = 'ROLE_USER';
  285.         return $roles;
  286.     }
  287.     /**
  288.      * A visual identifier that represents this user.
  289.      *
  290.      * @see UserInterface
  291.      */
  292.     public function getUsername()
  293.     {
  294.         return $this->email;
  295.     }
  296.     /**
  297.      * @return Collection|Role[]
  298.      */
  299.     public function getUserRoles(): Collection
  300.     {
  301.         return $this->userRoles;
  302.     }
  303.     public function addUserRole(Role $userRole): self
  304.     {
  305.         if ($this->userRoles == null || !$this->userRoles->contains($userRole)) {
  306.             $this->userRoles[] = $userRole;
  307.         }
  308.         return $this;
  309.     }
  310.     public function removeUserRole(Role $userRole): self
  311.     {
  312.         $this->userRoles->removeElement($userRole);
  313.         return $this;
  314.     }
  315.     public function getPhoto()
  316.     {
  317.         return $this->photo;
  318.     }
  319.     public function setPhoto($photo): self
  320.     {
  321.         $this->photo $photo;
  322.         return $this;
  323.     }
  324.     public function getSlug(): ?string
  325.     {
  326.         return $this->slug;
  327.     }
  328.     public function setSlug(string $slug): self
  329.     {
  330.         $this->slug $slug;
  331.         return $this;
  332.     }
  333.     public function getIsPro(): ?bool
  334.     {
  335.         return $this->isPro;
  336.     }
  337.     public function setIsPro(bool $isPro): self
  338.     {
  339.         $this->isPro $isPro;
  340.         return $this;
  341.     }
  342.     /**
  343.      * @return Collection|Subscription[]
  344.      */
  345.     public function getSubscriptions(): Collection
  346.     {
  347.         return $this->subscriptions;
  348.     }
  349.     public function addSubscription(Subscription $subscription): self
  350.     {
  351.         if (!$this->subscriptions->contains($subscription)) {
  352.             $this->subscriptions[] = $subscription;
  353.             $subscription->setPro($this);
  354.         }
  355.         return $this;
  356.     }
  357.     public function removeSubscription(Subscription $subscription): self
  358.     {
  359.         if ($this->subscriptions->removeElement($subscription)) {
  360.             // set the owning side to null (unless already changed)
  361.             if ($subscription->getPro() === $this) {
  362.                 $subscription->setPro(null);
  363.             }
  364.         }
  365.         return $this;
  366.     }
  367.     /**
  368.      * @return Collection|Course[]
  369.      */
  370.     public function getCourses(): Collection
  371.     {
  372.         return $this->courses;
  373.     }
  374.     public function addCourse(Course $course): self
  375.     {
  376.         if (!$this->courses->contains($course)) {
  377.             $this->courses[] = $course;
  378.             $course->setOwner($this);
  379.         }
  380.         return $this;
  381.     }
  382.     public function removeCourse(Course $course): self
  383.     {
  384.         if ($this->courses->removeElement($course)) {
  385.             // set the owning side to null (unless already changed)
  386.             if ($course->getOwner() === $this) {
  387.                 $course->setOwner(null);
  388.             }
  389.         }
  390.         return $this;
  391.     }
  392.     public function getProInfo(): ?ProInfo
  393.     {
  394.         return $this->proInfo;
  395.     }
  396.     public function setProInfo(?ProInfo $proInfo): self
  397.     {
  398.         $this->proInfo $proInfo;
  399.         return $this;
  400.     }
  401.     public function getHasAccess(): ?bool
  402.     {
  403.         return $this->hasAccess;
  404.     }
  405.     public function setHasAccess(bool $hasAccess): self
  406.     {
  407.         $this->hasAccess $hasAccess;
  408.         return $this;
  409.     }
  410.     /**
  411.      * @return Collection|Language[]
  412.      */
  413.     public function getLanguages(): Collection
  414.     {
  415.         return $this->languages;
  416.     }
  417.     public function addLanguage(Language $language): self
  418.     {
  419.         if (!$this->languages->contains($language)) {
  420.             $this->languages[] = $language;
  421.         }
  422.         return $this;
  423.     }
  424.     public function removeLanguage(Language $language): self
  425.     {
  426.         $this->languages->removeElement($language);
  427.         return $this;
  428.     }
  429.     public function getStripeInfo(): ?StripeInfo
  430.     {
  431.         return $this->stripeInfo;
  432.     }
  433.     public function setStripeInfo(?StripeInfo $stripeInfo): self
  434.     {
  435.         $this->stripeInfo $stripeInfo;
  436.         return $this;
  437.     }
  438.     /**
  439.      * @return Collection|Message[]
  440.      */
  441.     public function getSentMessages(): Collection
  442.     {
  443.         return $this->sentMessages;
  444.     }
  445.     public function addSentMessage(Message $sentMessage): self
  446.     {
  447.         if (!$this->sentMessages->contains($sentMessage)) {
  448.             $this->sentMessages[] = $sentMessage;
  449.             $sentMessage->setSender($this);
  450.         }
  451.         return $this;
  452.     }
  453.     public function removeSentMessage(Message $sentMessage): self
  454.     {
  455.         if ($this->sentMessages->removeElement($sentMessage)) {
  456.             // set the owning side to null (unless already changed)
  457.             if ($sentMessage->getSender() === $this) {
  458.                 $sentMessage->setSender(null);
  459.             }
  460.         }
  461.         return $this;
  462.     }
  463.     /**
  464.      * @return Collection|Participant[]
  465.      */
  466.     public function getParticipations(): Collection
  467.     {
  468.         return $this->participations;
  469.     }
  470.     public function addParticipation(Participant $participation): self
  471.     {
  472.         if (!$this->participations->contains($participation)) {
  473.             $this->participations[] = $participation;
  474.             $participation->setUser($this);
  475.         }
  476.         return $this;
  477.     }
  478.     public function removeParticipation(Participant $participation): self
  479.     {
  480.         if ($this->participations->removeElement($participation)) {
  481.             // set the owning side to null (unless already changed)
  482.             if ($participation->getUser() === $this) {
  483.                 $participation->setUser(null);
  484.             }
  485.         }
  486.         return $this;
  487.     }
  488.     /**
  489.      * @return Collection|Conversation[]
  490.      */
  491.     public function getTraineeConversations(): Collection
  492.     {
  493.         return $this->traineeConversations;
  494.     }
  495.     public function addTraineeConversation(Conversation $traineeConversation): self
  496.     {
  497.         if (!$this->traineeConversations->contains($traineeConversation)) {
  498.             $this->traineeConversations[] = $traineeConversation;
  499.             $traineeConversation->setTrainee($this);
  500.         }
  501.         return $this;
  502.     }
  503.     public function removeTraineeConversation(Conversation $traineeConversation): self
  504.     {
  505.         if ($this->traineeConversations->removeElement($traineeConversation)) {
  506.             // set the owning side to null (unless already changed)
  507.             if ($traineeConversation->getTrainee() === $this) {
  508.                 $traineeConversation->setTrainee(null);
  509.             }
  510.         }
  511.         return $this;
  512.     }
  513.     /**
  514.      * @return Collection|Conversation[]
  515.      */
  516.     public function getProConversations(): Collection
  517.     {
  518.         return $this->proConversations;
  519.     }
  520.     public function addProConversation(Conversation $proConversation): self
  521.     {
  522.         if (!$this->proConversations->contains($proConversation)) {
  523.             $this->proConversations[] = $proConversation;
  524.             $proConversation->setPro($this);
  525.         }
  526.         return $this;
  527.     }
  528.     public function removeProConversation(Conversation $proConversation): self
  529.     {
  530.         if ($this->proConversations->removeElement($proConversation)) {
  531.             // set the owning side to null (unless already changed)
  532.             if ($proConversation->getPro() === $this) {
  533.                 $proConversation->setPro(null);
  534.             }
  535.         }
  536.         return $this;
  537.     }
  538.     /**
  539.      * @return Collection|ProViewsStat[]
  540.      */
  541.     public function getProViewsStats(): Collection
  542.     {
  543.         return $this->proViewsStats;
  544.     }
  545.     public function addProViewsStat(ProViewsStat $proViewsStat): self
  546.     {
  547.         if (!$this->proViewsStats->contains($proViewsStat)) {
  548.             $this->proViewsStats[] = $proViewsStat;
  549.             $proViewsStat->setPro($this);
  550.         }
  551.         return $this;
  552.     }
  553.     public function removeProViewsStat(ProViewsStat $proViewsStat): self
  554.     {
  555.         if ($this->proViewsStats->removeElement($proViewsStat)) {
  556.             // set the owning side to null (unless already changed)
  557.             if ($proViewsStat->getPro() === $this) {
  558.                 $proViewsStat->setPro(null);
  559.             }
  560.         }
  561.         return $this;
  562.     }
  563.     public function getStatus(): ?string
  564.     {
  565.         return $this->status;
  566.     }
  567.     public function setStatus(string $status): self
  568.     {
  569.         $this->status $status;
  570.         return $this;
  571.     }
  572.     public function getHasAcceptedTerms(): ?bool
  573.     {
  574.         return $this->hasAcceptedTerms;
  575.     }
  576.     public function setHasAcceptedTerms(bool $hasAcceptedTerms): self
  577.     {
  578.         $this->hasAcceptedTerms $hasAcceptedTerms;
  579.         return $this;
  580.     }
  581.     /**
  582.      * @return Collection|Trainee[]
  583.      */
  584.     public function getTraineesFavorites(): Collection
  585.     {
  586.         return $this->traineesFavorites;
  587.     }
  588.     public function addTraineesFavorite(Trainee $traineesFavorite): self
  589.     {
  590.         if (!$this->traineesFavorites->contains($traineesFavorite)) {
  591.             $this->traineesFavorites[] = $traineesFavorite;
  592.             $traineesFavorite->addProFavorite($this);
  593.         }
  594.         return $this;
  595.     }
  596.     public function removeTraineesFavorite(Trainee $traineesFavorite): self
  597.     {
  598.         if ($this->traineesFavorites->removeElement($traineesFavorite)) {
  599.             $traineesFavorite->removeProFavorite($this);
  600.         }
  601.         return $this;
  602.     }
  603.     /**
  604.      * @return Collection|Invoice[]
  605.      */
  606.     public function getInvoices(): Collection
  607.     {
  608.         return $this->invoices;
  609.     }
  610.     public function addInvoice(Invoice $invoice): self
  611.     {
  612.         if (!$this->invoices->contains($invoice)) {
  613.             $this->invoices[] = $invoice;
  614.             $invoice->setPro($this);
  615.         }
  616.         return $this;
  617.     }
  618.     public function removeInvoice(Invoice $invoice): self
  619.     {
  620.         if ($this->invoices->removeElement($invoice)) {
  621.             // set the owning side to null (unless already changed)
  622.             if ($invoice->getPro() === $this) {
  623.                 $invoice->setPro(null);
  624.             }
  625.         }
  626.         return $this;
  627.     }
  628.     public function getIsAmbassador(): ?bool
  629.     {
  630.         return $this->isAmbassador;
  631.     }
  632.     public function setIsAmbassador(?bool $isAmbassador): self
  633.     {
  634.         $this->isAmbassador $isAmbassador;
  635.         return $this;
  636.     }
  637.     public function getLanguage(): ?string
  638.     {
  639.         return $this->language;
  640.     }
  641.     public function setLanguage(string $language): self
  642.     {
  643.         $this->language $language;
  644.         return $this;
  645.     }
  646.     /**
  647.      * @return Collection<int, Address>
  648.      */
  649.     public function getAreas(): Collection
  650.     {
  651.         return $this->areas;
  652.     }
  653.     public function addArea(Address $area): self
  654.     {
  655.         if (!$this->areas->contains($area)) {
  656.             $this->areas[] = $area;
  657.             $area->setPro($this);
  658.         }
  659.         return $this;
  660.     }
  661.     public function removeArea(Address $area): self
  662.     {
  663.         if ($this->areas->removeElement($area)) {
  664.             // set the owning side to null (unless already changed)
  665.             if ($area->getPro() === $this) {
  666.                 $area->setPro(null);
  667.             }
  668.         }
  669.         return $this;
  670.     }
  671.     public function getTimezone(): ?string
  672.     {
  673.         return $this->timezone;
  674.     }
  675.     public function setTimezone(?string $timezone): static
  676.     {
  677.         $this->timezone $timezone;
  678.         return $this;
  679.     }
  680.     public function getPhoneCode(): ?string
  681.     {
  682.         return $this->phoneCode;
  683.     }
  684.     public function setPhoneCode(?string $phoneCode): static
  685.     {
  686.         $this->phoneCode $phoneCode;
  687.         return $this;
  688.     }
  689.     public function getNewsletter(): ?bool
  690.     {
  691.         return $this->newsletter;
  692.     }
  693.     public function setNewsletter(?bool $newsletter): static
  694.     {
  695.         $this->newsletter $newsletter;
  696.         return $this;
  697.     }
  698.     /**
  699.      * @return Collection<int, ProDescription>
  700.      */
  701.     public function getProDescriptions(): Collection
  702.     {
  703.         return $this->proDescriptions;
  704.     }
  705.     public function addProDescription(ProDescription $proDescription): static
  706.     {
  707.         if (!$this->proDescriptions->contains($proDescription)) {
  708.             $this->proDescriptions->add($proDescription);
  709.             $proDescription->setPro($this);
  710.         }
  711.         return $this;
  712.     }
  713.     public function removeProDescription(ProDescription $proDescription): static
  714.     {
  715.         if ($this->proDescriptions->removeElement($proDescription)) {
  716.             // set the owning side to null (unless already changed)
  717.             if ($proDescription->getPro() === $this) {
  718.                 $proDescription->setPro(null);
  719.             }
  720.         }
  721.         return $this;
  722.     }
  723.     /**
  724.      * @return Collection<int, Note>
  725.      */
  726.     public function getNotes(): Collection
  727.     {
  728.         return $this->notes;
  729.     }
  730.     public function addNote(Note $note): static
  731.     {
  732.         if (!$this->notes->contains($note)) {
  733.             $this->notes->add($note);
  734.             $note->addAssociatedPro($this);
  735.         }
  736.         return $this;
  737.     }
  738.     public function removeNote(Note $note): static
  739.     {
  740.         if ($this->notes->removeElement($note)) {
  741.             $note->removeAssociatedPro($this);
  742.         }
  743.         return $this;
  744.     }
  745.     /**
  746.      * @return Collection<int, NoteRequest>
  747.      */
  748.     public function getNoteRequests(): Collection
  749.     {
  750.         return $this->noteRequests;
  751.     }
  752.     public function addNoteRequest(NoteRequest $noteRequest): static
  753.     {
  754.         if (!$this->noteRequests->contains($noteRequest)) {
  755.             $this->noteRequests->add($noteRequest);
  756.             $noteRequest->setPro($this);
  757.         }
  758.         return $this;
  759.     }
  760.     public function removeNoteRequest(NoteRequest $noteRequest): static
  761.     {
  762.         if ($this->noteRequests->removeElement($noteRequest)) {
  763.             // set the owning side to null (unless already changed)
  764.             if ($noteRequest->getPro() === $this) {
  765.                 $noteRequest->setPro(null);
  766.             }
  767.         }
  768.         return $this;
  769.     }
  770. }