src/Entity/Prospect.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Repository\ProspectRepository;
  6. use Doctrine\Common\Collections\Criteria;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use phpDocumentor\Reflection\Types\Array_;
  10. use Symfony\Component\Security\Core\Security;
  11. use App\Entity\Typologie;
  12. use App\Entity\SecteurGeographique;
  13. use App\Entity\Etage;
  14. use App\Entity\VilleProgramme;
  15. /**
  16.  * @ORM\Entity(repositoryClass=ProspectRepository::class)
  17.  */
  18. class Prospect
  19. {
  20.     /**
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue
  23.      * @ORM\Column(type="integer")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @ORM\Column(type="datetime")
  28.      */
  29.     private $dateheure;
  30.     /**
  31.      * @ORM\Column(type="datetime", nullable=true)
  32.      */
  33.     private $dateDerniereModification;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      */
  37.     private $apporteur;
  38.     /**
  39.      * @ORM\Column(type="string", length=255, nullable=true)
  40.      */
  41.     private $societe;
  42.     /**
  43.      * @ORM\Column(type="string", length=255, nullable=true)
  44.      */
  45.     private $emprunteurNom;
  46.     /**
  47.      * @ORM\Column(type="string", length=255, nullable=true)
  48.      */
  49.     private $emprunteurPrenom;
  50.     /**
  51.      * @ORM\Column(type="date", nullable=true)
  52.      */
  53.     private $emprunteurDateNaissance;
  54.     /**
  55.      * @ORM\Column(type="string", length=255, nullable=true)
  56.      */
  57.     private $emprunteurAdresse;
  58.     /**
  59.      * @ORM\Column(type="string", length=255, nullable=true)
  60.      */
  61.     private $emprunteurTelFr;
  62.     /**
  63.      * @ORM\Column(type="string", length=255, nullable=true)
  64.      */
  65.     private $emprunteurTelCh;
  66.     /**
  67.      * @ORM\Column(type="string", length=255, nullable=true)
  68.      */
  69.     private $emprunteurEmail;
  70.     /**
  71.      * @ORM\Column(type="string", length=255, nullable=true)
  72.      */
  73.     private $emprunteurLieuTravail;
  74.     /**
  75.      * @ORM\Column(type="string", length=255, nullable=true)
  76.      */
  77.     private $coEmprunteurNom;
  78.     /**
  79.      * @ORM\Column(type="string", length=255, nullable=true)
  80.      */
  81.     private $coEmprunteurPrenom;
  82.     /**
  83.      * @ORM\Column(type="date", nullable=true)
  84.      */
  85.     private $coEmprunteurDateNaissance;
  86.     /**
  87.      * @ORM\Column(type="string", length=255, nullable=true)
  88.      */
  89.     private $coEmprunteurAdresse;
  90.     /**
  91.      * @ORM\Column(type="string", length=255, nullable=true)
  92.      */
  93.     private $coEmprunteurTelFr;
  94.     /**
  95.      * @ORM\Column(type="string", length=255, nullable=true)
  96.      */
  97.     private $coEmprunteurTelCh;
  98.     /**
  99.      * @ORM\Column(type="string", length=255, nullable=true)
  100.      */
  101.     private $coEmprunteurEmail;
  102.     /**
  103.      * @ORM\Column(type="string", length=255, nullable=true)
  104.      */
  105.     private $coEmprunteurLieuTravail;
  106.     /**
  107.      * @ORM\Column(type="boolean", nullable=true)
  108.      */
  109.     private $isRP;
  110.     /**
  111.      * @ORM\Column(type="boolean", nullable=true)
  112.      */
  113.     private $isLocatif;
  114.     /**
  115.      * @ORM\Column(type="boolean", nullable=true)
  116.      */
  117.     private $isTerrain;
  118.     /**
  119.      * @ORM\Column(type="boolean", nullable=true)
  120.      */
  121.     private $isConstruction;
  122.     /**
  123.      * @ORM\Column(type="boolean", nullable=true)
  124.      */
  125.     private $isLMNP;
  126.     /**
  127.      * @ORM\Column(type="float", nullable=true)
  128.      */
  129.     private $budgetApproximatif;
  130.     /**
  131.      * @ORM\Column(type="float", nullable=true)
  132.      */
  133.     private $mensualiteSouhaitee;
  134.     /**
  135.      * @ORM\Column(type="text", nullable=true)
  136.      */
  137.     private $descriptionProjetGlobal;
  138.     /**
  139.      * @ORM\Column(type="datetime", nullable=true)
  140.      */
  141.     private $rdvDateHeure1;
  142.     /**
  143.      * @ORM\Column(type="datetime", nullable=true)
  144.      */
  145.     private $rdvDateHeure2;
  146.     /**
  147.      * @ORM\Column(type="datetime", nullable=true)
  148.      */
  149.     private $rdvDateheure3;
  150.     /**
  151.      * @ORM\Column(type="datetime", nullable=true)
  152.      */
  153.     private $rdvDateHeure4;
  154.     /**
  155.      * @ORM\Column(type="datetime", nullable=true)
  156.      */
  157.     private $rdvDateHeure5;
  158.     /**
  159.      * @ORM\Column(type="datetime", nullable=true)
  160.      */
  161.     private $rdvDateHeure6;
  162.     /**
  163.      * @ORM\Column(type="text", nullable=true)
  164.      */
  165.     private $descriptionDenonciations;
  166.     /**
  167.      * @ORM\Column(type="text", nullable=true)
  168.      */
  169.     private $descriptionSecteur;
  170.     /**
  171.      * @ORM\Column(type="text", nullable=true)
  172.      */
  173.     private $descriptionCriteresParticuliers;
  174.     /**
  175.      * @ORM\Column(type="text", nullable=true)
  176.      */
  177.     private $descriptionCriteresGeneraux;
  178.     /**
  179.      * @ORM\Column(type="text", nullable=true)
  180.      */
  181.     private $descriptionSituationActuelle;
  182.     /**
  183.      * @ORM\Column(type="text", nullable=true)
  184.      */
  185.     private $descriptionProgrammesProposes;
  186.     /**
  187.      * @ORM\OneToMany(targetEntity=Demande::class, mappedBy="auteur")
  188.      */
  189.     private $demandes;
  190.     /**
  191.      * @ORM\Column(type="string", length=128, nullable=true)
  192.      */
  193.     private $emprunteurVille;
  194.     /**
  195.      * @ORM\Column(type="string", length=32, nullable=true)
  196.      */
  197.     private $emprunteurCodePostal;
  198.     /**
  199.      * @ORM\OneToMany(targetEntity=Proposition::class, mappedBy="prospect", orphanRemoval=true, cascade={"persist"})
  200.      * @ORM\OrderBy({"dateheure" = "DESC"})
  201.      */
  202.     private $propositions;
  203.     /**
  204.      * @ORM\Column(type="string", length=128, nullable=true)
  205.      */
  206.     private $coemprunteurVille;
  207.     /**
  208.      * @ORM\Column(type="string", length=32, nullable=true)
  209.      */
  210.     private $coemprunteurCodePostal;
  211.     /**
  212.      * @ORM\Column(type="string", length=64, unique=true)
  213.      */
  214.     private $token;
  215.     /**
  216.      * @ORM\OneToMany(targetEntity=Impression::class, mappedBy="prospect")
  217.      */
  218.     private $impressions;
  219.     /**
  220.      * @ORM\OneToMany(targetEntity=Historique::class, mappedBy="prospect")
  221.      */
  222.     private $historiques;
  223.     /**
  224.      * @ORM\Column(type="array", nullable=true)
  225.      */
  226.     private $type = [];
  227.     /**
  228.      * @ORM\OneToMany(targetEntity=Denonciation::class, mappedBy="prospect", orphanRemoval=true, cascade={"persist"})
  229.      */
  230.     private $denonciations;
  231.     /**
  232.      * @ORM\Column(type="string", length=24, nullable=true)
  233.      */
  234.     private $statut;
  235.     /**
  236.      * @ORM\Column(type="boolean", nullable=true)
  237.      */
  238.     private $afficherNomCoEmprunteur;
  239.     /**
  240.      * @ORM\Column(type="boolean", nullable=true)
  241.      */
  242.     private $afficherNomEmprunteur;
  243.     /**
  244.      * @ORM\ManyToOne(targetEntity=Utilisateur::class, inversedBy="prospects")
  245.      */
  246.     private $auteur;
  247.     /**
  248.      * @ORM\ManyToOne(targetEntity=Entreprise::class, inversedBy="utilisateurs")
  249.      */
  250.     private $entreprise;
  251.     /**
  252.      * @ORM\ManyToMany(targetEntity=InfosSuivi::class, mappedBy="prospects")
  253.      */
  254.     private $infosSuivis;
  255.     /**
  256.      * @ORM\OneToMany(targetEntity=ActionTrace::class, mappedBy="prospect")
  257.      */
  258.     private $actionTraces;
  259.     /**
  260.      * @ORM\ManyToMany(targetEntity=Typologie::class, inversedBy="prospects")
  261.      * @ORM\JoinTable(name="prospect_typologie")
  262.      */
  263.     private $typologies;
  264.     /**
  265.      * @ORM\ManyToMany(targetEntity=SecteurGeographique::class, inversedBy="prospects")
  266.      * @ORM\JoinTable(name="prospect_secteur_geographique")
  267.      */
  268.     private $secteursGeographiques;
  269.     /**
  270.      * @ORM\ManyToMany(targetEntity=Etage::class, inversedBy="prospects")
  271.      * @ORM\JoinTable(name="prospect_etage")
  272.      */
  273.     private $etages;
  274.     /**
  275.      * @ORM\ManyToMany(targetEntity=VilleProgramme::class, inversedBy="prospects")
  276.      * @ORM\JoinTable(name="prospect_ville_programme")
  277.      */
  278.     private $villesProgrammes;
  279.     public function __toString() {
  280.         return ($this->getId() == null 'Nouvelle fiche' trim($this->getEmprunteurNom().' '.$this->getEmprunteurPrenom()));
  281.     }
  282.     public function __construct() {
  283.         $this->dateheure = new \DateTime("now");
  284.         $this->demandes = new ArrayCollection();
  285.         $this->propositions = new ArrayCollection();
  286.         $this->token $this->generateUid(6);
  287.         $this->impressions = new ArrayCollection();
  288.         $this->historiques = new ArrayCollection();
  289.         $this->denonciations = new ArrayCollection();
  290.         $this->infosSuivis = new ArrayCollection();
  291.         $this->actionTraces = new ArrayCollection();
  292.         $this->typologies = new ArrayCollection();
  293.         $this->secteursGeographiques = new ArrayCollection();
  294.         $this->etages = new ArrayCollection();
  295.         $this->villesProgrammes = new ArrayCollection();
  296.     }
  297.     public function generateUid($l=10){
  298.         return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyz"), 0$l);
  299.     }
  300.     public function lotIsProposed($lotId) {
  301.         $contains false;
  302.         foreach($this->getPropositions() as $p) {
  303.             if($p->getLot()->getId() == $lotId$contains true;
  304.         }
  305.         return $contains;
  306.     }
  307.     public function getId(): ?int
  308.     {
  309.         return $this->id;
  310.     }
  311.     public function getDateheure(): ?\DateTimeInterface
  312.     {
  313.         return $this->dateheure;
  314.     }
  315.     public function setDateheure(\DateTimeInterface $dateheure): self
  316.     {
  317.         $this->dateheure $dateheure;
  318.         return $this;
  319.     }
  320.     public function getDateDerniereModification(): ?\DateTimeInterface
  321.     {
  322.         return $this->dateDerniereModification;
  323.     }
  324.     public function setDateDerniereModification(\DateTimeInterface $dateDerniereModification): self
  325.     {
  326.         $this->dateDerniereModification $dateDerniereModification;
  327.         return $this;
  328.     }
  329.     public function getApporteur(): ?string
  330.     {
  331.         return strtoupper($this->apporteur);
  332.     }
  333.     public function setApporteur(?string $apporteur): self
  334.     {
  335.         $this->apporteur $apporteur;
  336.         return $this;
  337.     }
  338.     public function getSociete(): ?string
  339.     {
  340.         return $this->societe;
  341.     }
  342.     public function setSociete(?string $societe): self
  343.     {
  344.         $this->societe $societe;
  345.         return $this;
  346.     }
  347.     public function getEmprunteurNom(): ?string
  348.     {
  349.         return strtoupper($this->emprunteurNom);
  350.     }
  351.     public function setEmprunteurNom(?string $emprunteurNom): self
  352.     {
  353.         $this->emprunteurNom $emprunteurNom;
  354.         return $this;
  355.     }
  356.     public function getEmprunteurPrenom(): ?string
  357.     {
  358.         return strtoupper($this->emprunteurPrenom);
  359.     }
  360.     public function setEmprunteurPrenom(?string $emprunteurPrenom): self
  361.     {
  362.         $this->emprunteurPrenom $emprunteurPrenom;
  363.         return $this;
  364.     }
  365.     public function getEmprunteurDateNaissance(): ?\DateTimeInterface
  366.     {
  367.         return $this->emprunteurDateNaissance;
  368.     }
  369.     public function setEmprunteurDateNaissance(?\DateTimeInterface $emprunteurDateNaissance): self
  370.     {
  371.         $this->emprunteurDateNaissance $emprunteurDateNaissance;
  372.         return $this;
  373.     }
  374.     public function getEmprunteurAdresse(): ?string
  375.     {
  376.         return $this->emprunteurAdresse;
  377.     }
  378.     public function setEmprunteurAdresse(?string $emprunteurAdresse): self
  379.     {
  380.         $this->emprunteurAdresse $emprunteurAdresse;
  381.         return $this;
  382.     }
  383.     public function getEmprunteurTelFr(): ?string
  384.     {
  385.         return $this->emprunteurTelFr;
  386.     }
  387.     public function setEmprunteurTelFr(?string $emprunteurTelFr): self
  388.     {
  389.         $this->emprunteurTelFr $emprunteurTelFr;
  390.         return $this;
  391.     }
  392.     public function getEmprunteurTelCh(): ?string
  393.     {
  394.         return $this->emprunteurTelCh;
  395.     }
  396.     public function setEmprunteurTelCh(?string $emprunteurTelCh): self
  397.     {
  398.         $this->emprunteurTelCh $emprunteurTelCh;
  399.         return $this;
  400.     }
  401.     public function getEmprunteurEmail(): ?string
  402.     {
  403.         return strtolower($this->emprunteurEmail);
  404.     }
  405.     public function setEmprunteurEmail(?string $emprunteurEmail): self
  406.     {
  407.         $this->emprunteurEmail $emprunteurEmail;
  408.         return $this;
  409.     }
  410.     public function getEmprunteurLieuTravail(): ?string
  411.     {
  412.         return $this->emprunteurLieuTravail;
  413.     }
  414.     public function setEmprunteurLieuTravail(?string $emprunteurLieuTravail): self
  415.     {
  416.         $this->emprunteurLieuTravail $emprunteurLieuTravail;
  417.         return $this;
  418.     }
  419.     public function getCoEmprunteurNom(): ?string
  420.     {
  421.         return $this->coEmprunteurNom;
  422.     }
  423.     public function setCoEmprunteurNom(?string $coEmprunteurNom): self
  424.     {
  425.         $this->coEmprunteurNom $coEmprunteurNom;
  426.         return $this;
  427.     }
  428.     public function getCoEmprunteurPrenom(): ?string
  429.     {
  430.         return $this->coEmprunteurPrenom;
  431.     }
  432.     public function setCoEmprunteurPrenom(?string $coEmprunteurPrenom): self
  433.     {
  434.         $this->coEmprunteurPrenom $coEmprunteurPrenom;
  435.         return $this;
  436.     }
  437.     public function getCoEmprunteurDateNaissance(): ?\DateTimeInterface
  438.     {
  439.         return $this->coEmprunteurDateNaissance;
  440.     }
  441.     public function setCoEmprunteurDateNaissance(?\DateTimeInterface $coEmprunteurDateNaissance): self
  442.     {
  443.         $this->coEmprunteurDateNaissance $coEmprunteurDateNaissance;
  444.         return $this;
  445.     }
  446.     public function getCoEmprunteurAdresse(): ?string
  447.     {
  448.         return $this->coEmprunteurAdresse;
  449.     }
  450.     public function setCoEmprunteurAdresse(?string $coEmprunteurAdresse): self
  451.     {
  452.         $this->coEmprunteurAdresse $coEmprunteurAdresse;
  453.         return $this;
  454.     }
  455.     public function getCoEmprunteurTelFr(): ?string
  456.     {
  457.         return $this->coEmprunteurTelFr;
  458.     }
  459.     public function setCoEmprunteurTelFr(?string $coEmprunteurTelFr): self
  460.     {
  461.         $this->coEmprunteurTelFr $coEmprunteurTelFr;
  462.         return $this;
  463.     }
  464.     public function getCoEmprunteurTelCh(): ?string
  465.     {
  466.         return $this->coEmprunteurTelCh;
  467.     }
  468.     public function setCoEmprunteurTelCh(?string $coEmprunteurTelCh): self
  469.     {
  470.         $this->coEmprunteurTelCh $coEmprunteurTelCh;
  471.         return $this;
  472.     }
  473.     public function getCoEmprunteurEmail(): ?string
  474.     {
  475.         return $this->coEmprunteurEmail;
  476.     }
  477.     public function setCoEmprunteurEmail(?string $coEmprunteurEmail): self
  478.     {
  479.         $this->coEmprunteurEmail $coEmprunteurEmail;
  480.         return $this;
  481.     }
  482.     public function getCoEmprunteurLieuTravail(): ?string
  483.     {
  484.         return $this->coEmprunteurLieuTravail;
  485.     }
  486.     public function setCoEmprunteurLieuTravail(?string $coEmprunteurLieuTravail): self
  487.     {
  488.         $this->coEmprunteurLieuTravail $coEmprunteurLieuTravail;
  489.         return $this;
  490.     }
  491.     public function getIsRP(): ?bool
  492.     {
  493.         return $this->isRP;
  494.     }
  495.     public function setIsRP(?bool $isRP): self
  496.     {
  497.         $this->isRP $isRP;
  498.         return $this;
  499.     }
  500.     public function getIsLocatif(): ?bool
  501.     {
  502.         return $this->isLocatif;
  503.     }
  504.     public function setIsLocatif(?bool $isLocatif): self
  505.     {
  506.         $this->isLocatif $isLocatif;
  507.         return $this;
  508.     }
  509.     public function getIsTerrain(): ?bool
  510.     {
  511.         return $this->isTerrain;
  512.     }
  513.     public function setIsTerrain(?bool $isTerrain): self
  514.     {
  515.         $this->isTerrain $isTerrain;
  516.         return $this;
  517.     }
  518.     public function getIsConstruction(): ?bool
  519.     {
  520.         return $this->isConstruction;
  521.     }
  522.     public function setIsConstruction(?bool $isConstruction): self
  523.     {
  524.         $this->isConstruction $isConstruction;
  525.         return $this;
  526.     }
  527.     public function getIsLMNP(): ?bool
  528.     {
  529.         return $this->isLMNP;
  530.     }
  531.     public function setIsLMNP(?bool $isLMNP): self
  532.     {
  533.         $this->isLMNP $isLMNP;
  534.         return $this;
  535.     }
  536.     public function getBudgetApproximatif(): ?float
  537.     {
  538.         return $this->budgetApproximatif;
  539.     }
  540.     public function setBudgetApproximatif(?float $budgetApproximatif): self
  541.     {
  542.         $this->budgetApproximatif $budgetApproximatif;
  543.         return $this;
  544.     }
  545.     public function getMensualiteSouhaitee(): ?float
  546.     {
  547.         return $this->mensualiteSouhaitee;
  548.     }
  549.     public function setMensualiteSouhaitee(?float $mensualiteSouhaitee): self
  550.     {
  551.         $this->mensualiteSouhaitee $mensualiteSouhaitee;
  552.         return $this;
  553.     }
  554.     public function getDescriptionProjetGlobal(): ?string
  555.     {
  556.         return $this->descriptionProjetGlobal;
  557.     }
  558.     public function setDescriptionProjetGlobal(?string $descriptionProjetGlobal): self
  559.     {
  560.         $this->descriptionProjetGlobal $descriptionProjetGlobal;
  561.         return $this;
  562.     }
  563.     public function getRdvDateHeure1(): ?\DateTimeInterface
  564.     {
  565.         return $this->rdvDateHeure1;
  566.     }
  567.     public function setRdvDateHeure1(?\DateTimeInterface $rdvDateHeure1): self
  568.     {
  569.         $this->rdvDateHeure1 $rdvDateHeure1;
  570.         return $this;
  571.     }
  572.     public function getRdvDateHeure2(): ?\DateTimeInterface
  573.     {
  574.         return $this->rdvDateHeure2;
  575.     }
  576.     public function setRdvDateHeure2(?\DateTimeInterface $rdvDateHeure2): self
  577.     {
  578.         $this->rdvDateHeure2 $rdvDateHeure2;
  579.         return $this;
  580.     }
  581.     public function getRdvDateheure3(): ?\DateTimeInterface
  582.     {
  583.         return $this->rdvDateheure3;
  584.     }
  585.     public function setRdvDateheure3(?\DateTimeInterface $rdvDateheure3): self
  586.     {
  587.         $this->rdvDateheure3 $rdvDateheure3;
  588.         return $this;
  589.     }
  590.     public function getRdvDateHeure4(): ?\DateTimeInterface
  591.     {
  592.         return $this->rdvDateHeure4;
  593.     }
  594.     public function setRdvDateHeure4(?\DateTimeInterface $rdvDateHeure4): self
  595.     {
  596.         $this->rdvDateHeure4 $rdvDateHeure4;
  597.         return $this;
  598.     }
  599.     public function getRdvDateHeure5(): ?\DateTimeInterface
  600.     {
  601.         return $this->rdvDateHeure5;
  602.     }
  603.     public function setRdvDateHeure5(?\DateTimeInterface $rdvDateHeure5): self
  604.     {
  605.         $this->rdvDateHeure5 $rdvDateHeure5;
  606.         return $this;
  607.     }
  608.     public function getRdvDateHeure6(): ?\DateTimeInterface
  609.     {
  610.         return $this->rdvDateHeure6;
  611.     }
  612.     public function setRdvDateHeure6(?\DateTimeInterface $rdvDateHeure6): self
  613.     {
  614.         $this->rdvDateHeure6 $rdvDateHeure6;
  615.         return $this;
  616.     }
  617.     public function getDescriptionDenonciations(): ?string
  618.     {
  619.         return $this->descriptionDenonciations;
  620.     }
  621.     public function setDescriptionDenonciations(?string $descriptionDenonciations): self
  622.     {
  623.         $this->descriptionDenonciations $descriptionDenonciations;
  624.         return $this;
  625.     }
  626.     public function getDescriptionSecteur(): ?string
  627.     {
  628.         return $this->descriptionSecteur;
  629.     }
  630.     public function setDescriptionSecteur(?string $descriptionSecteur): self
  631.     {
  632.         $this->descriptionSecteur $descriptionSecteur;
  633.         return $this;
  634.     }
  635.     public function getDescriptionCriteresParticuliers(): ?string
  636.     {
  637.         return $this->descriptionCriteresParticuliers;
  638.     }
  639.     public function setDescriptionCriteresParticuliers(?string $descriptionCriteresParticuliers): self
  640.     {
  641.         $this->descriptionCriteresParticuliers $descriptionCriteresParticuliers;
  642.         return $this;
  643.     }
  644.     public function getDescriptionCriteresGeneraux(): ?string
  645.     {
  646.         return $this->descriptionCriteresGeneraux;
  647.     }
  648.     public function setDescriptionCriteresGeneraux(?string $descriptionCriteresGeneraux): self
  649.     {
  650.         $this->descriptionCriteresGeneraux $descriptionCriteresGeneraux;
  651.         return $this;
  652.     }
  653.     public function getDescriptionSituationActuelle(): ?string
  654.     {
  655.         return $this->descriptionSituationActuelle;
  656.     }
  657.     public function setDescriptionSituationActuelle(?string $descriptionSituationActuelle): self
  658.     {
  659.         $this->descriptionSituationActuelle $descriptionSituationActuelle;
  660.         return $this;
  661.     }
  662.     public function getDescriptionProgrammesProposes(): ?string
  663.     {
  664.         return $this->descriptionProgrammesProposes;
  665.     }
  666.     public function setDescriptionProgrammesProposes(?string $descriptionProgrammesProposes): self
  667.     {
  668.         $this->descriptionProgrammesProposes $descriptionProgrammesProposes;
  669.         return $this;
  670.     }
  671.     /**
  672.      * @return Collection|Demande[]
  673.      */
  674.     public function getDemandes(): Collection
  675.     {
  676.         return $this->demandes;
  677.     }
  678.     public function addDemande(Demande $demande): self
  679.     {
  680.         if (!$this->demandes->contains($demande)) {
  681.             $this->demandes[] = $demande;
  682.             $demande->setAuteur($this);
  683.         }
  684.         return $this;
  685.     }
  686.     public function removeDemande(Demande $demande): self
  687.     {
  688.         if ($this->demandes->removeElement($demande)) {
  689.             // set the owning side to null (unless already changed)
  690.             if ($demande->getAuteur() === $this) {
  691.                 $demande->setAuteur(null);
  692.             }
  693.         }
  694.         return $this;
  695.     }
  696.     public function getEmprunteurVille(): ?string
  697.     {
  698.         return strtoupper($this->emprunteurVille);
  699.     }
  700.     public function setEmprunteurVille(?string $emprunteurVille): self
  701.     {
  702.         $this->emprunteurVille $emprunteurVille;
  703.         return $this;
  704.     }
  705.     public function getEmprunteurCodePostal(): ?string
  706.     {
  707.         return strtoupper($this->emprunteurCodePostal);
  708.     }
  709.     public function setEmprunteurCodePostal(?string $emprunteurCodePostal): self
  710.     {
  711.         $this->emprunteurCodePostal $emprunteurCodePostal;
  712.         return $this;
  713.     }
  714.     /**
  715.      * @return Collection|Proposition[]
  716.      */
  717.     public function getPropositions(): Collection
  718.     {
  719.         return $this->propositions;
  720.     }
  721.     public function addProposition(Proposition $proposition): self
  722.     {
  723.         if (!$this->propositions->contains($proposition)) {
  724.             $this->propositions[] = $proposition;
  725.             $proposition->setProspect($this);
  726.         }
  727.         return $this;
  728.     }
  729.     public function getPropositionsReverse()
  730.     {
  731.         $sort = new Criteria(null, ['dateheure' => Criteria::DESC]);
  732.         return $this->propositions->matching($sort);
  733.     }
  734.     public function removeProposition(Proposition $proposition): self
  735.     {
  736.         if ($this->propositions->removeElement($proposition)) {
  737.             // set the owning side to null (unless already changed)
  738.             if ($proposition->getProspect() === $this) {
  739.                 $proposition->setProspect(null);
  740.             }
  741.         }
  742.         return $this;
  743.     }
  744.     /**
  745.      * @return Collection|Proposition[]
  746.      */
  747.     public function getActivePropositions(): Collection
  748.     {
  749.         return $this->propositions->filter(function(Proposition $proposition) {
  750.             return $proposition->isActiveProposition();
  751.         });
  752.     }
  753.     public function getCoemprunteurVille(): ?string
  754.     {
  755.         return $this->coemprunteurVille;
  756.     }
  757.     public function setCoemprunteurVille(?string $coemprunteurVille): self
  758.     {
  759.         $this->coemprunteurVille $coemprunteurVille;
  760.         return $this;
  761.     }
  762.     public function getCoemprunteurCodePostal(): ?string
  763.     {
  764.         return $this->coemprunteurCodePostal;
  765.     }
  766.     public function setCoemprunteurCodePostal(?string $coemprunteurCodePostal): self
  767.     {
  768.         $this->coemprunteurCodePostal $coemprunteurCodePostal;
  769.         return $this;
  770.     }
  771.     public function getToken(): ?string
  772.     {
  773.         return $this->token;
  774.     }
  775.     public function setToken(string $token): self
  776.     {
  777.         $this->token $token;
  778.         return $this;
  779.     }
  780.     /**
  781.      * @return Collection|Impression[]
  782.      */
  783.     public function getImpressions(): Collection
  784.     {
  785.         return $this->impressions;
  786.     }
  787.     public function addImpression(Impression $impression): self
  788.     {
  789.         if (!$this->impressions->contains($impression)) {
  790.             $this->impressions[] = $impression;
  791.             $impression->setProspect($this);
  792.         }
  793.         return $this;
  794.     }
  795.     public function removeImpression(Impression $impression): self
  796.     {
  797.         if ($this->impressions->removeElement($impression)) {
  798.             // set the owning side to null (unless already changed)
  799.             if ($impression->getProspect() === $this) {
  800.                 $impression->setProspect(null);
  801.             }
  802.         }
  803.         return $this;
  804.     }
  805.     /**
  806.      * @return Collection|Historique[]
  807.      */
  808.     public function getHistoriques(): Collection
  809.     {
  810.         return $this->historiques;
  811.     }
  812.     public function getHistoriquesUniqueExpediteur(): array
  813.     {
  814.         $uniqueExpediteursList = array();
  815.         foreach($this->historiques as $historique){
  816.             $expediteur $historique->getExpediteur();
  817.             if(!in_array($expediteur$uniqueExpediteursList)){
  818.                 $uniqueExpediteursList[] = $expediteur;
  819.             }
  820.         }
  821.         return $uniqueExpediteursList;
  822.     }
  823.     public function addHistorique(Historique $historique): self
  824.     {
  825.         if (!$this->historiques->contains($historique)) {
  826.             $this->historiques[] = $historique;
  827.             $historique->setProspect($this);
  828.         }
  829.         return $this;
  830.     }
  831.     public function removeHistorique(Historique $historique): self
  832.     {
  833.         if ($this->historiques->removeElement($historique)) {
  834.             // set the owning side to null (unless already changed)
  835.             if ($historique->getProspect() === $this) {
  836.                 $historique->setProspect(null);
  837.             }
  838.         }
  839.         return $this;
  840.     }
  841.     public function getType(): ?array
  842.     {
  843.         return $this->type;
  844.     }
  845.     public function setType(?array $type): self
  846.     {
  847.         $this->type $type;
  848.         return $this;
  849.     }
  850.     /**
  851.      * @return Collection|Denonciation[]
  852.      */
  853.     public function getDenonciations(): Collection
  854.     {
  855.         return $this->denonciations;
  856.     }
  857.     public function addDenonciation(Denonciation $denonciation): self
  858.     {
  859.         if (!$this->denonciations->contains($denonciation)) {
  860.             $this->denonciations[] = $denonciation;
  861.             $denonciation->setProspect($this);
  862.         }
  863.         return $this;
  864.     }
  865.     public function removeDenonciation(Denonciation $denonciation): self
  866.     {
  867.         if ($this->denonciations->removeElement($denonciation)) {
  868.             // set the owning side to null (unless already changed)
  869.             if ($denonciation->getProspect() === $this) {
  870.                 $denonciation->setProspect(null);
  871.             }
  872.         }
  873.         return $this;
  874.     }
  875.     public function getStatut(): ?string
  876.     {
  877.         return $this->statut;
  878.     }
  879.     public function setStatut(?string $statut): self
  880.     {
  881.         $this->statut $statut;
  882.         return $this;
  883.     }
  884.     public function isAfficherNomCoEmprunteur(): ?bool
  885.     {
  886.         return $this->afficherNomCoEmprunteur;
  887.     }
  888.     public function setAfficherNomCoEmprunteur(?bool $afficherNomCoEmprunteur): self
  889.     {
  890.         $this->afficherNomCoEmprunteur $afficherNomCoEmprunteur;
  891.         return $this;
  892.     }
  893.     public function isAfficherNomEmprunteur(): ?bool
  894.     {
  895.         return $this->afficherNomEmprunteur;
  896.     }
  897.     public function setAfficherNomEmprunteur(?bool $afficherNomEmprunteur): self
  898.     {
  899.         $this->afficherNomEmprunteur $afficherNomEmprunteur;
  900.         return $this;
  901.     }
  902.     public function getAuteur(): ?Utilisateur
  903.     {
  904.         return $this->auteur;
  905.     }
  906.     public function setAuteur(?Utilisateur $auteur): self
  907.     {
  908.         $this->auteur $auteur;
  909.         return $this;
  910.     }
  911.     public function getEntreprise(): ?Entreprise
  912.     {
  913.         return $this->entreprise;
  914.     }
  915.     public function setEntreprise(?Entreprise $entreprise): self
  916.     {
  917.         $this->entreprise $entreprise;
  918.         return $this;
  919.     }
  920.     /**
  921.      * @return Collection<int, InfosSuivi>
  922.      */
  923.     public function getInfosSuivis(): Collection
  924.     {
  925.         return $this->infosSuivis;
  926.     }
  927.     public function addInfosSuivi(InfosSuivi $infosSuivi): self
  928.     {
  929.         if (!$this->infosSuivis->contains($infosSuivi)) {
  930.             $this->infosSuivis[] = $infosSuivi;
  931.             $infosSuivi->addProspect($this);
  932.         }
  933.         return $this;
  934.     }
  935.     public function removeInfosSuivi(InfosSuivi $infosSuivi): self
  936.     {
  937.         if ($this->infosSuivis->removeElement($infosSuivi)) {
  938.             $infosSuivi->removeProspect($this);
  939.         }
  940.         return $this;
  941.     }
  942.     /**
  943.      * @return Collection<int, ActionTrace>
  944.      */
  945.     public function getActionTraces(): Collection
  946.     {
  947.         return $this->actionTraces;
  948.     }
  949.     public function addActionTrace(ActionTrace $actionTrace): self
  950.     {
  951.         if (!$this->actionTraces->contains($actionTrace)) {
  952.             $this->actionTraces[] = $actionTrace;
  953.             $actionTrace->setProspect($this);
  954.         }
  955.         return $this;
  956.     }
  957.     public function removeActionTrace(ActionTrace $actionTrace): self
  958.     {
  959.         if ($this->actionTraces->removeElement($actionTrace)) {
  960.             // set the owning side to null (unless already changed)
  961.             if ($actionTrace->getProspect() === $this) {
  962.                 $actionTrace->setProspect(null);
  963.             }
  964.         }
  965.         return $this;
  966.     }
  967.     public function getActionsCommerciales(): string
  968.     {
  969.         if ($this->actionTraces->isEmpty()) {
  970.             return '';
  971.         }
  972.         $actions = [];
  973.         foreach ($this->actionTraces as $actionTrace) {
  974.             $date $actionTrace->getCreatedAt() ? $actionTrace->getCreatedAt()->format('d/m/Y H:i') : '';
  975.             $user $actionTrace->getUser() ? $actionTrace->getUser()->getNomEtPrenom() : '';
  976.             $type $actionTrace->getType() ?: '';
  977.             $description $actionTrace->getDescription() ? ' - ' $actionTrace->getDescription() : '';
  978.             $actions[] = sprintf('[%s] %s par %s%s'$date$type$user$description);
  979.         }
  980.         return implode(PHP_EOL$actions);
  981.     }
  982.     public function getLastActionTrace(): string
  983.     {
  984.         if ($this->actionTraces->isEmpty()) {
  985.             return '';
  986.         }
  987.         $lastAction $this->actionTraces->last();
  988.         $date $lastAction->getCreatedAt() ? $lastAction->getCreatedAt()->format('d/m/Y H:i') : '';
  989.         $type $lastAction->getType() ?: '';
  990.         return sprintf('[%s] %s'$date$type);
  991.     }
  992.     /**
  993.      * Retourne le libellé lisible du statut
  994.      */
  995.     public function getStatutLibelle(): ?string
  996.     {
  997.         $statuts = [
  998.             'atraiter' => 'À traiter',
  999.             'attentenouveaute' => 'À relancer',
  1000.             'encourstraitement' => 'En cours de traitement',
  1001.             'reservation' => 'Réservation',
  1002.             'adejatrouve' => 'À externaliser',
  1003.             'archive' => 'Archivé',
  1004.             null => 'Non classé'
  1005.         ];
  1006.         return $statuts[$this->statut] ?? 'Non classé';
  1007.     }
  1008.     /**
  1009.      * @return Collection<int, Typologie>
  1010.      */
  1011.     public function getTypologies(): Collection
  1012.     {
  1013.         return $this->typologies;
  1014.     }
  1015.     public function addTypologie(Typologie $typologie): self
  1016.     {
  1017.         if (!$this->typologies->contains($typologie)) {
  1018.             $this->typologies[] = $typologie;
  1019.         }
  1020.         return $this;
  1021.     }
  1022.     public function removeTypologie(Typologie $typologie): self
  1023.     {
  1024.         $this->typologies->removeElement($typologie);
  1025.         return $this;
  1026.     }
  1027.     /**
  1028.      * @return Collection<int, SecteurGeographique>
  1029.      */
  1030.     public function getSecteursGeographiques(): Collection
  1031.     {
  1032.         return $this->secteursGeographiques;
  1033.     }
  1034.     public function addSecteurGeographique(SecteurGeographique $secteurGeographique): self
  1035.     {
  1036.         if (!$this->secteursGeographiques->contains($secteurGeographique)) {
  1037.             $this->secteursGeographiques[] = $secteurGeographique;
  1038.         }
  1039.         return $this;
  1040.     }
  1041.     public function removeSecteurGeographique(SecteurGeographique $secteurGeographique): self
  1042.     {
  1043.         $this->secteursGeographiques->removeElement($secteurGeographique);
  1044.         return $this;
  1045.     }
  1046.     /**
  1047.      * @return Collection<int, Etage>
  1048.      */
  1049.     public function getEtages(): Collection
  1050.     {
  1051.         return $this->etages;
  1052.     }
  1053.     public function addEtage(Etage $etage): self
  1054.     {
  1055.         if (!$this->etages->contains($etage)) {
  1056.             $this->etages[] = $etage;
  1057.         }
  1058.         return $this;
  1059.     }
  1060.     public function removeEtage(Etage $etage): self
  1061.     {
  1062.         $this->etages->removeElement($etage);
  1063.         return $this;
  1064.     }
  1065.     /**
  1066.      * @return Collection<int, VilleProgramme>
  1067.      */
  1068.     public function getVillesProgrammes(): Collection
  1069.     {
  1070.         return $this->villesProgrammes;
  1071.     }
  1072.     public function addVilleProgramme(VilleProgramme $villeProgramme): self
  1073.     {
  1074.         if (!$this->villesProgrammes->contains($villeProgramme)) {
  1075.             $this->villesProgrammes[] = $villeProgramme;
  1076.         }
  1077.         return $this;
  1078.     }
  1079.     public function removeVilleProgramme(VilleProgramme $villeProgramme): self
  1080.     {
  1081.         $this->villesProgrammes->removeElement($villeProgramme);
  1082.         return $this;
  1083.     }
  1084.     public function getTypologie(): ?Typologie
  1085.     {
  1086.         return $this->typologies->first() ?: null;
  1087.     }
  1088.     public function setTypologie(?Typologie $typologie): self
  1089.     {
  1090.         $this->typologies->clear();
  1091.         if ($typologie) {
  1092.             $this->addTypologie($typologie);
  1093.         }
  1094.         return $this;
  1095.     }
  1096.     public function getSecteurGeographique(): ?SecteurGeographique
  1097.     {
  1098.         return $this->secteursGeographiques->first() ?: null;
  1099.     }
  1100.     public function setSecteurGeographique(?SecteurGeographique $secteurGeographique): self
  1101.     {
  1102.         $this->secteursGeographiques->clear();
  1103.         if ($secteurGeographique) {
  1104.             $this->addSecteurGeographique($secteurGeographique);
  1105.         }
  1106.         return $this;
  1107.     }
  1108.     public function getEtage(): ?Etage
  1109.     {
  1110.         return $this->etages->first() ?: null;
  1111.     }
  1112.     public function setEtage(?Etage $etage): self
  1113.     {
  1114.         $this->etages->clear();
  1115.         if ($etage) {
  1116.             $this->addEtage($etage);
  1117.         }
  1118.         return $this;
  1119.     }
  1120.     public function getVilleProgramme(): ?VilleProgramme
  1121.     {
  1122.         return $this->villesProgrammes->first() ?: null;
  1123.     }
  1124.     public function setVilleProgramme(?VilleProgramme $villeProgramme): self
  1125.     {
  1126.         $this->villesProgrammes->clear();
  1127.         if ($villeProgramme) {
  1128.             $this->addVilleProgramme($villeProgramme);
  1129.         }
  1130.         return $this;
  1131.     }
  1132.     /**
  1133.      * Retourne les typologies sous forme de chaîne pour l'export
  1134.      */
  1135.     public function getTypologiesAsString(): string
  1136.     {
  1137.         if ($this->typologies->isEmpty()) {
  1138.             return '';
  1139.         }
  1140.         $names = [];
  1141.         foreach ($this->typologies as $typologie) {
  1142.             $names[] = $typologie->getNom();
  1143.         }
  1144.         return implode(', '$names);
  1145.     }
  1146.     /**
  1147.      * Retourne les secteurs géographiques sous forme de chaîne pour l'export
  1148.      */
  1149.     public function getSecteursGeographiquesAsString(): string
  1150.     {
  1151.         if ($this->secteursGeographiques->isEmpty()) {
  1152.             return '';
  1153.         }
  1154.         $names = [];
  1155.         foreach ($this->secteursGeographiques as $secteur) {
  1156.             $names[] = $secteur->getNom();
  1157.         }
  1158.         return implode(', '$names);
  1159.     }
  1160.     /**
  1161.      * Retourne les étages sous forme de chaîne pour l'export
  1162.      */
  1163.     public function getEtagesAsString(): string
  1164.     {
  1165.         if ($this->etages->isEmpty()) {
  1166.             return '';
  1167.         }
  1168.         $names = [];
  1169.         foreach ($this->etages as $etage) {
  1170.             $names[] = $etage->getNom();
  1171.         }
  1172.         return implode(', '$names);
  1173.     }
  1174.     /**
  1175.      * Retourne les villes/programmes sous forme de chaîne pour l'export
  1176.      */
  1177.     public function getVillesProgrammesAsString(): string
  1178.     {
  1179.         if ($this->villesProgrammes->isEmpty()) {
  1180.             return '';
  1181.         }
  1182.         $names = [];
  1183.         foreach ($this->villesProgrammes as $ville) {
  1184.             $names[] = $ville->getNom();
  1185.         }
  1186.         return implode(', '$names);
  1187.     }
  1188. }