src/Entity/User.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. use Symfony\Component\Security\Core\User\UserInterface;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * @ORM\Entity(repositoryClass="App\Repository\UserRepository")
  11.  * @UniqueEntity(fields={"username"}, message="There is already an account with this username")
  12.  */
  13. class User implements UserInterface
  14. {
  15.     /**
  16.      * @ORM\Id()
  17.      * @ORM\GeneratedValue()
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     private $username;
  25.     /**
  26.      * @ORM\Column(type="string", length=255)
  27.      */
  28.     private $password;
  29.     /**
  30.      * @ORM\Column(type="integer", nullable=true)
  31.      */
  32.     private $niveau;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      */
  36.     private $name;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true, unique=true)
  39.      */
  40.     private $matricule;
  41.     /**
  42.      * @var array
  43.      *
  44.      * @ORM\Column(type="array")
  45.      */
  46.     private $roles;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity="App\Entity\PlaceDeMarche", mappedBy="user")
  49.      */
  50.     private $placeDeMarches;
  51.     /**
  52.      * @ORM\OneToMany(targetEntity="App\Entity\TraitementDsDemdDachat", mappedBy="user")
  53.      */
  54.     private $traitementDsDemdDachats;
  55.     /**
  56.      * @ORM\Column(type="string", length=255, nullable=true)
  57.      */
  58.     private $email_pro;
  59.     /**
  60.      * @ORM\Column(type="string", length=255, nullable=true)
  61.      */
  62.     private $fonction;
  63.     /**
  64.      * @ORM\Column(type="datetime", nullable=true)
  65.      */
  66.     private $entry_at;
  67.     /**
  68.      * @ORM\Column(type="string", length=255, nullable=true)
  69.      */
  70.     private $prenoms;
  71.     /**
  72.      * @ORM\ManyToOne(targetEntity="App\Entity\UserStatus", inversedBy="users")
  73.      */
  74.     private $status;
  75.     /**
  76.      * @ORM\OneToMany(targetEntity="App\Entity\AdminDonneurOrdre", mappedBy="lead")
  77.      */
  78.     private $adminDonneurOrdres;
  79.     /**
  80.      * @ORM\OneToMany(targetEntity="App\Entity\AdminDonneurOrdre", mappedBy="suivi_par")
  81.      */
  82.     private $adminDonneurOrdres_suivi;
  83.     /**
  84.      * @ORM\OneToMany(targetEntity="App\Entity\LeveeDeFond", mappedBy="suvi_par")
  85.      */
  86.     private $leveeDeFonds;
  87.     /**
  88.      * @ORM\Column(type="datetime", nullable=true)
  89.      */
  90.     private $date_sortie;
  91.     /**
  92.      * @ORM\OneToMany(targetEntity="App\Entity\LetterOfIntentToPurchase", mappedBy="agent")
  93.      */
  94.     private $letterOfIntentToPurchases;
  95.      /**
  96.      * @ORM\OneToMany(targetEntity="App\Entity\LetterOfIntentToPurchase", mappedBy="suivipar")
  97.      */
  98.     private $suivipars;
  99.     /**
  100.      * @ORM\OneToMany(targetEntity="App\Entity\Document", mappedBy="redacteur")
  101.      */
  102.     private $documents;
  103.     /**
  104.      * @ORM\OneToMany(targetEntity="App\Entity\Document", mappedBy="approuverPar")
  105.      */
  106.     private $documentApprouves;
  107.     /**
  108.      * @ORM\OneToMany(targetEntity="App\Entity\TraitementDsDemdDachat", mappedBy="agent")
  109.      */
  110.     private $agent;
  111.     /**
  112.      * @ORM\OneToMany(targetEntity="App\Entity\DemandeDeCotation", mappedBy="user")
  113.      */
  114.     private $demandeDeCotations;
  115.     /**
  116.      * @ORM\OneToMany(targetEntity="App\Entity\Prospect", mappedBy="suiviPar")
  117.      */
  118.     private $prospects;
  119.     /**
  120.      * @ORM\OneToMany(targetEntity="App\Entity\RequeteDeFinancement", mappedBy="user")
  121.      */
  122.     private $requeteDeFinancements;
  123.     /**
  124.      * @ORM\OneToMany(targetEntity="App\Entity\Visiteur", mappedBy="user")
  125.      */
  126.     private $visiteurs;
  127.     /**
  128.      * @ORM\OneToMany(targetEntity="App\Entity\Abonne", mappedBy="user")
  129.      */
  130.     private $abonnes;
  131.     public function __construct()
  132.     {
  133.         $this->matricule 'BSCM' random_int(101000) . date('s');
  134.         $this->niveau "0";
  135.         $this->placeDeMarches = new ArrayCollection();
  136.         $this->traitementDsDemdDachats = new ArrayCollection();
  137.         $this->adminDonneurOrdres = new ArrayCollection();
  138.         $this->adminDonneurOrdres_suivi = new ArrayCollection();
  139.         $this->leveeDeFonds = new ArrayCollection();
  140.         $this->letterOfIntentToPurchases = new ArrayCollection();
  141.         $this->agent = new ArrayCollection();
  142.         $this->demandeDeCotations = new ArrayCollection();
  143.         $this->prospects = new ArrayCollection();
  144.         $this->visiteurs = new ArrayCollection();
  145.         $this->abonnes = new ArrayCollection();
  146.         $this->requeteDeFinancements = new ArrayCollection();
  147.         $this->suivipars = new ArrayCollection();
  148.         $this->documents = new ArrayCollection();
  149.         $this->documentApprouves = new ArrayCollection();
  150.     }
  151.     public function getId(): ?int
  152.     {
  153.         return $this->id;
  154.     }
  155.     public function getUsername(): ?string
  156.     {
  157.         return $this->username;
  158.     }
  159.     public function setUsername(string $username): self
  160.     {
  161.         $this->username $username;
  162.         return $this;
  163.     }
  164.     public function getPassword(): ?string
  165.     {
  166.         return $this->password;
  167.     }
  168.     public function setPassword(string $password): self
  169.     {
  170.         $this->password $password;
  171.         return $this;
  172.     }
  173.     /**
  174.      * Returns the roles granted to the user.
  175.      *
  176.      *     public function getRoles()
  177.      *     {
  178.      *         return ['ROLE_USER'];
  179.      *     }
  180.      *
  181.      * Alternatively, the roles might be stored on a ``roles`` property,
  182.      * and populated in any number of different ways when the user object
  183.      * is created.
  184.      *
  185.      * @return (Role|string)[] The user roles
  186.      */
  187.     /**
  188.      * @return (Role|string)[]
  189.      */
  190.     public function getRoles(): array
  191.     {
  192.         // TODO: Implement getRoles() method.
  193.         // return ['ROLE_ADMIN','ROLE_USER','ROLE_SUPER_ADMIN'];
  194.         return ['ROLE_USER'];
  195.     }
  196.     /**
  197.      * @param array $roles
  198.      * @return User
  199.      */
  200.     public function setRoles(array $roles): User
  201.     {
  202.         $this->roles $roles;
  203.         return $this;
  204.     }
  205.     /**
  206.      * Returns the salt that was originally used to encode the password.
  207.      *
  208.      * This can return null if the password was not encoded using a salt.
  209.      *
  210.      * @return string|null The salt
  211.      */
  212.     public function getSalt()
  213.     {
  214.         // TODO: Implement getSalt() method.
  215.         return null;
  216.     }
  217.     /**
  218.      * Removes sensitive data from the user.
  219.      *
  220.      * This is important if, at any given point, sensitive information like
  221.      * the plain-text password is stored on this object.
  222.      */
  223.     public function eraseCredentials()
  224.     {
  225.         // TODO: Implement eraseCredentials() method.
  226.     }
  227.     /**
  228.      * String representation of object
  229.      * @link http://php.net/manual/en/serializable.serialize.php
  230.      * @return string the string representation of the object or null
  231.      * @since 5.1.0
  232.      */
  233.     public function serialize(): array
  234.     {
  235.         // TODO: Implement serialize() method.
  236.         return serialize([
  237.             $this->id,
  238.             $this->username,
  239.             $this->password,
  240.             $this->matricule,
  241.             $this->name,
  242.             $this->niveau,
  243.             $this->roles,
  244.         ]);
  245.     }
  246.     /**
  247.      * Constructs the object
  248.      * @link http://php.net/manual/en/serializable.unserialize.php
  249.      * @param string $serialized <p>
  250.      * The string representation of the object.
  251.      * </p>
  252.      * @return void
  253.      * @since 5.1.0
  254.      */
  255.     public function unserialize($serialized): void
  256.     {
  257.         // TODO: Implement unserialize() method.
  258.         list(
  259.             $this->id,
  260.             $this->username,
  261.             $this->password,
  262.             $this->matricule,
  263.             $this->name,
  264.             $this->niveau,
  265.             $this->roles,
  266.             ) = unserialize($serialized, ['allowed_classes' => false]);
  267.     }
  268.     public function getNiveau(): ?int
  269.     {
  270.         return $this->niveau;
  271.     }
  272.     public function setNiveau(?int $niveau): self
  273.     {
  274.         $this->niveau $niveau;
  275.         return $this;
  276.     }
  277.     public function getName(): ?string
  278.     {
  279.         return $this->name;
  280.     }
  281.     public function setName(?string $name): self
  282.     {
  283.         $this->name $name;
  284.         return $this;
  285.     }
  286.     public function getMatricule(): ?string
  287.     {
  288.         return $this->matricule;
  289.     }
  290.     public function setMatricule(?string $matricule): self
  291.     {
  292.         $this->matricule $matricule;
  293.         return $this;
  294.     }
  295.     /**
  296.      * @return Collection
  297.      */
  298.     public function getAbonnes(): Collection{
  299.         return $this->abonnes;
  300.     }
  301.     public function addAbonne(Abonne $abonne): self{
  302.         if (!$this->abonnes->contains($abonne)) {
  303.             $this->abonnes[] = $abonne;
  304.             $abonne->setUser($this);
  305.         }
  306.         return $this;
  307.     }
  308.     public function removeAbonne(Abonne $abonne): self{
  309.         if ($this->abonnes->contains($abonne)) {
  310.             $this->abonnes->removeElement($abonne);
  311.             // set the owning side to null (unless already changed)
  312.             if ($abonne->getUser() === $this) {
  313.                 $abonne->setUser(null);
  314.             }
  315.         }
  316.         return $this;
  317.     }
  318.     /**
  319.      * @return Collection
  320.      */
  321.     public function getVisiteurs(): Collection
  322.     {
  323.         return $this->visiteurs;
  324.     }
  325.     public function addVisiteur(Visiteur $visiteur): self{
  326.         if (!$this->visiteurs->contains($visiteur)) {
  327.             $this->visiteurs[] = $visiteur;
  328.             $visiteur->setUser($this);
  329.         }
  330.         return $this;
  331.     }
  332.     public function removeVisiteur(Visiteur $visiteur): self{
  333.         if ($this->visiteurs->contains($visiteur)) {
  334.             $this->visiteurs->removeElement($visiteur);
  335.             // set the owning side to null (unless already changed)
  336.             if ($visiteur->getUser() === $this) {
  337.                 $visiteur->setUser(null);
  338.             }
  339.         }
  340.         return $this;
  341.     }
  342.     /**
  343.      * @return Collection|PlaceDeMarche[]
  344.      */
  345.     public function getPlaceDeMarches(): Collection
  346.     {
  347.         return $this->placeDeMarches;
  348.     }
  349.     public function addPlaceDeMarch(PlaceDeMarche $placeDeMarch): self
  350.     {
  351.         if (!$this->placeDeMarches->contains($placeDeMarch)) {
  352.             $this->placeDeMarches[] = $placeDeMarch;
  353.             $placeDeMarch->setUser($this);
  354.         }
  355.         return $this;
  356.     }
  357.     public function removePlaceDeMarch(PlaceDeMarche $placeDeMarch): self
  358.     {
  359.         if ($this->placeDeMarches->contains($placeDeMarch)) {
  360.             $this->placeDeMarches->removeElement($placeDeMarch);
  361.             // set the owning side to null (unless already changed)
  362.             if ($placeDeMarch->getUser() === $this) {
  363.                 $placeDeMarch->setUser(null);
  364.             }
  365.         }
  366.         return $this;
  367.     }
  368.     /**
  369.      * @return Collection |RequeteDeFinancement[]
  370.      */
  371.     public function getRequeteDeFinancements(): Collection
  372.     {
  373.         return $this->requeteDeFinancements;
  374.     }
  375.     public function addRequeteDeFinancement(RequeteDeFinancement $requeteDeFinancement): self
  376.     {
  377.         if (!$this->requeteDeFinancements->contains($requeteDeFinancement)) {
  378.             $this->requeteDeFinancements[] = $requeteDeFinancement;
  379.             $requeteDeFinancement->setUser($this);
  380.         }
  381.         return $this;
  382.     }
  383.     public function removeRequeteDeFinancement(RequeteDeFinancement $requeteDeFinancement): self
  384.     {
  385.         if ($this->requeteDeFinancements->contains($requeteDeFinancement)) {
  386.             $this->requeteDeFinancements->removeElement($requeteDeFinancement);
  387.             // set the owning side to null (unless already changed)
  388.             if ($requeteDeFinancement->getUser() === $this) {
  389.                 $requeteDeFinancement->setUser(null);
  390.             }
  391.         }
  392.         return $this;
  393.     }
  394.     /**
  395.      * @return Collection|TraitementDsDemdDachat[]
  396.      */
  397.     public function getTraitementDsDemdDachats(): Collection
  398.     {
  399.         return $this->traitementDsDemdDachats;
  400.     }
  401.     public function addTraitementDsDemdDachat(TraitementDsDemdDachat $traitementDsDemdDachat): self
  402.     {
  403.         if (!$this->traitementDsDemdDachats->contains($traitementDsDemdDachat)) {
  404.             $this->traitementDsDemdDachats[] = $traitementDsDemdDachat;
  405.             $traitementDsDemdDachat->setUser($this);
  406.         }
  407.         return $this;
  408.     }
  409.     public function removeTraitementDsDemdDachat(TraitementDsDemdDachat $traitementDsDemdDachat): self
  410.     {
  411.         if ($this->traitementDsDemdDachats->contains($traitementDsDemdDachat)) {
  412.             $this->traitementDsDemdDachats->removeElement($traitementDsDemdDachat);
  413.             // set the owning side to null (unless already changed)
  414.             if ($traitementDsDemdDachat->getUser() === $this) {
  415.                 $traitementDsDemdDachat->setUser(null);
  416.             }
  417.         }
  418.         return $this;
  419.     }
  420.     public function getEmailPro(): ?string
  421.     {
  422.         return $this->email_pro;
  423.     }
  424.     public function setEmailPro(?string $email_pro): self
  425.     {
  426.         $this->email_pro $email_pro;
  427.         return $this;
  428.     }
  429.     public function getFonction(): ?string
  430.     {
  431.         return $this->fonction;
  432.     }
  433.     public function setFonction(?string $fonction): self
  434.     {
  435.         $this->fonction $fonction;
  436.         return $this;
  437.     }
  438.     public function getEntryAt(): ?\DateTimeInterface
  439.     {
  440.         return $this->entry_at;
  441.     }
  442.     public function setEntryAt(?\DateTimeInterface $entry_at): self
  443.     {
  444.         $this->entry_at $entry_at;
  445.         return $this;
  446.     }
  447.     public function getPrenoms(): ?string
  448.     {
  449.         return $this->prenoms;
  450.     }
  451.     public function setPrenoms(?string $prenoms): self
  452.     {
  453.         $this->prenoms $prenoms;
  454.         return $this;
  455.     }
  456.     public function getStatus(): ?UserStatus
  457.     {
  458.         return $this->status;
  459.     }
  460.     public function setStatus(?UserStatus $status): self
  461.     {
  462.         $this->status $status;
  463.         return $this;
  464.     }
  465.     /**
  466.      * @return Collection|AdminDonneurOrdre[]
  467.      */
  468.     public function getAdminDonneurOrdres(): Collection
  469.     {
  470.         return $this->adminDonneurOrdres;
  471.     }
  472.     public function addAdminDonneurOrdre(AdminDonneurOrdre $adminDonneurOrdre): self
  473.     {
  474.         if (!$this->adminDonneurOrdres->contains($adminDonneurOrdre)) {
  475.             $this->adminDonneurOrdres[] = $adminDonneurOrdre;
  476.             $adminDonneurOrdre->setLead($this);
  477.         }
  478.         return $this;
  479.     }
  480.     public function removeAdminDonneurOrdre(AdminDonneurOrdre $adminDonneurOrdre): self
  481.     {
  482.         if ($this->adminDonneurOrdres->contains($adminDonneurOrdre)) {
  483.             $this->adminDonneurOrdres->removeElement($adminDonneurOrdre);
  484.             // set the owning side to null (unless already changed)
  485.             if ($adminDonneurOrdre->getLead() === $this) {
  486.                 $adminDonneurOrdre->setLead(null);
  487.             }
  488.         }
  489.         return $this;
  490.     }
  491.     /**
  492.      * @return Collection|AdminDonneurOrdre[]
  493.      */
  494.     public function getAdminDonneurOrdresSuivi(): Collection
  495.     {
  496.         return $this->adminDonneurOrdres_suivi;
  497.     }
  498.     public function addAdminDonneurOrdresSuivi(AdminDonneurOrdre $adminDonneurOrdresSuivi): self
  499.     {
  500.         if (!$this->adminDonneurOrdres_suivi->contains($adminDonneurOrdresSuivi)) {
  501.             $this->adminDonneurOrdres_suivi[] = $adminDonneurOrdresSuivi;
  502.             $adminDonneurOrdresSuivi->setSuiviPar($this);
  503.         }
  504.         return $this;
  505.     }
  506.     public function removeAdminDonneurOrdresSuivi(AdminDonneurOrdre $adminDonneurOrdresSuivi): self
  507.     {
  508.         if ($this->adminDonneurOrdres_suivi->contains($adminDonneurOrdresSuivi)) {
  509.             $this->adminDonneurOrdres_suivi->removeElement($adminDonneurOrdresSuivi);
  510.             // set the owning side to null (unless already changed)
  511.             if ($adminDonneurOrdresSuivi->getSuiviPar() === $this) {
  512.                 $adminDonneurOrdresSuivi->setSuiviPar(null);
  513.             }
  514.         }
  515.         return $this;
  516.     }
  517.     /**
  518.      * @return Collection|Document[]
  519.      */
  520.     public function getDocuments(): Collection
  521.     {
  522.         return $this->documents;
  523.     }
  524.     public function addDocument(Document $documents): self
  525.     {
  526.         if (!$this->documents->contains($documents)) {
  527.             $this->documents[] = $documents;
  528.             $documents->setRedacteur($this);
  529.         }
  530.         return $this;
  531.     }
  532.     public function removeDocument(Document $documents): self
  533.     {
  534.         if ($this->documents->contains($documents)) {
  535.             $this->documents->removeElement($documents);
  536.             // set the owning side to null (unless already changed)
  537.             if ($documents->getRedacteur() === $this) {
  538.                 $documents->setRedacteur(null);
  539.             }
  540.         }
  541.         return $this;
  542.     }
  543.     
  544.     /**
  545.      * @return Collection|Document[]
  546.      */
  547.     public function getDocumentApprouves(): Collection
  548.     {
  549.         return $this->documentApprouves;
  550.     }
  551.     public function addDocumentApprouves(Document $documentApprouves): self
  552.     {
  553.         if (!$this->documentApprouves->contains($documentApprouves)) {
  554.             $this->documentApprouves[] = $documentApprouves;
  555.             $documentApprouves->setApprouverPar($this);
  556.         }
  557.         return $this;
  558.     }
  559.     public function removeDocumentApprouves(Document $documentApprouves): self
  560.     {
  561.         if ($this->documentApprouves->contains($documentApprouves)) {
  562.             $this->documentApprouves->removeElement($documentApprouves);
  563.             // set the owning side to null (unless already changed)
  564.             if ($documentApprouves->getApprouverPar() === $this) {
  565.                 $documentApprouves->setApprouverPar(null);
  566.             }
  567.         }
  568.         return $this;
  569.     }
  570.     /**
  571.      * @return Collection|LeveeDeFond[]
  572.      */
  573.     public function getLeveeDeFonds(): Collection
  574.     {
  575.         return $this->leveeDeFonds;
  576.     }
  577.     public function addLeveeDeFond(LeveeDeFond $leveeDeFond): self
  578.     {
  579.         if (!$this->leveeDeFonds->contains($leveeDeFond)) {
  580.             $this->leveeDeFonds[] = $leveeDeFond;
  581.             $leveeDeFond->setSuviPar($this);
  582.         }
  583.         return $this;
  584.     }
  585.     public function removeLeveeDeFond(LeveeDeFond $leveeDeFond): self
  586.     {
  587.         if ($this->leveeDeFonds->contains($leveeDeFond)) {
  588.             $this->leveeDeFonds->removeElement($leveeDeFond);
  589.             // set the owning side to null (unless already changed)
  590.             if ($leveeDeFond->getSuviPar() === $this) {
  591.                 $leveeDeFond->setSuviPar(null);
  592.             }
  593.         }
  594.         return $this;
  595.     }
  596.     public function __toString(): string
  597.     {
  598.         return $this->name;
  599.     }
  600.     public function getDateSortie(): ?\DateTimeInterface
  601.     {
  602.         return $this->date_sortie;
  603.     }
  604.     public function setDateSortie(?\DateTimeInterface $date_sortie): self
  605.     {
  606.         $this->date_sortie $date_sortie;
  607.         return $this;
  608.     }
  609.     /**
  610.      * @return Collection|LetterOfIntentToPurchase[]
  611.      */
  612.     public function getLetterOfIntentToPurchases(): Collection
  613.     {
  614.         return $this->letterOfIntentToPurchases;
  615.     }
  616.     public function addLetterOfIntentToPurchase(LetterOfIntentToPurchase $letterOfIntentToPurchase): self
  617.     {
  618.         if (!$this->letterOfIntentToPurchases->contains($letterOfIntentToPurchase)) {
  619.             $this->letterOfIntentToPurchases[] = $letterOfIntentToPurchase;
  620.             $letterOfIntentToPurchase->setAgent($this);
  621.         }
  622.         return $this;
  623.     }
  624.     public function removeLetterOfIntentToPurchase(LetterOfIntentToPurchase $letterOfIntentToPurchase): self
  625.     {
  626.         if ($this->letterOfIntentToPurchases->contains($letterOfIntentToPurchase)) {
  627.             $this->letterOfIntentToPurchases->removeElement($letterOfIntentToPurchase);
  628.             // set the owning side to null (unless already changed)
  629.             if ($letterOfIntentToPurchase->getAgent() === $this) {
  630.                 $letterOfIntentToPurchase->setAgent(null);
  631.             }
  632.         }
  633.         return $this;
  634.     }
  635.      /**
  636.      * @return Collection|LetterOfIntentToPurchase[]
  637.      */
  638.     public function getSuivipars(): Collection
  639.     {
  640.         return $this->suivipars;
  641.     }
  642.     public function addSuivipar(LetterOfIntentToPurchase $suivipar): self
  643.     {
  644.         if (!$this->suivipars->contains($suivipar)) {
  645.             $this->suivipars[] = $suivipar;
  646.             $suivipar->setSuivipar($this);
  647.         }
  648.         return $this;
  649.     }
  650.     public function removeSuivipar(LetterOfIntentToPurchase $suivipar): self
  651.     {
  652.         if ($this->suivipars->contains($suivipar)) {
  653.             $this->suivipars->removeElement($suivipar);
  654.             // set the owning side to null (unless already changed)
  655.             if ($suivipar->getSuivipar() === $this) {
  656.                 $suivipar->setSuivipar(null);
  657.             }
  658.         }
  659.         return $this;
  660.     }
  661.     /**
  662.      * @return Collection|TraitementDsDemdDachat[]
  663.      */
  664.     public function getAgent(): Collection
  665.     {
  666.         return $this->agent;
  667.     }
  668.     public function addAgent(TraitementDsDemdDachat $agent): self
  669.     {
  670.         if (!$this->agent->contains($agent)) {
  671.             $this->agent[] = $agent;
  672.             $agent->setAgent($this);
  673.         }
  674.         return $this;
  675.     }
  676.     public function removeAgent(TraitementDsDemdDachat $agent): self
  677.     {
  678.         if ($this->agent->contains($agent)) {
  679.             $this->agent->removeElement($agent);
  680.             // set the owning side to null (unless already changed)
  681.             if ($agent->getAgent() === $this) {
  682.                 $agent->setAgent(null);
  683.             }
  684.         }
  685.         return $this;
  686.     }
  687.     /**
  688.      * @return Collection|DemandeDeCotation[]
  689.      */
  690.     public function getDemandeDeCotations(): Collection
  691.     {
  692.         return $this->demandeDeCotations;
  693.     }
  694.     public function addDemandeDeCotation(DemandeDeCotation $demandeDeCotation): self
  695.     {
  696.         if (!$this->demandeDeCotations->contains($demandeDeCotation)) {
  697.             $this->demandeDeCotations[] = $demandeDeCotation;
  698.             $demandeDeCotation->setUser($this);
  699.         }
  700.         return $this;
  701.     }
  702.     public function removeDemandeDeCotation(DemandeDeCotation $demandeDeCotation): self
  703.     {
  704.         if ($this->demandeDeCotations->contains($demandeDeCotation)) {
  705.             $this->demandeDeCotations->removeElement($demandeDeCotation);
  706.             // set the owning side to null (unless already changed)
  707.             if ($demandeDeCotation->getUser() === $this) {
  708.                 $demandeDeCotation->setUser(null);
  709.             }
  710.         }
  711.         return $this;
  712.     }
  713.     /**
  714.      * @return Collection|Prospect[]
  715.      */
  716.     public function getProspects(): Collection
  717.     {
  718.         return $this->prospects;
  719.     }
  720.     public function addProspect(Prospect $prospect): self
  721.     {
  722.         if (!$this->prospects->contains($prospect)) {
  723.             $this->prospects[] = $prospect;
  724.             $prospect->setSuiviPar($this);
  725.         }
  726.         return $this;
  727.     }
  728.     public function removeProspect(Prospect $prospect): self
  729.     {
  730.         if ($this->prospects->contains($prospect)) {
  731.             $this->prospects->removeElement($prospect);
  732.             // set the owning side to null (unless already changed)
  733.             if ($prospect->getSuiviPar() === $this) {
  734.                 $prospect->setSuiviPar(null);
  735.             }
  736.         }
  737.         return $this;
  738.     }
  739. }