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.     /**
  280.      * @ORM\Column(type="datetime", nullable=true)
  281.      */
  282.     private $dateCliqueATraiter;
  283.     public function __toString() {
  284.         return ($this->getId() == null 'Nouvelle fiche' trim($this->getEmprunteurNom().' '.$this->getEmprunteurPrenom()));
  285.     }
  286.     public function __construct() {
  287.         $this->dateheure = new \DateTime("now");
  288.         $this->demandes = new ArrayCollection();
  289.         $this->propositions = new ArrayCollection();
  290.         $this->token $this->generateUid(6);
  291.         $this->impressions = new ArrayCollection();
  292.         $this->historiques = new ArrayCollection();
  293.         $this->denonciations = new ArrayCollection();
  294.         $this->infosSuivis = new ArrayCollection();
  295.         $this->actionTraces = new ArrayCollection();
  296.         $this->typologies = new ArrayCollection();
  297.         $this->secteursGeographiques = new ArrayCollection();
  298.         $this->etages = new ArrayCollection();
  299.         $this->villesProgrammes = new ArrayCollection();
  300.     }
  301.     public function generateUid($l=10){
  302.         return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyz"), 0$l);
  303.     }
  304.     public function lotIsProposed($lotId) {
  305.         $contains false;
  306.         foreach($this->getPropositions() as $p) {
  307.             if($p->getLot()->getId() == $lotId$contains true;
  308.         }
  309.         return $contains;
  310.     }
  311.     public function getId(): ?int
  312.     {
  313.         return $this->id;
  314.     }
  315.     public function getDateheure(): ?\DateTimeInterface
  316.     {
  317.         return $this->dateheure;
  318.     }
  319.     public function setDateheure(\DateTimeInterface $dateheure): self
  320.     {
  321.         $this->dateheure $dateheure;
  322.         return $this;
  323.     }
  324.     public function getDateDerniereModification(): ?\DateTimeInterface
  325.     {
  326.         return $this->dateDerniereModification;
  327.     }
  328.     public function setDateDerniereModification(\DateTimeInterface $dateDerniereModification): self
  329.     {
  330.         $this->dateDerniereModification $dateDerniereModification;
  331.         return $this;
  332.     }
  333.     public function getApporteur(): ?string
  334.     {
  335.         return strtoupper($this->apporteur);
  336.     }
  337.     public function setApporteur(?string $apporteur): self
  338.     {
  339.         $this->apporteur $apporteur;
  340.         return $this;
  341.     }
  342.     public function getSociete(): ?string
  343.     {
  344.         return $this->societe;
  345.     }
  346.     public function setSociete(?string $societe): self
  347.     {
  348.         $this->societe $societe;
  349.         return $this;
  350.     }
  351.     public function getEmprunteurNom(): ?string
  352.     {
  353.         return strtoupper($this->emprunteurNom);
  354.     }
  355.     public function setEmprunteurNom(?string $emprunteurNom): self
  356.     {
  357.         $this->emprunteurNom $emprunteurNom;
  358.         return $this;
  359.     }
  360.     public function getEmprunteurPrenom(): ?string
  361.     {
  362.         return strtoupper($this->emprunteurPrenom);
  363.     }
  364.     public function setEmprunteurPrenom(?string $emprunteurPrenom): self
  365.     {
  366.         $this->emprunteurPrenom $emprunteurPrenom;
  367.         return $this;
  368.     }
  369.     public function getEmprunteurDateNaissance(): ?\DateTimeInterface
  370.     {
  371.         return $this->emprunteurDateNaissance;
  372.     }
  373.     public function setEmprunteurDateNaissance(?\DateTimeInterface $emprunteurDateNaissance): self
  374.     {
  375.         $this->emprunteurDateNaissance $emprunteurDateNaissance;
  376.         return $this;
  377.     }
  378.     public function getEmprunteurAdresse(): ?string
  379.     {
  380.         return $this->emprunteurAdresse;
  381.     }
  382.     public function setEmprunteurAdresse(?string $emprunteurAdresse): self
  383.     {
  384.         $this->emprunteurAdresse $emprunteurAdresse;
  385.         return $this;
  386.     }
  387.     public function getEmprunteurTelFr(): ?string
  388.     {
  389.         return $this->emprunteurTelFr;
  390.     }
  391.     public function setEmprunteurTelFr(?string $emprunteurTelFr): self
  392.     {
  393.         $this->emprunteurTelFr $emprunteurTelFr;
  394.         return $this;
  395.     }
  396.     public function getEmprunteurTelCh(): ?string
  397.     {
  398.         return $this->emprunteurTelCh;
  399.     }
  400.     public function setEmprunteurTelCh(?string $emprunteurTelCh): self
  401.     {
  402.         $this->emprunteurTelCh $emprunteurTelCh;
  403.         return $this;
  404.     }
  405.     public function getEmprunteurEmail(): ?string
  406.     {
  407.         return strtolower($this->emprunteurEmail);
  408.     }
  409.     public function setEmprunteurEmail(?string $emprunteurEmail): self
  410.     {
  411.         $this->emprunteurEmail $emprunteurEmail;
  412.         return $this;
  413.     }
  414.     public function getEmprunteurLieuTravail(): ?string
  415.     {
  416.         return $this->emprunteurLieuTravail;
  417.     }
  418.     public function setEmprunteurLieuTravail(?string $emprunteurLieuTravail): self
  419.     {
  420.         $this->emprunteurLieuTravail $emprunteurLieuTravail;
  421.         return $this;
  422.     }
  423.     public function getCoEmprunteurNom(): ?string
  424.     {
  425.         return $this->coEmprunteurNom;
  426.     }
  427.     public function setCoEmprunteurNom(?string $coEmprunteurNom): self
  428.     {
  429.         $this->coEmprunteurNom $coEmprunteurNom;
  430.         return $this;
  431.     }
  432.     public function getCoEmprunteurPrenom(): ?string
  433.     {
  434.         return $this->coEmprunteurPrenom;
  435.     }
  436.     public function setCoEmprunteurPrenom(?string $coEmprunteurPrenom): self
  437.     {
  438.         $this->coEmprunteurPrenom $coEmprunteurPrenom;
  439.         return $this;
  440.     }
  441.     public function getCoEmprunteurDateNaissance(): ?\DateTimeInterface
  442.     {
  443.         return $this->coEmprunteurDateNaissance;
  444.     }
  445.     public function setCoEmprunteurDateNaissance(?\DateTimeInterface $coEmprunteurDateNaissance): self
  446.     {
  447.         $this->coEmprunteurDateNaissance $coEmprunteurDateNaissance;
  448.         return $this;
  449.     }
  450.     public function getCoEmprunteurAdresse(): ?string
  451.     {
  452.         return $this->coEmprunteurAdresse;
  453.     }
  454.     public function setCoEmprunteurAdresse(?string $coEmprunteurAdresse): self
  455.     {
  456.         $this->coEmprunteurAdresse $coEmprunteurAdresse;
  457.         return $this;
  458.     }
  459.     public function getCoEmprunteurTelFr(): ?string
  460.     {
  461.         return $this->coEmprunteurTelFr;
  462.     }
  463.     public function setCoEmprunteurTelFr(?string $coEmprunteurTelFr): self
  464.     {
  465.         $this->coEmprunteurTelFr $coEmprunteurTelFr;
  466.         return $this;
  467.     }
  468.     public function getCoEmprunteurTelCh(): ?string
  469.     {
  470.         return $this->coEmprunteurTelCh;
  471.     }
  472.     public function setCoEmprunteurTelCh(?string $coEmprunteurTelCh): self
  473.     {
  474.         $this->coEmprunteurTelCh $coEmprunteurTelCh;
  475.         return $this;
  476.     }
  477.     public function getCoEmprunteurEmail(): ?string
  478.     {
  479.         return $this->coEmprunteurEmail;
  480.     }
  481.     public function setCoEmprunteurEmail(?string $coEmprunteurEmail): self
  482.     {
  483.         $this->coEmprunteurEmail $coEmprunteurEmail;
  484.         return $this;
  485.     }
  486.     public function getCoEmprunteurLieuTravail(): ?string
  487.     {
  488.         return $this->coEmprunteurLieuTravail;
  489.     }
  490.     public function setCoEmprunteurLieuTravail(?string $coEmprunteurLieuTravail): self
  491.     {
  492.         $this->coEmprunteurLieuTravail $coEmprunteurLieuTravail;
  493.         return $this;
  494.     }
  495.     public function getIsRP(): ?bool
  496.     {
  497.         return $this->isRP;
  498.     }
  499.     public function setIsRP(?bool $isRP): self
  500.     {
  501.         $this->isRP $isRP;
  502.         return $this;
  503.     }
  504.     public function getIsLocatif(): ?bool
  505.     {
  506.         return $this->isLocatif;
  507.     }
  508.     public function setIsLocatif(?bool $isLocatif): self
  509.     {
  510.         $this->isLocatif $isLocatif;
  511.         return $this;
  512.     }
  513.     public function getIsTerrain(): ?bool
  514.     {
  515.         return $this->isTerrain;
  516.     }
  517.     public function setIsTerrain(?bool $isTerrain): self
  518.     {
  519.         $this->isTerrain $isTerrain;
  520.         return $this;
  521.     }
  522.     public function getIsConstruction(): ?bool
  523.     {
  524.         return $this->isConstruction;
  525.     }
  526.     public function setIsConstruction(?bool $isConstruction): self
  527.     {
  528.         $this->isConstruction $isConstruction;
  529.         return $this;
  530.     }
  531.     public function getIsLMNP(): ?bool
  532.     {
  533.         return $this->isLMNP;
  534.     }
  535.     public function setIsLMNP(?bool $isLMNP): self
  536.     {
  537.         $this->isLMNP $isLMNP;
  538.         return $this;
  539.     }
  540.     public function getBudgetApproximatif(): ?float
  541.     {
  542.         return $this->budgetApproximatif;
  543.     }
  544.     public function setBudgetApproximatif(?float $budgetApproximatif): self
  545.     {
  546.         $this->budgetApproximatif $budgetApproximatif;
  547.         return $this;
  548.     }
  549.     public function getMensualiteSouhaitee(): ?float
  550.     {
  551.         return $this->mensualiteSouhaitee;
  552.     }
  553.     public function setMensualiteSouhaitee(?float $mensualiteSouhaitee): self
  554.     {
  555.         $this->mensualiteSouhaitee $mensualiteSouhaitee;
  556.         return $this;
  557.     }
  558.     public function getDescriptionProjetGlobal(): ?string
  559.     {
  560.         return $this->descriptionProjetGlobal;
  561.     }
  562.     public function setDescriptionProjetGlobal(?string $descriptionProjetGlobal): self
  563.     {
  564.         $this->descriptionProjetGlobal $descriptionProjetGlobal;
  565.         return $this;
  566.     }
  567.     public function getRdvDateHeure1(): ?\DateTimeInterface
  568.     {
  569.         return $this->rdvDateHeure1;
  570.     }
  571.     public function setRdvDateHeure1(?\DateTimeInterface $rdvDateHeure1): self
  572.     {
  573.         $this->rdvDateHeure1 $rdvDateHeure1;
  574.         return $this;
  575.     }
  576.     public function getRdvDateHeure2(): ?\DateTimeInterface
  577.     {
  578.         return $this->rdvDateHeure2;
  579.     }
  580.     public function setRdvDateHeure2(?\DateTimeInterface $rdvDateHeure2): self
  581.     {
  582.         $this->rdvDateHeure2 $rdvDateHeure2;
  583.         return $this;
  584.     }
  585.     public function getRdvDateheure3(): ?\DateTimeInterface
  586.     {
  587.         return $this->rdvDateheure3;
  588.     }
  589.     public function setRdvDateheure3(?\DateTimeInterface $rdvDateheure3): self
  590.     {
  591.         $this->rdvDateheure3 $rdvDateheure3;
  592.         return $this;
  593.     }
  594.     public function getRdvDateHeure4(): ?\DateTimeInterface
  595.     {
  596.         return $this->rdvDateHeure4;
  597.     }
  598.     public function setRdvDateHeure4(?\DateTimeInterface $rdvDateHeure4): self
  599.     {
  600.         $this->rdvDateHeure4 $rdvDateHeure4;
  601.         return $this;
  602.     }
  603.     public function getRdvDateHeure5(): ?\DateTimeInterface
  604.     {
  605.         return $this->rdvDateHeure5;
  606.     }
  607.     public function setRdvDateHeure5(?\DateTimeInterface $rdvDateHeure5): self
  608.     {
  609.         $this->rdvDateHeure5 $rdvDateHeure5;
  610.         return $this;
  611.     }
  612.     public function getRdvDateHeure6(): ?\DateTimeInterface
  613.     {
  614.         return $this->rdvDateHeure6;
  615.     }
  616.     public function setRdvDateHeure6(?\DateTimeInterface $rdvDateHeure6): self
  617.     {
  618.         $this->rdvDateHeure6 $rdvDateHeure6;
  619.         return $this;
  620.     }
  621.     public function getDescriptionDenonciations(): ?string
  622.     {
  623.         return $this->descriptionDenonciations;
  624.     }
  625.     public function setDescriptionDenonciations(?string $descriptionDenonciations): self
  626.     {
  627.         $this->descriptionDenonciations $descriptionDenonciations;
  628.         return $this;
  629.     }
  630.     public function getDescriptionSecteur(): ?string
  631.     {
  632.         return $this->descriptionSecteur;
  633.     }
  634.     public function setDescriptionSecteur(?string $descriptionSecteur): self
  635.     {
  636.         $this->descriptionSecteur $descriptionSecteur;
  637.         return $this;
  638.     }
  639.     public function getDescriptionCriteresParticuliers(): ?string
  640.     {
  641.         return $this->descriptionCriteresParticuliers;
  642.     }
  643.     public function setDescriptionCriteresParticuliers(?string $descriptionCriteresParticuliers): self
  644.     {
  645.         $this->descriptionCriteresParticuliers $descriptionCriteresParticuliers;
  646.         return $this;
  647.     }
  648.     public function getDescriptionCriteresGeneraux(): ?string
  649.     {
  650.         return $this->descriptionCriteresGeneraux;
  651.     }
  652.     public function setDescriptionCriteresGeneraux(?string $descriptionCriteresGeneraux): self
  653.     {
  654.         $this->descriptionCriteresGeneraux $descriptionCriteresGeneraux;
  655.         return $this;
  656.     }
  657.     public function getDescriptionSituationActuelle(): ?string
  658.     {
  659.         return $this->descriptionSituationActuelle;
  660.     }
  661.     public function setDescriptionSituationActuelle(?string $descriptionSituationActuelle): self
  662.     {
  663.         $this->descriptionSituationActuelle $descriptionSituationActuelle;
  664.         return $this;
  665.     }
  666.     public function getDescriptionProgrammesProposes(): ?string
  667.     {
  668.         return $this->descriptionProgrammesProposes;
  669.     }
  670.     public function setDescriptionProgrammesProposes(?string $descriptionProgrammesProposes): self
  671.     {
  672.         $this->descriptionProgrammesProposes $descriptionProgrammesProposes;
  673.         return $this;
  674.     }
  675.     /**
  676.      * @return Collection|Demande[]
  677.      */
  678.     public function getDemandes(): Collection
  679.     {
  680.         return $this->demandes;
  681.     }
  682.     public function addDemande(Demande $demande): self
  683.     {
  684.         if (!$this->demandes->contains($demande)) {
  685.             $this->demandes[] = $demande;
  686.             $demande->setAuteur($this);
  687.         }
  688.         return $this;
  689.     }
  690.     public function removeDemande(Demande $demande): self
  691.     {
  692.         if ($this->demandes->removeElement($demande)) {
  693.             // set the owning side to null (unless already changed)
  694.             if ($demande->getAuteur() === $this) {
  695.                 $demande->setAuteur(null);
  696.             }
  697.         }
  698.         return $this;
  699.     }
  700.     public function getEmprunteurVille(): ?string
  701.     {
  702.         return strtoupper($this->emprunteurVille);
  703.     }
  704.     public function setEmprunteurVille(?string $emprunteurVille): self
  705.     {
  706.         $this->emprunteurVille $emprunteurVille;
  707.         return $this;
  708.     }
  709.     public function getEmprunteurCodePostal(): ?string
  710.     {
  711.         return strtoupper($this->emprunteurCodePostal);
  712.     }
  713.     public function setEmprunteurCodePostal(?string $emprunteurCodePostal): self
  714.     {
  715.         $this->emprunteurCodePostal $emprunteurCodePostal;
  716.         return $this;
  717.     }
  718.     /**
  719.      * @return Collection|Proposition[]
  720.      */
  721.     public function getPropositions(): Collection
  722.     {
  723.         return $this->propositions;
  724.     }
  725.     public function addProposition(Proposition $proposition): self
  726.     {
  727.         if (!$this->propositions->contains($proposition)) {
  728.             $this->propositions[] = $proposition;
  729.             $proposition->setProspect($this);
  730.         }
  731.         return $this;
  732.     }
  733.     public function getPropositionsReverse()
  734.     {
  735.         $sort = new Criteria(null, ['dateheure' => Criteria::DESC]);
  736.         return $this->propositions->matching($sort);
  737.     }
  738.     public function removeProposition(Proposition $proposition): self
  739.     {
  740.         if ($this->propositions->removeElement($proposition)) {
  741.             // set the owning side to null (unless already changed)
  742.             if ($proposition->getProspect() === $this) {
  743.                 $proposition->setProspect(null);
  744.             }
  745.         }
  746.         return $this;
  747.     }
  748.     /**
  749.      * @return Collection|Proposition[]
  750.      */
  751.     public function getActivePropositions(): Collection
  752.     {
  753.         return $this->propositions->filter(function(Proposition $proposition) {
  754.             return $proposition->isActiveProposition();
  755.         });
  756.     }
  757.     public function getCoemprunteurVille(): ?string
  758.     {
  759.         return $this->coemprunteurVille;
  760.     }
  761.     public function setCoemprunteurVille(?string $coemprunteurVille): self
  762.     {
  763.         $this->coemprunteurVille $coemprunteurVille;
  764.         return $this;
  765.     }
  766.     public function getCoemprunteurCodePostal(): ?string
  767.     {
  768.         return $this->coemprunteurCodePostal;
  769.     }
  770.     public function setCoemprunteurCodePostal(?string $coemprunteurCodePostal): self
  771.     {
  772.         $this->coemprunteurCodePostal $coemprunteurCodePostal;
  773.         return $this;
  774.     }
  775.     public function getToken(): ?string
  776.     {
  777.         return $this->token;
  778.     }
  779.     public function setToken(string $token): self
  780.     {
  781.         $this->token $token;
  782.         return $this;
  783.     }
  784.     /**
  785.      * @return Collection|Impression[]
  786.      */
  787.     public function getImpressions(): Collection
  788.     {
  789.         return $this->impressions;
  790.     }
  791.     public function addImpression(Impression $impression): self
  792.     {
  793.         if (!$this->impressions->contains($impression)) {
  794.             $this->impressions[] = $impression;
  795.             $impression->setProspect($this);
  796.         }
  797.         return $this;
  798.     }
  799.     public function removeImpression(Impression $impression): self
  800.     {
  801.         if ($this->impressions->removeElement($impression)) {
  802.             // set the owning side to null (unless already changed)
  803.             if ($impression->getProspect() === $this) {
  804.                 $impression->setProspect(null);
  805.             }
  806.         }
  807.         return $this;
  808.     }
  809.     /**
  810.      * @return Collection|Historique[]
  811.      */
  812.     public function getHistoriques(): Collection
  813.     {
  814.         return $this->historiques;
  815.     }
  816.     public function getHistoriquesUniqueExpediteur(): array
  817.     {
  818.         $uniqueExpediteursList = array();
  819.         foreach($this->historiques as $historique){
  820.             $expediteur $historique->getExpediteur();
  821.             if(!in_array($expediteur$uniqueExpediteursList)){
  822.                 $uniqueExpediteursList[] = $expediteur;
  823.             }
  824.         }
  825.         return $uniqueExpediteursList;
  826.     }
  827.     public function addHistorique(Historique $historique): self
  828.     {
  829.         if (!$this->historiques->contains($historique)) {
  830.             $this->historiques[] = $historique;
  831.             $historique->setProspect($this);
  832.         }
  833.         return $this;
  834.     }
  835.     public function removeHistorique(Historique $historique): self
  836.     {
  837.         if ($this->historiques->removeElement($historique)) {
  838.             // set the owning side to null (unless already changed)
  839.             if ($historique->getProspect() === $this) {
  840.                 $historique->setProspect(null);
  841.             }
  842.         }
  843.         return $this;
  844.     }
  845.     public function getType(): ?array
  846.     {
  847.         return $this->type;
  848.     }
  849.     public function setType(?array $type): self
  850.     {
  851.         $this->type $type;
  852.         return $this;
  853.     }
  854.     /**
  855.      * @return Collection|Denonciation[]
  856.      */
  857.     public function getDenonciations(): Collection
  858.     {
  859.         return $this->denonciations;
  860.     }
  861.     public function addDenonciation(Denonciation $denonciation): self
  862.     {
  863.         if (!$this->denonciations->contains($denonciation)) {
  864.             $this->denonciations[] = $denonciation;
  865.             $denonciation->setProspect($this);
  866.         }
  867.         return $this;
  868.     }
  869.     public function removeDenonciation(Denonciation $denonciation): self
  870.     {
  871.         if ($this->denonciations->removeElement($denonciation)) {
  872.             // set the owning side to null (unless already changed)
  873.             if ($denonciation->getProspect() === $this) {
  874.                 $denonciation->setProspect(null);
  875.             }
  876.         }
  877.         return $this;
  878.     }
  879.     public function getStatut(): ?string
  880.     {
  881.         return $this->statut;
  882.     }
  883.     public function setStatut(?string $statut): self
  884.     {
  885.         if ($statut === 'atraiter' && $this->statut !== 'atraiter') {
  886.             $this->dateCliqueATraiter null;
  887.         }
  888.         $this->statut $statut;
  889.         return $this;
  890.     }
  891.     public function isAfficherNomCoEmprunteur(): ?bool
  892.     {
  893.         return $this->afficherNomCoEmprunteur;
  894.     }
  895.     public function setAfficherNomCoEmprunteur(?bool $afficherNomCoEmprunteur): self
  896.     {
  897.         $this->afficherNomCoEmprunteur $afficherNomCoEmprunteur;
  898.         return $this;
  899.     }
  900.     public function isAfficherNomEmprunteur(): ?bool
  901.     {
  902.         return $this->afficherNomEmprunteur;
  903.     }
  904.     public function setAfficherNomEmprunteur(?bool $afficherNomEmprunteur): self
  905.     {
  906.         $this->afficherNomEmprunteur $afficherNomEmprunteur;
  907.         return $this;
  908.     }
  909.     public function getAuteur(): ?Utilisateur
  910.     {
  911.         return $this->auteur;
  912.     }
  913.     public function setAuteur(?Utilisateur $auteur): self
  914.     {
  915.         $this->auteur $auteur;
  916.         return $this;
  917.     }
  918.     public function getEntreprise(): ?Entreprise
  919.     {
  920.         return $this->entreprise;
  921.     }
  922.     public function setEntreprise(?Entreprise $entreprise): self
  923.     {
  924.         $this->entreprise $entreprise;
  925.         return $this;
  926.     }
  927.     /**
  928.      * @return Collection<int, InfosSuivi>
  929.      */
  930.     public function getInfosSuivis(): Collection
  931.     {
  932.         return $this->infosSuivis;
  933.     }
  934.     public function addInfosSuivi(InfosSuivi $infosSuivi): self
  935.     {
  936.         if (!$this->infosSuivis->contains($infosSuivi)) {
  937.             $this->infosSuivis[] = $infosSuivi;
  938.             $infosSuivi->addProspect($this);
  939.         }
  940.         return $this;
  941.     }
  942.     public function removeInfosSuivi(InfosSuivi $infosSuivi): self
  943.     {
  944.         if ($this->infosSuivis->removeElement($infosSuivi)) {
  945.             $infosSuivi->removeProspect($this);
  946.         }
  947.         return $this;
  948.     }
  949.     /**
  950.      * @return Collection<int, ActionTrace>
  951.      */
  952.     public function getActionTraces(): Collection
  953.     {
  954.         return $this->actionTraces;
  955.     }
  956.     public function addActionTrace(ActionTrace $actionTrace): self
  957.     {
  958.         if (!$this->actionTraces->contains($actionTrace)) {
  959.             $this->actionTraces[] = $actionTrace;
  960.             $actionTrace->setProspect($this);
  961.         }
  962.         return $this;
  963.     }
  964.     public function removeActionTrace(ActionTrace $actionTrace): self
  965.     {
  966.         if ($this->actionTraces->removeElement($actionTrace)) {
  967.             // set the owning side to null (unless already changed)
  968.             if ($actionTrace->getProspect() === $this) {
  969.                 $actionTrace->setProspect(null);
  970.             }
  971.         }
  972.         return $this;
  973.     }
  974.     public function getActionsCommerciales(): string
  975.     {
  976.         if ($this->actionTraces->isEmpty()) {
  977.             return '';
  978.         }
  979.         $actions = [];
  980.         foreach ($this->actionTraces as $actionTrace) {
  981.             $date $actionTrace->getCreatedAt() ? $actionTrace->getCreatedAt()->format('d/m/Y H:i') : '';
  982.             $user $actionTrace->getUser() ? $actionTrace->getUser()->getNomEtPrenom() : '';
  983.             $type $actionTrace->getType() ?: '';
  984.             $description $actionTrace->getDescription() ? ' - ' $actionTrace->getDescription() : '';
  985.             $actions[] = sprintf('[%s] %s par %s%s'$date$type$user$description);
  986.         }
  987.         return implode(PHP_EOL$actions);
  988.     }
  989.     public function getLastActionTrace(): string
  990.     {
  991.         if ($this->actionTraces->isEmpty()) {
  992.             return '';
  993.         }
  994.         $lastAction $this->actionTraces->last();
  995.         $date $lastAction->getCreatedAt() ? $lastAction->getCreatedAt()->format('d/m/Y H:i') : '';
  996.         $type $lastAction->getType() ?: '';
  997.         return sprintf('[%s] %s'$date$type);
  998.     }
  999.     /**
  1000.      * Retourne le libellé lisible du statut
  1001.      */
  1002.     public function getStatutLibelle(): ?string
  1003.     {
  1004.         $statuts = [
  1005.             'atraiter' => 'À traiter',
  1006.             'attentenouveaute' => 'À relancer',
  1007.             'encourstraitement' => 'En cours de traitement',
  1008.             'reservation' => 'Réservation',
  1009.             'adejatrouve' => 'À externaliser',
  1010.             'archive' => 'Archivé',
  1011.             null => 'Non classé'
  1012.         ];
  1013.         return $statuts[$this->statut] ?? 'Non classé';
  1014.     }
  1015.     /**
  1016.      * @return Collection<int, Typologie>
  1017.      */
  1018.     public function getTypologies(): Collection
  1019.     {
  1020.         return $this->typologies;
  1021.     }
  1022.     public function addTypologie(Typologie $typologie): self
  1023.     {
  1024.         if (!$this->typologies->contains($typologie)) {
  1025.             $this->typologies[] = $typologie;
  1026.         }
  1027.         return $this;
  1028.     }
  1029.     public function removeTypologie(Typologie $typologie): self
  1030.     {
  1031.         $this->typologies->removeElement($typologie);
  1032.         return $this;
  1033.     }
  1034.     /**
  1035.      * @return Collection<int, SecteurGeographique>
  1036.      */
  1037.     public function getSecteursGeographiques(): Collection
  1038.     {
  1039.         return $this->secteursGeographiques;
  1040.     }
  1041.     public function addSecteurGeographique(SecteurGeographique $secteurGeographique): self
  1042.     {
  1043.         if (!$this->secteursGeographiques->contains($secteurGeographique)) {
  1044.             $this->secteursGeographiques[] = $secteurGeographique;
  1045.         }
  1046.         return $this;
  1047.     }
  1048.     public function removeSecteurGeographique(SecteurGeographique $secteurGeographique): self
  1049.     {
  1050.         $this->secteursGeographiques->removeElement($secteurGeographique);
  1051.         return $this;
  1052.     }
  1053.     /**
  1054.      * @return Collection<int, Etage>
  1055.      */
  1056.     public function getEtages(): Collection
  1057.     {
  1058.         return $this->etages;
  1059.     }
  1060.     public function addEtage(Etage $etage): self
  1061.     {
  1062.         if (!$this->etages->contains($etage)) {
  1063.             $this->etages[] = $etage;
  1064.         }
  1065.         return $this;
  1066.     }
  1067.     public function removeEtage(Etage $etage): self
  1068.     {
  1069.         $this->etages->removeElement($etage);
  1070.         return $this;
  1071.     }
  1072.     public function getDateCliqueATraiter(): ?\DateTimeInterface
  1073.     {
  1074.         return $this->dateCliqueATraiter;
  1075.     }
  1076.     public function setDateCliqueATraiter(?\DateTimeInterface $dateCliqueATraiter): self
  1077.     {
  1078.         $this->dateCliqueATraiter $dateCliqueATraiter;
  1079.         return $this;
  1080.     }
  1081.     /**
  1082.      * @return Collection<int, VilleProgramme>
  1083.      */
  1084.     public function getVillesProgrammes(): Collection
  1085.     {
  1086.         return $this->villesProgrammes;
  1087.     }
  1088.     public function addVilleProgramme(VilleProgramme $villeProgramme): self
  1089.     {
  1090.         if (!$this->villesProgrammes->contains($villeProgramme)) {
  1091.             $this->villesProgrammes[] = $villeProgramme;
  1092.         }
  1093.         return $this;
  1094.     }
  1095.     public function removeVilleProgramme(VilleProgramme $villeProgramme): self
  1096.     {
  1097.         $this->villesProgrammes->removeElement($villeProgramme);
  1098.         return $this;
  1099.     }
  1100.     public function getTypologie(): ?Typologie
  1101.     {
  1102.         return $this->typologies->first() ?: null;
  1103.     }
  1104.     public function setTypologie(?Typologie $typologie): self
  1105.     {
  1106.         $this->typologies->clear();
  1107.         if ($typologie) {
  1108.             $this->addTypologie($typologie);
  1109.         }
  1110.         return $this;
  1111.     }
  1112.     public function getSecteurGeographique(): ?SecteurGeographique
  1113.     {
  1114.         return $this->secteursGeographiques->first() ?: null;
  1115.     }
  1116.     public function setSecteurGeographique(?SecteurGeographique $secteurGeographique): self
  1117.     {
  1118.         $this->secteursGeographiques->clear();
  1119.         if ($secteurGeographique) {
  1120.             $this->addSecteurGeographique($secteurGeographique);
  1121.         }
  1122.         return $this;
  1123.     }
  1124.     public function getEtage(): ?Etage
  1125.     {
  1126.         return $this->etages->first() ?: null;
  1127.     }
  1128.     public function setEtage(?Etage $etage): self
  1129.     {
  1130.         $this->etages->clear();
  1131.         if ($etage) {
  1132.             $this->addEtage($etage);
  1133.         }
  1134.         return $this;
  1135.     }
  1136.     public function getVilleProgramme(): ?VilleProgramme
  1137.     {
  1138.         return $this->villesProgrammes->first() ?: null;
  1139.     }
  1140.     public function setVilleProgramme(?VilleProgramme $villeProgramme): self
  1141.     {
  1142.         $this->villesProgrammes->clear();
  1143.         if ($villeProgramme) {
  1144.             $this->addVilleProgramme($villeProgramme);
  1145.         }
  1146.         return $this;
  1147.     }
  1148.     /**
  1149.      * Retourne les typologies sous forme de chaîne pour l'export
  1150.      */
  1151.     public function getTypologiesAsString(): string
  1152.     {
  1153.         if ($this->typologies->isEmpty()) {
  1154.             return '';
  1155.         }
  1156.         $names = [];
  1157.         foreach ($this->typologies as $typologie) {
  1158.             $names[] = $typologie->getNom();
  1159.         }
  1160.         return implode(', '$names);
  1161.     }
  1162.     /**
  1163.      * Retourne les secteurs géographiques sous forme de chaîne pour l'export
  1164.      */
  1165.     public function getSecteursGeographiquesAsString(): string
  1166.     {
  1167.         if ($this->secteursGeographiques->isEmpty()) {
  1168.             return '';
  1169.         }
  1170.         $names = [];
  1171.         foreach ($this->secteursGeographiques as $secteur) {
  1172.             $names[] = $secteur->getNom();
  1173.         }
  1174.         return implode(', '$names);
  1175.     }
  1176.     /**
  1177.      * Retourne les étages sous forme de chaîne pour l'export
  1178.      */
  1179.     public function getEtagesAsString(): string
  1180.     {
  1181.         if ($this->etages->isEmpty()) {
  1182.             return '';
  1183.         }
  1184.         $names = [];
  1185.         foreach ($this->etages as $etage) {
  1186.             $names[] = $etage->getNom();
  1187.         }
  1188.         return implode(', '$names);
  1189.     }
  1190.     /**
  1191.      * Retourne les villes/programmes sous forme de chaîne pour l'export
  1192.      */
  1193.     public function getVillesProgrammesAsString(): string
  1194.     {
  1195.         if ($this->villesProgrammes->isEmpty()) {
  1196.             return '';
  1197.         }
  1198.         $names = [];
  1199.         foreach ($this->villesProgrammes as $ville) {
  1200.             $names[] = $ville->getNom();
  1201.         }
  1202.         return implode(', '$names);
  1203.     }
  1204. }