src/Entity/Prospect.php line 31

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Utils\Formatter;
  4. use App\Validator as McaAssert;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\Common\Collections\Criteria;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. use phpDocumentor\Reflection\Types\Integer;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. use ApiPlatform\Core\Annotation\ApiResource;
  13. use Symfony\Component\Serializer\Annotation\Groups;
  14. /**
  15.  * @ORM\Entity(repositoryClass="App\Repository\ProspectRepository")
  16.  * @ORM\EntityListeners({"App\Listener\ProspectListener"})
  17.  * @ApiResource(
  18.  *     collectionOperations={
  19.             "post"={
  20.  *              "validation_groups"={"Default", "API"}
  21.  *          },
  22.  *
  23.  *     },
  24.  *     itemOperations={"get"={"security"="is_granted('ROLE_API')"}},
  25.  *     normalizationContext={"groups"={"prospect:read"}},
  26.  *     denormalizationContext={"groups"={"prospect:write"}}
  27.  * )
  28.  */
  29. class Prospect implements MediaoptionDeliverable
  30. {
  31.     const TYPE_APPOINTMENT 'appointment';
  32.     const TYPE_CHECKUP 'checkup';
  33.     const ACQUISITION_MODE_API 'api';
  34.     /**
  35.      * @ORM\Id()
  36.      * @ORM\GeneratedValue()
  37.      * @ORM\Column(type="integer")
  38.      */
  39.     private $id;
  40.     /**
  41.      * @ORM\Column(type="datetime")
  42.      * @Gedmo\Timestampable(on="create")
  43.      */
  44.     private $created;
  45.     /**
  46.      * @ORM\Column(type="smallint", nullable=true)
  47.      * @Assert\NotBlank(groups={"API"})
  48.      * @Groups({"prospect:write"})
  49.      */
  50.     private $gender;
  51.     /**
  52.      * @ORM\Column(type="string", length=255)
  53.      * @Groups({"prospect:read", "prospect:write"})
  54.      * @Assert\NotBlank
  55.      * @Assert\Length(
  56.      *      min = 2,
  57.      *      max = 50,
  58.      * )
  59.      * @Assert\Regex(
  60.      *      pattern="/^[A-Za-zÀ-úœ'\-\s]*$/",
  61.      *      message="Le prénom n'est pas valide"
  62.      * )
  63.      */
  64.     private $firstname;
  65.     /**
  66.      * @ORM\Column(type="string", length=255)
  67.      * @Groups({"prospect:read", "prospect:write"})
  68.      * @Assert\NotBlank
  69.      * @Assert\Regex(
  70.      *      pattern="/^[A-Za-zÀ-úœ'\-\s]*$/",
  71.      *      message="Le nom n'est pas valide"
  72.      * )
  73.      * @Assert\Length(
  74.      *      min = 2,
  75.      *      max = 50,
  76.      * )
  77.      */
  78.     private $lastname;
  79.     /**
  80.      * @ORM\Column(type="string", length=255, nullable=true)
  81.      * @Groups({"prospect:read", "prospect:write"})
  82.      * @Assert\NotBlank()
  83.      * @Assert\Length(
  84.      *      min = 2,
  85.      *      max = 200,
  86.      * )
  87.      */
  88.     private $address;
  89.     /**
  90.      * @ORM\Column(type="string", length=5)
  91.      * @Assert\NotBlank()
  92.      * @Assert\Regex(
  93.      *      pattern="/^(([0-8][0-9])|(9[0-5])|(2[ab]))[0-9]{3}$/",
  94.      *      message="Le code postal n'est pas valide"
  95.      * )
  96.      * @Groups({"prospect:read", "prospect:write"})
  97.      */
  98.     private $postalcode;
  99.     /**
  100.      * @ORM\Column(type="string", length=255, nullable=true)
  101.      * @Assert\Length(
  102.      *      min = 2,
  103.      *      max = 50,
  104.      * )
  105.      * @Assert\NotBlank(groups={"API"})
  106.      * @Groups({"prospect:read", "prospect:write"})
  107.      */
  108.     private $city;
  109.     /**
  110.      * @ORM\Column(type="string", length=255, nullable=true)
  111.      * @Assert\NotBlank
  112.      * @Assert\Regex ("/^\w([\w\-\_\+\.\d]+?)+@[\w-]+(\.[A-Za-z]{2,4}){1,2}$/")
  113.      * @Assert\Email(
  114.      *     message = "L'email '{{ value }}' n'est pas valide",
  115.      *     mode = "strict"
  116.      * )
  117.      * @Groups({"prospect:read", "prospect:write"})
  118.      */
  119.     private $email;
  120.     /**
  121.      * @ORM\Column(type="string", length=255, nullable=true)
  122.      * @Assert\NotBlank
  123.      * @McaAssert\ValidPhoneNumber
  124.      * @Groups({"prospect:read", "prospect:write"})
  125.      */
  126.     private $phoneNumber;
  127.     /**
  128.      * @ORM\Column(type="string", length=4, nullable=true)
  129.      * @Assert\NotBlank()
  130.      * @Assert\Regex(pattern="/^(19|20)\d{2}$/", message="L'année de naissance n'est pas valide.")
  131.      * @Groups({"prospect:read", "prospect:write"})
  132.      */
  133.     private $yearOfBirth;
  134.     /**
  135.      * @ORM\Column(type="boolean")
  136.      * @Groups({"prospect:read", "prospect:write"})
  137.      */
  138.     private $isPrivacy=0;
  139.     /**
  140.      * @ORM\Column(type="boolean", nullable=true)
  141.      * @Groups({"prospect:read", "prospect:write"})
  142.      */
  143.     private $isOptin;
  144.     /**
  145.      * @ORM\Column(type="boolean", nullable=true)
  146.      * @Groups({"prospect:read", "prospect:write"})
  147.      */
  148.     private $isPartnerOffer;
  149.     /**
  150.      * @ORM\Column(type="string", length=255)
  151.      * @Groups({"prospect:read", "prospect:write"})
  152.      */
  153.     private $request;
  154.     /**
  155.      * @ORM\ManyToOne(targetEntity="App\Entity\PhoneValidation", inversedBy="prospect", cascade={"persist", "remove"})
  156.      * @ORM\JoinColumn(nullable=true)
  157.      */
  158.     private $phoneValidation;
  159.     /**
  160.      * @ORM\OneToMany(targetEntity="App\Entity\ProspectOnStore", mappedBy="prospect", cascade={"persist", "remove"})
  161.      */
  162.     private $prospectsOnStore;
  163.     /**
  164.      * @ORM\OneToMany(targetEntity="App\Entity\MediaoptinDelivery", mappedBy="prospect", cascade={"persist", "remove"})
  165.      */
  166.     private $mediaoptinDeliveries;
  167.     /**
  168.      * Mode d'acquisition du lead (emailing, facebook, ...)
  169.      *
  170.      * @ORM\Column(type="string", length=255, nullable=true)
  171.      * @Groups({"prospect:write"})
  172.      */
  173.     private $acquisitionMode;
  174.     /**
  175.      * Base emailing de provenance du lead
  176.      *
  177.      * @ORM\Column(type="string", length=255, nullable=true)
  178.      * @Assert\NotBlank(groups={"API"})
  179.      * @Groups({"prospect:write"})
  180.      */
  181.     private $acquisitionBase;
  182.     /**
  183.      * Url de provenance du lead (dernière URL avant persist)
  184.      *
  185.      * @ORM\Column(type="string", length=255, nullable=true)
  186.      * @Groups({"prospect:write"})
  187.      */
  188.     private $acquisitionUrl;
  189.     /**
  190.      * Meta keyword URL
  191.      * @ORM\Column(type="string", length=255, nullable=true)
  192.      * @Groups({"prospect:write"})
  193.      */
  194.     private $acquisitionKeyword;
  195.     /**
  196.      * @ORM\Column(type="float", nullable=true)
  197.      */
  198.     private $latitude;
  199.     /**
  200.      * @ORM\Column(type="float", nullable=true)
  201.      */
  202.     private $longitude;
  203.     /**
  204.      * @var string
  205.      * @ORM\Column(type="string", length=255, nullable=true)
  206.      */
  207.     private $locationType;
  208.     /**
  209.      * @var string
  210.      * @ORM\Column(type="string", length=255, nullable=true)
  211.      */
  212.     private $countryCode;
  213.     /**
  214.      * @var boolean
  215.      * @ORM\Column(type="boolean")
  216.      */
  217.     private $isDropped false;
  218.     /**
  219.      * @ORM\OneToMany(targetEntity="App\Entity\ProspectDuplicate", mappedBy="prospect", cascade={"remove"})
  220.      */
  221.     private $prospectDuplicates;
  222.     /**
  223.      * @ORM\Column(type="integer", nullable=true)
  224.      */
  225.     private $duplicateState;
  226.     /**
  227.      * @ORM\Column(type="boolean", nullable=true)
  228.      * @Groups({"prospect:write"})
  229.      * @var boolean
  230.      */
  231.     private $isOrlPrescription;
  232.     /**
  233.      * @ORM\Column(type="boolean", nullable=true)
  234.      * @Groups({"prospect:write"})
  235.      * @var boolean
  236.      */
  237.     private $isEquipped;
  238.     /**
  239.      * @ORM\Column(type="boolean", nullable=true)
  240.      * @Groups({"prospect:write"})
  241.      * @var boolean
  242.      */
  243.     private $isThirdPerson;
  244.     /**
  245.      * @ORM\OneToOne(targetEntity=ProspectQualification::class, cascade={"persist", "remove"}, inversedBy="prospect")
  246.      */
  247.     private $qualification;
  248.     /**
  249.      * Add checkmail boolean on prospect: yes->email validated , no->email invalid, null->no validation has been done
  250.      * @ORM\Column(type="boolean", nullable=true)
  251.      */
  252.     private $checkmail;
  253.     /**
  254.      * @ORM\Column(type="boolean")
  255.      */
  256.     private bool $isUsingDoctolib=false;
  257.     /**
  258.      * @ORM\Column(type="boolean", nullable=true)
  259.      * @Groups({"prospect:write"})
  260.      */
  261.     private ?bool $isQualifiedExternally=false;
  262.     public function __construct()
  263.     {
  264.         $this->prospectsOnStore = new ArrayCollection();
  265.         $this->mediaoptinDeliveries = new ArrayCollection();
  266.         $this->prospectDuplicates = new ArrayCollection();
  267.     }
  268.     /**
  269.      * Représente l'entité par défault
  270.      * @return string
  271.      */
  272.     public function __toString(){
  273.         return 'Prospect ['.$this->getId().']';
  274.     }
  275.     /**
  276.      * Obtenir l'adresse complète
  277.      * @return string
  278.      */
  279.     public function getFullAddress() {
  280.         return $this->getAddress() . ' ' $this->getPostalcode() . ' ' $this->getCity();
  281.     }
  282.     /**
  283.      * Représente l'entité dans le BO
  284.      * @return string
  285.      */
  286.     public function getLabel(){
  287.         return '#'.$this->getId();
  288.     }
  289.     public function getId(): ?int
  290.     {
  291.         return $this->id;
  292.     }
  293.     public function getGender(): ?int
  294.     {
  295.         return $this->gender;
  296.     }
  297.     public function setGender(?int $gender): self
  298.     {
  299.         $this->gender $gender;
  300.         return $this;
  301.     }
  302.     public function getFirstname(): ?string
  303.     {
  304.         return $this->firstname;
  305.     }
  306.     public function setFirstname(?string $firstname): self
  307.     {
  308.         $this->firstname $firstname;
  309.         return $this;
  310.     }
  311.     public function getLastname(): ?string
  312.     {
  313.         return $this->lastname;
  314.     }
  315.     public function setLastname(?string $lastname): self
  316.     {
  317.         $this->lastname $lastname;
  318.         return $this;
  319.     }
  320.     public function getFullname(): ?string
  321.     {
  322.         return ucfirst($this->firstname).' '.ucfirst($this->lastname);
  323.     }
  324.     public function getEmail(): ?string
  325.     {
  326.         return $this->email;
  327.     }
  328.     public function setEmail(?string $email): self
  329.     {
  330.         $this->email $email;
  331.         return $this;
  332.     }
  333.     public function getPhoneNumber(): ?string
  334.     {
  335.         return $this->phoneNumber;
  336.     }
  337.     public function setPhoneNumber(?string $phoneNumber): self
  338.     {
  339.         $phoneNumber Formatter::phoneNumberFrenchFormat($phoneNumber);
  340.         $this->phoneNumber $phoneNumber;
  341.         return $this;
  342.     }
  343.     public function getPhoneNumberFormatted() {
  344.         return wordwrap($this->getPhoneNumber() , ' ' true );
  345.     }
  346.     public function getYearOfBirth(): ?string
  347.     {
  348.         return $this->yearOfBirth;
  349.     }
  350.     public function setYearOfBirth(?string $yearOfBirth): self
  351.     {
  352.         //prevent insertion of non numeri value (ex: 1994-05-17). if not numeric field remains blank
  353.         $yearOfBirth substr($yearOfBirth,0,4);
  354.         if(is_numeric($yearOfBirth)){
  355.             $this->yearOfBirth $yearOfBirth;
  356.         }
  357.         return $this;
  358.     }
  359.     public function getDateFromYearOfBirth(): ?\DateTimeInterface {
  360.         return new \DateTime($this->getYearOfBirth() . '-01-01');
  361.     }
  362.     public function getAge(): int {
  363.         $now = new \DateTime();
  364.         return $this->getDateFromYearOfBirth()->diff($now)->y;
  365.     }
  366.     public function getRequest(): ?string
  367.     {
  368.         return $this->request;
  369.     }
  370.     public function setRequest(string $request): self
  371.     {
  372.         $this->request $request;
  373.         return $this;
  374.     }
  375.     public function getIsPrivacy(): ?bool
  376.     {
  377.         return $this->isPrivacy;
  378.     }
  379.     public function setIsPrivacy(bool $isPrivacy): self
  380.     {
  381.         $this->isPrivacy $isPrivacy;
  382.         return $this;
  383.     }
  384.     public function getIsOptin(): ?bool
  385.     {
  386.         return $this->isOptin;
  387.     }
  388.     public function setIsOptin(bool $isOptin): self
  389.     {
  390.         $this->isOptin $isOptin;
  391.         return $this;
  392.     }
  393.     public function getIsPartnerOffer(): ?bool
  394.     {
  395.         return $this->isPartnerOffer;
  396.     }
  397.     public function setIsPartnerOffer(bool $isPartnerOffer): self
  398.     {
  399.         $this->isPartnerOffer $isPartnerOffer;
  400.         return $this;
  401.     }
  402.     public function getAddress(): ?string
  403.     {
  404.         return $this->address;
  405.     }
  406.     public function setAddress(?string $address): self
  407.     {
  408.         $this->address $address;
  409.         return $this;
  410.     }
  411.     public function getPostalcode(): ?string
  412.     {
  413.         return $this->postalcode;
  414.     }
  415.     public function setPostalcode(?string $postalcode): self
  416.     {
  417.         if(strlen($postalcode) === 4) {
  418.             $this->postalcode str_pad($postalcode5'0'STR_PAD_LEFT);
  419.         } else {
  420.             $this->postalcode $postalcode;
  421.         }
  422.         return $this;
  423.     }
  424.     public function getCity(): ?string
  425.     {
  426.         return $this->city;
  427.     }
  428.     public function setCity(?string $city): self
  429.     {
  430.         $this->city $city;
  431.         return $this;
  432.     }
  433.     public function getPhoneValidation(): ?PhoneValidation
  434.     {
  435.         return $this->phoneValidation;
  436.     }
  437.     public function setPhoneValidation(?PhoneValidation $phoneValidation): self
  438.     {
  439.         $this->phoneValidation $phoneValidation;
  440.         return $this;
  441.     }
  442.     public function getExportProspectsOnStore()
  443.     {
  444.         $exportStores = [];
  445.         foreach ($this->getProspectsOnStore() as $key => $val) {
  446.             $str $val->getStore()->getName() . ' (' $val->getStore()->getZipCode(). ')';
  447.             if($val->getIsDemandForThird()){
  448.                 $str .= " <span class=\"badge badge-warning\">demande pour un tiers</span>";
  449.             }
  450.             $exportStores[] = $str;
  451.         }
  452.         return join(' , '$exportStores);
  453.     }
  454.     /**
  455.      * @return Collection|ProspectOnStore[]
  456.      */
  457.     public function getProspectsOnStore(): Collection
  458.     {
  459.         return $this->prospectsOnStore;
  460.     }
  461.     /**
  462.      * @param Store $store
  463.      * @return ?ProspectOnStore
  464.      */
  465.     public function getProspectOnStore(Store $store): ?ProspectOnStore
  466.     {
  467.         $criteria Criteria::create() ->andWhere(Criteria::expr()->eq('store'$store))->setMaxResults(1);
  468.         $pos $this->prospectsOnStore->matching($criteria);
  469.         if($pos->isEmpty()){
  470.             return null;
  471.         }else{
  472.             return $pos->first();
  473.         }
  474.     }
  475.     /**
  476.      * @return int
  477.      */
  478.     public function getNbOfProspectsOnStore(): int
  479.     {
  480.         return $this->prospectsOnStore->count();
  481.     }
  482.     public function addProspectsOnStore(ProspectOnStore $prospectsOnStore): self
  483.     {
  484.         if (!$this->prospectsOnStore->contains($prospectsOnStore)) {
  485.             $this->prospectsOnStore[] = $prospectsOnStore;
  486.             $prospectsOnStore->setProspect($this);
  487.         }
  488.         return $this;
  489.     }
  490.     public function removeProspectsOnStore(ProspectOnStore $prospectsOnStore): self
  491.     {
  492.         if ($this->prospectsOnStore->contains($prospectsOnStore)) {
  493.             $this->prospectsOnStore->removeElement($prospectsOnStore);
  494.             // set the owning side to null (unless already changed)
  495.             if ($prospectsOnStore->getProspect() === $this) {
  496.                 $prospectsOnStore->setProspect(null);
  497.             }
  498.         }
  499.         return $this;
  500.     }
  501.     public function getCreated(): ?\DateTimeInterface
  502.     {
  503.         return $this->created;
  504.     }
  505.     public function setCreated(\DateTimeInterface $created): self
  506.     {
  507.         $this->created $created;
  508.         return $this;
  509.     }
  510.     /**
  511.      * @return Collection|MediaoptinDelivery[]
  512.      */
  513.     public function getMediaoptinDeliveriesOwnOrByStore(): Collection
  514.     {
  515.         if(empty($this->prospectsOnStore)){
  516.             return $this->mediaoptinDeliveries;
  517.         }else{
  518.             $deliveries = [];
  519.             foreach ($this->prospectsOnStore as $pos){
  520.                 $deliveries array_merge($deliveries$pos->getMediaoptinDeliveries()->toArray() );
  521.             }
  522.             return new ArrayCollection($deliveries);
  523.         }
  524.     }
  525.     public function getExportMediaoptinDeliveriesOwnOrByStore()
  526.     {
  527.         //dump($this->getMediaoptinDeliveriesOwnOrByStore());
  528.         $exportDeliveries = [];
  529.         foreach ($this->getMediaoptinDeliveriesOwnOrByStore() as $key => $val) {
  530.             if($val->getDeliveryDate()){
  531.                 $str $val->getDeliveryDate()->format('d/m/Y');
  532.             }else{
  533.                 $str $val->getResponse();
  534.             }
  535.             $exportDeliveries[] = $str;
  536.         }
  537.         return join(', '$exportDeliveries);
  538.     }
  539.     /**
  540.      * Display the label of deliveries (for export)
  541.      * @return string|null
  542.      */
  543.     public function getDeliveryStatusLabel(): ?string {
  544.         $deliveries $this->getMediaoptinDeliveriesOwnOrByStore();
  545.         if(count($deliveries)==0){
  546.             return 'multi';
  547.         }
  548.         foreach ($deliveries as $delivery){
  549.             if($delivery->isSuccessful()){
  550.                 return 'livré';
  551.             }else{
  552.                 return 'erreur';
  553.             }
  554.         }
  555.         return null;
  556.     }
  557.     /**
  558.      * @return Collection|MediaoptinDelivery[]
  559.      */
  560.     public function getMediaoptinDeliveries(): Collection
  561.     {
  562.         return $this->mediaoptinDeliveries;
  563.     }
  564.     public function addMediaoptinDelivery(MediaoptinDelivery $mediaoptinDelivery): self
  565.     {
  566.         if (!$this->mediaoptinDeliveries->contains($mediaoptinDelivery)) {
  567.             $this->mediaoptinDeliveries[] = $mediaoptinDelivery;
  568.             $mediaoptinDelivery->setProspect($this);
  569.         }
  570.         return $this;
  571.     }
  572.     public function removeMediaoptinDelivery(MediaoptinDelivery $mediaoptinDelivery): self
  573.     {
  574.         if ($this->mediaoptinDeliveries->contains($mediaoptinDelivery)) {
  575.             $this->mediaoptinDeliveries->removeElement($mediaoptinDelivery);
  576.             // set the owning side to null (unless already changed)
  577.             if ($mediaoptinDelivery->getProspect() === $this) {
  578.                 $mediaoptinDelivery->setProspect(null);
  579.             }
  580.         }
  581.         return $this;
  582.     }
  583.     public function getAcquisitionMode(): ?string
  584.     {
  585.         return $this->acquisitionMode;
  586.     }
  587.     public function setAcquisitionMode(?string $acquisitionMode): self
  588.     {
  589.         $this->acquisitionMode $acquisitionMode;
  590.         return $this;
  591.     }
  592.     public function getAcquisitionBase(): ?string
  593.     {
  594.         return $this->acquisitionBase;
  595.     }
  596.     public function setAcquisitionBase(?string $acquisitionBase): self
  597.     {
  598.         $this->acquisitionBase $acquisitionBase;
  599.         return $this;
  600.     }
  601.     public function getAcquisitionUrl(): ?string
  602.     {
  603.         return $this->acquisitionUrl;
  604.     }
  605.     public function setAcquisitionUrl(?string $acquisitionUrl): self
  606.     {
  607.         $this->acquisitionUrl $acquisitionUrl;
  608.         return $this;
  609.     }
  610.     public function getLatitude(): ?float
  611.     {
  612.         return $this->latitude;
  613.     }
  614.     public function setLatitude(?float $latitude): self
  615.     {
  616.         $this->latitude $latitude;
  617.         return $this;
  618.     }
  619.     public function getLongitude(): ?float
  620.     {
  621.         return $this->longitude;
  622.     }
  623.     public function setLongitude(?float $longitude): self
  624.     {
  625.         $this->longitude $longitude;
  626.         return $this;
  627.     }
  628.     public function getLocationType(): ?string
  629.     {
  630.         return $this->locationType;
  631.     }
  632.     public function setLocationType(?string $locationType): self
  633.     {
  634.         $this->locationType $locationType;
  635.         return $this;
  636.     }
  637.     public function getCountryCode(): ?string
  638.     {
  639.         return $this->countryCode;
  640.     }
  641.     public function setCountryCode(?string $countryCode): self
  642.     {
  643.         $this->countryCode $countryCode;
  644.         return $this;
  645.     }
  646.     public function getIsDropped(): ?bool
  647.     {
  648.         return $this->isDropped;
  649.     }
  650.     public function setIsDropped(bool $isDropped): self
  651.     {
  652.         $this->isDropped $isDropped;
  653.         return $this;
  654.     }
  655.     public function getLeadNumber(){
  656.         return md5($this->getEmail());
  657.     }
  658.     /**
  659.      * @return Collection|ProspectDuplicate[]
  660.      */
  661.     public function getProspectDuplicates(): Collection
  662.     {
  663.         return $this->prospectDuplicates;
  664.     }
  665.     /**
  666.      * @return integer
  667.      */
  668.     public function getNbOfProspectDuplicates(): int
  669.     {
  670.         return $this->prospectDuplicates->count();
  671.     }
  672.     public function addProspectDuplicate(ProspectDuplicate $prospectDuplicate): self
  673.     {
  674.         if (!$this->prospectDuplicates->contains($prospectDuplicate)) {
  675.             $this->prospectDuplicates[] = $prospectDuplicate;
  676.             $prospectDuplicate->setProspect($this);
  677.         }
  678.         return $this;
  679.     }
  680.     public function removeProspectDuplicate(ProspectDuplicate $prospectDuplicate): self
  681.     {
  682.         if ($this->prospectDuplicates->contains($prospectDuplicate)) {
  683.             $this->prospectDuplicates->removeElement($prospectDuplicate);
  684.             // set the owning side to null (unless already changed)
  685.             if ($prospectDuplicate->getProspect() === $this) {
  686.                 $prospectDuplicate->setProspect(null);
  687.             }
  688.         }
  689.         return $this;
  690.     }
  691.     public function getDuplicateState(): ?int
  692.     {
  693.         return $this->duplicateState;
  694.     }
  695.     public function setDuplicateState($state): self
  696.     {
  697.         $this->duplicateState $state;
  698.         return $this;
  699.     }
  700.     public function getIsOrlPrescription(): ?bool
  701.     {
  702.         return $this->isOrlPrescription;
  703.     }
  704.     public function setIsOrlPrescription(?bool $isOrlPrescription): self
  705.     {
  706.         $this->isOrlPrescription $isOrlPrescription;
  707.         return $this;
  708.     }
  709.     public function getIsEquipped(): ?bool
  710.     {
  711.         return $this->isEquipped;
  712.     }
  713.     public function setIsEquipped(?bool $isEquipped): self
  714.     {
  715.         $this->isEquipped $isEquipped;
  716.         return $this;
  717.     }
  718.     public function getIsThirdPerson(): ?bool
  719.     {
  720.         return $this->isThirdPerson;
  721.     }
  722.     public function setIsThirdPerson(?bool $isThirdPerson): self
  723.     {
  724.         $this->isThirdPerson $isThirdPerson;
  725.         return $this;
  726.     }
  727.     /**
  728.      * Export for Sonata Admin
  729.      * @return string
  730.      */
  731.     public function getExportIsOrlPrescription() {
  732.         if(isset($this->isOrlPrescription)) {
  733.             return $this->getIsOrlPrescription() ? "Oui" "Non";
  734.         } else {
  735.             return "Non renseigné";
  736.         }
  737.     }
  738.     /**
  739.      * Export for Sonata Admin
  740.      * @return string
  741.      */
  742.     public function getExportIsEquipped() {
  743.         if(isset($this->isEquipped)) {
  744.             return $this->getIsEquipped() ? "Oui" "Non";
  745.         } else {
  746.             return "Non renseigné";
  747.         }
  748.     }
  749.     /**
  750.      * Export for Sonata Admin
  751.      * @return string
  752.      */
  753.     public function getExportIsThirdPerson() {
  754.         if(isset($this->isThirdPerson)) {
  755.             return $this->getIsThirdPerson() ? "Oui" "Non";
  756.         } else {
  757.             return "Non renseigné";
  758.         }
  759.     }
  760.     public function getQualification(): ?ProspectQualification
  761.     {
  762.         return $this->qualification;
  763.     }
  764.     public function setQualification(?ProspectQualification $qualification): self
  765.     {
  766.         $this->qualification $qualification;
  767.         return $this;
  768.     }
  769.     public function getCheckmail(): ?bool
  770.     {
  771.         return $this->checkmail;
  772.     }
  773.     public function setCheckmail(?bool $checkmail): self
  774.     {
  775.         $this->checkmail $checkmail;
  776.         return $this;
  777.     }
  778.     public function getAcquisitionKeyword(): ?string
  779.     {
  780.         return $this->acquisitionKeyword;
  781.     }
  782.     public function setAcquisitionKeyword(?string $acquisitionKeyword): self
  783.     {
  784.         $this->acquisitionKeyword $acquisitionKeyword;
  785.         return $this;
  786.     }
  787.     /**
  788.      * @return bool
  789.      */
  790.     public function isUsingDoctolib(): bool
  791.     {
  792.         return $this->isUsingDoctolib;
  793.     }
  794.     /**
  795.      * @param bool $isUsingDoctolib
  796.      */
  797.     public function setIsUsingDoctolib(bool $isUsingDoctolib): void
  798.     {
  799.         $this->isUsingDoctolib $isUsingDoctolib;
  800.     }
  801.     public function getIsQualifiedExternally(): ?bool
  802.     {
  803.         return $this->isQualifiedExternally;
  804.     }
  805.     public function setIsQualifiedExternally($isQualifiedExternally): void
  806.     {
  807.         $this->isQualifiedExternally boolval($isQualifiedExternally);
  808.     }
  809. }