src/Entity/IctusPharmacie.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Validator\Constraints as CustomAssert;
  6. use Doctrine\Common\Collections\Collection;
  7. use App\Repository\IctusPharmacieRepository;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  11. /**
  12.  * @ORM\Entity(repositoryClass=IctusPharmacieRepository::class)
  13.  * @UniqueEntity(fields = {"pagename"},message ="Page existe déjà existe")
  14.  */
  15. class IctusPharmacie
  16. {
  17.     /**
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue
  20.      * @ORM\Column(type="integer")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @ORM\Column(type="string", length=255, nullable=true)
  25.      */
  26.     private $uuid;
  27.     /**
  28.      * @ORM\Column(type="string", length=255)
  29.      */
  30.     private $designation;
  31.     /**
  32.      * @ORM\Column(type="string", length=255, nullable=true)
  33.      */
  34.     private $logo;
  35.     /**
  36.      * @ORM\Column(type="string", length=255, nullable=true)
  37.      */
  38.     private $numeroordre;
  39.     /**
  40.      * @ORM\Column(type="string", length=255, nullable=true)
  41.      */
  42.     private $nif;
  43.     /**
  44.      * @ORM\Column(type="string", length=255, nullable=true)
  45.      */
  46.     private $stat;
  47.     /**
  48.      * @ORM\Column(type="boolean", nullable=true)
  49.      */
  50.     private $isValid false;
  51.     /**
  52.      * @ORM\Column(type="float", nullable=true)
  53.      */
  54.     private $logitude;
  55.     /**
  56.      * @ORM\Column(type="float", nullable=true)
  57.      */
  58.     private $latitude;
  59.     /**
  60.      * @ORM\OneToMany(targetEntity=Stockpharmacie::class, mappedBy="ictuspharmacie")
  61.      */
  62.     private $stockpharmacies;
  63.     /**
  64.      * @ORM\OneToMany(targetEntity=User::class, mappedBy="ictusPharmacie")
  65.      */
  66.     private $users;
  67.     /**
  68.      * @ORM\Column(type="string", length=255, nullable=true)
  69.      */
  70.     private $adresse;
  71.     /**
  72.      * @ORM\ManyToOne(targetEntity=Quartier::class, inversedBy="ictusPharmacies")
  73.      */
  74.     private $quartier;
  75.     /**
  76.      * @ORM\OneToMany(targetEntity=LivraisonPharmacie::class, mappedBy="ictus_pharmacie")
  77.      */
  78.     private $livraisonPharmacies;
  79.     /**
  80.      * @ORM\OneToMany(targetEntity=IctusPaiementPharmacie::class, mappedBy="pharmacie")
  81.      */
  82.     private $ictusPaiementPharmacies;
  83.     /**
  84.      * @ORM\OneToMany(targetEntity=IctusHoraire::class, mappedBy="ictus_pharmacie")
  85.      */
  86.     private $ictusHoraires;
  87.     /**
  88.      * @ORM\OneToMany(targetEntity=IctusCommande::class, mappedBy="pharmacie")
  89.      */
  90.     private $ictusCommandes;
  91.     private $distanceParRapportPatient;
  92.     /**
  93.      * @ORM\Column(type="string", length=255, nullable=true)
  94.      */
  95.     private $photocouverture;
  96.     /**
  97.      * @ORM\Column(type="string", length=255, nullable=true)
  98.      */
  99.     private $pagename;
  100.     /**
  101.      * @ORM\OneToMany(targetEntity=IctoRemboursement::class, mappedBy="demandeur", orphanRemoval=true)
  102.      */
  103.     private $ictoRemboursements;
  104.     /**
  105.      * @ORM\OneToMany(targetEntity=IctoParampov::class, mappedBy="pharmacie", orphanRemoval=true)
  106.      */
  107.     private $ictoParampovs;
  108.     /**
  109.      * @ORM\OneToMany(targetEntity=IctoMouvement::class, mappedBy="pharmacie", orphanRemoval=true)
  110.      */
  111.     private $ictoMouvements;
  112.     /**
  113.      * @ORM\OneToMany(targetEntity=AchatIctocoin::class, mappedBy="pharmacie", orphanRemoval=true)
  114.      */
  115.     private $achatIctocoins;
  116.     /**
  117.      * @ORM\OneToMany(targetEntity=IctusPanierSpecial::class, mappedBy="pharmacie", orphanRemoval=true)
  118.      */
  119.     private $ictusPanierSpecials;
  120.     /**
  121.      * @ORM\Column(type="boolean", nullable=true)
  122.      */
  123.     private $isCommandeSpecial;
  124.     /**
  125.      * @ORM\OneToMany(targetEntity=CommandeSpecial::class, mappedBy="pharmacie")
  126.      */
  127.     private $commandeSpecials;
  128.     /**
  129.      * @ORM\Column(type="boolean", nullable=true)
  130.      */
  131.     private $isValideAutomatique;
  132.     /**
  133.      * @ORM\Column(type="float", nullable=true)
  134.      */
  135.     private $pourcentageCommandeSpecial;
  136.     /**
  137.      * @ORM\OneToMany(targetEntity=FacturePatient::class, mappedBy="pharmacie", orphanRemoval=true)
  138.      */
  139.     private $facturePatients;
  140.     /**
  141.      * @ORM\Column(type="string", length=255, nullable=true)
  142.      */
  143.     private $rcs;
  144.     /**
  145.      * @ORM\OneToMany(targetEntity=ProductBlackList::class, mappedBy="pharmacie", orphanRemoval=true)
  146.      */
  147.     private $productBlackLists;
  148.     /**
  149.      * @ORM\OneToMany(targetEntity=HistoriqueMaj::class, mappedBy="pharmacie", orphanRemoval=true)
  150.      */
  151.     private $historiqueMajs;
  152.     /**
  153.      * @ORM\ManyToMany(targetEntity=Tierpayant::class, mappedBy="pharmacie")
  154.      */
  155.     private $tierpayants;
  156.     /**
  157.      * @ORM\OneToMany(targetEntity=Parcours::class, mappedBy="pharmacie")
  158.      */
  159.     private $parcours;
  160.     /**
  161.      * @ORM\Column(type="string", length=255, nullable=true)
  162.      */
  163.     private $mailResponsable;
  164.     /**
  165.      * @ORM\OneToMany(targetEntity=FacturePharmacie::class, mappedBy="pharmacie", orphanRemoval=true)
  166.      */
  167.     private $facturePharmacies;
  168.     /**
  169.      * @ORM\OneToMany(targetEntity=Rate::class, mappedBy="pharmacie")
  170.      */
  171.     private $rates;
  172.     /**
  173.      * @ORM\OneToMany(targetEntity=IctusReclamation::class, mappedBy="pharmacie")
  174.      */
  175.     private $ictusReclamations;
  176.     /**
  177.      * @ORM\Column(type="string", length=255, nullable=true)
  178.      */
  179.     private $realDesignation;
  180.     /**
  181.      * @ORM\OneToMany(targetEntity=RemiseUserPharmacie::class, mappedBy="pharmacie")
  182.      */
  183.     private $remiseUserPharmacies;
  184.     /**
  185.      * @ORM\ManyToMany(targetEntity=Assurance::class, mappedBy="pharmacie")
  186.      */
  187.     private $assurances;
  188.     /**
  189.      * @ORM\OneToMany(targetEntity=CertCertificat::class, mappedBy="pharmacie", orphanRemoval=true)
  190.      */
  191.     private $certCertificats;
  192.     /**
  193.      * @ORM\Column(type="boolean", nullable=true)
  194.      */
  195.     private $isShowPrice;
  196.     /**
  197.      * @ORM\Column(type="boolean", nullable=true)
  198.      */
  199.     private $isActiveReservation;
  200.     /**
  201.      * @ORM\Column(type="boolean", nullable=true)
  202.      */
  203.     private $is24And7;
  204.     /**
  205.      * @ORM\Column(type="string", length=255, nullable=true)
  206.      */
  207.     private $codeParrainageOther;
  208.     /**
  209.      * @ORM\Column(type="string", length=255, nullable=true)
  210.      */
  211.     private $codeParrainageMine;
  212.     public function __construct()
  213.     {
  214.         $this->stockpharmacies = new ArrayCollection();
  215.         $this->users           = new ArrayCollection();
  216.         $this->uuid            uniqid((new \DateTime())->format('YmdHis'));
  217.         $this->livraisonPharmacies = new ArrayCollection();
  218.         $this->ictusPaiementPharmacies = new ArrayCollection();
  219.         $this->ictusHoraires = new ArrayCollection();
  220.         $this->ictusCommandes = new ArrayCollection();
  221.         $this->ictoRemboursements = new ArrayCollection();
  222.         $this->ictoParampovs = new ArrayCollection();
  223.         $this->ictoMouvements = new ArrayCollection();
  224.         $this->achatIctocoins = new ArrayCollection();
  225.         $this->ictusPanierSpecials = new ArrayCollection();
  226.         $this->commandeSpecials = new ArrayCollection();
  227.         $this->facturePatients = new ArrayCollection();
  228.         $this->productBlackLists = new ArrayCollection();
  229.         $this->historiqueMajs = new ArrayCollection();
  230.         $this->tierpayants = new ArrayCollection();
  231.         $this->parcours = new ArrayCollection();
  232.         $this->facturePharmacies = new ArrayCollection();
  233.         $this->rates = new ArrayCollection();
  234.         $this->ictusReclamations = new ArrayCollection();
  235.         $this->remiseUserPharmacies = new ArrayCollection();
  236.         $this->assurances = new ArrayCollection();
  237.         $this->certCertificats = new ArrayCollection();
  238.         $this->isShowPrice true;
  239.         $this->isActiveReservation true;
  240.     }
  241.     public function getId(): ?int
  242.     {
  243.         return $this->id;
  244.     }
  245.     public function setId($id)
  246.     {
  247.         $this->id $id;
  248.         return $this;
  249.     }
  250.     public function getUuid(): ?string
  251.     {
  252.         return $this->uuid;
  253.     }
  254.     public function setUuid(?string $uuid): self
  255.     {
  256.         $this->uuid $uuid;
  257.         return $this;
  258.     }
  259.     public function getDesignation(): ?string
  260.     {
  261.         return $this->designation;
  262.     }
  263.     public function setDesignation(string $designation): self
  264.     {
  265.         $this->designation $designation;
  266.         return $this;
  267.     }
  268.     public function getLogo(): ?string
  269.     {
  270.         return $this->logo;
  271.     }
  272.     public function setLogo(?string $logo): self
  273.     {
  274.         $this->logo $logo;
  275.         return $this;
  276.     }
  277.     public function getNumeroordre(): ?string
  278.     {
  279.         return $this->numeroordre;
  280.     }
  281.     public function setNumeroordre(?string $numeroordre): self
  282.     {
  283.         $this->numeroordre $numeroordre;
  284.         return $this;
  285.     }
  286.     public function getNif(): ?string
  287.     {
  288.         return $this->nif;
  289.     }
  290.     public function setNif(?string $nif): self
  291.     {
  292.         $this->nif $nif;
  293.         return $this;
  294.     }
  295.     public function getStat(): ?string
  296.     {
  297.         return $this->stat;
  298.     }
  299.     public function setStat(?string $stat): self
  300.     {
  301.         $this->stat $stat;
  302.         return $this;
  303.     }
  304.     public function isIsValid(): ?bool
  305.     {
  306.         return $this->isValid;
  307.     }
  308.     public function setIsValid(?bool $isValid): self
  309.     {
  310.         $this->isValid $isValid;
  311.         return $this;
  312.     }
  313.     public function getLogitude(): ?float
  314.     {
  315.         return $this->logitude;
  316.     }
  317.     public function setLogitude(?float $logitude): self
  318.     {
  319.         $this->logitude $logitude;
  320.         return $this;
  321.     }
  322.     public function getLatitude(): ?float
  323.     {
  324.         return $this->latitude;
  325.     }
  326.     public function setLatitude(?float $latitude): self
  327.     {
  328.         $this->latitude $latitude;
  329.         return $this;
  330.     }
  331.     /**
  332.      * @return Collection<int, Stockpharmacie>
  333.      */
  334.     public function getStockpharmacies(): Collection
  335.     {
  336.         return $this->stockpharmacies;
  337.     }
  338.     public function addStockpharmacy(Stockpharmacie $stockpharmacy): self
  339.     {
  340.         if (!$this->stockpharmacies->contains($stockpharmacy)) {
  341.             $this->stockpharmacies[] = $stockpharmacy;
  342.             $stockpharmacy->setIctuspharmacie($this);
  343.         }
  344.         return $this;
  345.     }
  346.     public function removeStockpharmacy(Stockpharmacie $stockpharmacy): self
  347.     {
  348.         if ($this->stockpharmacies->removeElement($stockpharmacy)) {
  349.             // set the owning side to null (unless already changed)
  350.             if ($stockpharmacy->getIctuspharmacie() === $this) {
  351.                 $stockpharmacy->setIctuspharmacie(null);
  352.             }
  353.         }
  354.         return $this;
  355.     }
  356.     /**
  357.      * @return Collection<int, User>
  358.      */
  359.     public function getUsers(): Collection
  360.     {
  361.         return $this->users;
  362.     }
  363.     public function addUser(User $user): self
  364.     {
  365.         if (!$this->users->contains($user)) {
  366.             $this->users[] = $user;
  367.             $user->setIctusPharmacie($this);
  368.         }
  369.         return $this;
  370.     }
  371.     public function removeUser(User $user): self
  372.     {
  373.         if ($this->users->removeElement($user)) {
  374.             // set the owning side to null (unless already changed)
  375.             if ($user->getIctusPharmacie() === $this) {
  376.                 $user->setIctusPharmacie(null);
  377.             }
  378.         }
  379.         return $this;
  380.     }
  381.     public function getAdresse(): ?string
  382.     {
  383.         return $this->adresse;
  384.     }
  385.     public function setAdresse(?string $adresse): self
  386.     {
  387.         $this->adresse $adresse;
  388.         return $this;
  389.     }
  390.     public function getQuartier(): ?Quartier
  391.     {
  392.         return $this->quartier;
  393.     }
  394.     public function setQuartier(?Quartier $quartier): self
  395.     {
  396.         $this->quartier $quartier;
  397.         return $this;
  398.     }
  399.     /**
  400.      * @return Collection<int, LivraisonPharmacie>
  401.      */
  402.     public function getLivraisonPharmacies(): Collection
  403.     {
  404.         return $this->livraisonPharmacies;
  405.     }
  406.     public function addLivraisonPharmacy(LivraisonPharmacie $livraisonPharmacy): self
  407.     {
  408.         if (!$this->livraisonPharmacies->contains($livraisonPharmacy)) {
  409.             $this->livraisonPharmacies[] = $livraisonPharmacy;
  410.             $livraisonPharmacy->setIctusPharmacie($this);
  411.         }
  412.         return $this;
  413.     }
  414.     public function removeLivraisonPharmacy(LivraisonPharmacie $livraisonPharmacy): self
  415.     {
  416.         if ($this->livraisonPharmacies->removeElement($livraisonPharmacy)) {
  417.             // set the owning side to null (unless already changed)
  418.             if ($livraisonPharmacy->getIctusPharmacie() === $this) {
  419.                 $livraisonPharmacy->setIctusPharmacie(null);
  420.             }
  421.         }
  422.         return $this;
  423.     }
  424.     /**
  425.      * @return Collection<int, IctusPaiementPharmacie>
  426.      */
  427.     public function getIctusPaiementPharmacies(): Collection
  428.     {
  429.         return $this->ictusPaiementPharmacies;
  430.     }
  431.     public function addIctusPaiementPharmacy(IctusPaiementPharmacie $ictusPaiementPharmacy): self
  432.     {
  433.         if (!$this->ictusPaiementPharmacies->contains($ictusPaiementPharmacy)) {
  434.             $this->ictusPaiementPharmacies[] = $ictusPaiementPharmacy;
  435.             $ictusPaiementPharmacy->setPharmacie($this);
  436.         }
  437.         return $this;
  438.     }
  439.     public function removeIctusPaiementPharmacy(IctusPaiementPharmacie $ictusPaiementPharmacy): self
  440.     {
  441.         if ($this->ictusPaiementPharmacies->removeElement($ictusPaiementPharmacy)) {
  442.             // set the owning side to null (unless already changed)
  443.             if ($ictusPaiementPharmacy->getPharmacie() === $this) {
  444.                 $ictusPaiementPharmacy->setPharmacie(null);
  445.             }
  446.         }
  447.         return $this;
  448.     }
  449.     /**
  450.      * @return Collection<int, IctusHoraire>
  451.      */
  452.     public function getIctusHoraires(): Collection
  453.     {
  454.         return $this->ictusHoraires;
  455.     }
  456.     public function addIctusHoraire(IctusHoraire $ictusHoraire): self
  457.     {
  458.         if (!$this->ictusHoraires->contains($ictusHoraire)) {
  459.             $this->ictusHoraires[] = $ictusHoraire;
  460.             $ictusHoraire->setIctusPharmacie($this);
  461.         }
  462.         return $this;
  463.     }
  464.     public function removeIctusHoraire(IctusHoraire $ictusHoraire): self
  465.     {
  466.         if ($this->ictusHoraires->removeElement($ictusHoraire)) {
  467.             // set the owning side to null (unless already changed)
  468.             if ($ictusHoraire->getIctusPharmacie() === $this) {
  469.                 $ictusHoraire->setIctusPharmacie(null);
  470.             }
  471.         }
  472.         return $this;
  473.     }
  474.     /**
  475.      * @return Collection<int, IctusCommande>
  476.      */
  477.     public function getIctusCommandes(): Collection
  478.     {
  479.         return $this->ictusCommandes;
  480.     }
  481.     public function addIctusCommande(IctusCommande $ictusCommande): self
  482.     {
  483.         if (!$this->ictusCommandes->contains($ictusCommande)) {
  484.             $this->ictusCommandes[] = $ictusCommande;
  485.             $ictusCommande->setPharmacie($this);
  486.         }
  487.         return $this;
  488.     }
  489.     public function removeIctusCommande(IctusCommande $ictusCommande): self
  490.     {
  491.         if ($this->ictusCommandes->removeElement($ictusCommande)) {
  492.             // set the owning side to null (unless already changed)
  493.             if ($ictusCommande->getPharmacie() === $this) {
  494.                 $ictusCommande->setPharmacie(null);
  495.             }
  496.         }
  497.         return $this;
  498.     }
  499.     /**
  500.      * Get the value of distanceParRapportPatient
  501.      */
  502.     public function getDistanceParRapportPatient()
  503.     {
  504.         return $this->distanceParRapportPatient;
  505.     }
  506.     /**
  507.      * Set the value of distanceParRapportPatient
  508.      *
  509.      * @return  self
  510.      */
  511.     public function setDistanceParRapportPatient($distanceParRapportPatient)
  512.     {
  513.         $this->distanceParRapportPatient $distanceParRapportPatient;
  514.         return $this;
  515.     }
  516.     public function getPhotocouverture(): ?string
  517.     {
  518.         return $this->photocouverture;
  519.     }
  520.     public function setPhotocouverture(?string $photocouverture): self
  521.     {
  522.         $this->photocouverture $photocouverture;
  523.         return $this;
  524.     }
  525.     public function getPagename(): ?string
  526.     {
  527.         return $this->pagename;
  528.     }
  529.     public function setPagename(?string $pagename): self
  530.     {
  531.         $this->pagename $pagename;
  532.         return $this;
  533.     }
  534.     /**
  535.      * @return Collection<int, IctoRemboursement>
  536.      */
  537.     public function getIctoRemboursements(): Collection
  538.     {
  539.         return $this->ictoRemboursements;
  540.     }
  541.     public function addIctoRemboursement(IctoRemboursement $ictoRemboursement): self
  542.     {
  543.         if (!$this->ictoRemboursements->contains($ictoRemboursement)) {
  544.             $this->ictoRemboursements[] = $ictoRemboursement;
  545.             $ictoRemboursement->setDemandeur($this);
  546.         }
  547.         return $this;
  548.     }
  549.     public function removeIctoRemboursement(IctoRemboursement $ictoRemboursement): self
  550.     {
  551.         if ($this->ictoRemboursements->removeElement($ictoRemboursement)) {
  552.             // set the owning side to null (unless already changed)
  553.             if ($ictoRemboursement->getDemandeur() === $this) {
  554.                 $ictoRemboursement->setDemandeur(null);
  555.             }
  556.         }
  557.         return $this;
  558.     }
  559.     /**
  560.      * @return Collection<int, IctoParampov>
  561.      */
  562.     public function getIctoParampovs(): Collection
  563.     {
  564.         return $this->ictoParampovs;
  565.     }
  566.     public function addIctoParampov(IctoParampov $ictoParampov): self
  567.     {
  568.         if (!$this->ictoParampovs->contains($ictoParampov)) {
  569.             $this->ictoParampovs[] = $ictoParampov;
  570.             $ictoParampov->setPharmacie($this);
  571.         }
  572.         return $this;
  573.     }
  574.     public function removeIctoParampov(IctoParampov $ictoParampov): self
  575.     {
  576.         if ($this->ictoParampovs->removeElement($ictoParampov)) {
  577.             // set the owning side to null (unless already changed)
  578.             if ($ictoParampov->getPharmacie() === $this) {
  579.                 $ictoParampov->setPharmacie(null);
  580.             }
  581.         }
  582.         return $this;
  583.     }
  584.     /**
  585.      * @return Collection<int, IctoMouvement>
  586.      */
  587.     public function getIctoMouvements(): Collection
  588.     {
  589.         return $this->ictoMouvements;
  590.     }
  591.     public function addIctoMouvement(IctoMouvement $ictoMouvement): self
  592.     {
  593.         if (!$this->ictoMouvements->contains($ictoMouvement)) {
  594.             $this->ictoMouvements[] = $ictoMouvement;
  595.             $ictoMouvement->setPharmacie($this);
  596.         }
  597.         return $this;
  598.     }
  599.     public function removeIctoMouvement(IctoMouvement $ictoMouvement): self
  600.     {
  601.         if ($this->ictoMouvements->removeElement($ictoMouvement)) {
  602.             // set the owning side to null (unless already changed)
  603.             if ($ictoMouvement->getPharmacie() === $this) {
  604.                 $ictoMouvement->setPharmacie(null);
  605.             }
  606.         }
  607.         return $this;
  608.     }
  609.     /**
  610.      * @return Collection<int, AchatIctocoin>
  611.      */
  612.     public function getAchatIctocoins(): Collection
  613.     {
  614.         return $this->achatIctocoins;
  615.     }
  616.     public function addAchatIctocoin(AchatIctocoin $achatIctocoin): self
  617.     {
  618.         if (!$this->achatIctocoins->contains($achatIctocoin)) {
  619.             $this->achatIctocoins[] = $achatIctocoin;
  620.             $achatIctocoin->setPharmacie($this);
  621.         }
  622.         return $this;
  623.     }
  624.     public function removeAchatIctocoin(AchatIctocoin $achatIctocoin): self
  625.     {
  626.         if ($this->achatIctocoins->removeElement($achatIctocoin)) {
  627.             // set the owning side to null (unless already changed)
  628.             if ($achatIctocoin->getPharmacie() === $this) {
  629.                 $achatIctocoin->setPharmacie(null);
  630.             }
  631.         }
  632.         return $this;
  633.     }
  634.     /**
  635.      * @return Collection<int, IctusPanierSpecial>
  636.      */
  637.     public function getIctusPanierSpecials(): Collection
  638.     {
  639.         return $this->ictusPanierSpecials;
  640.     }
  641.     public function addIctusPanierSpecial(IctusPanierSpecial $ictusPanierSpecial): self
  642.     {
  643.         if (!$this->ictusPanierSpecials->contains($ictusPanierSpecial)) {
  644.             $this->ictusPanierSpecials[] = $ictusPanierSpecial;
  645.             $ictusPanierSpecial->setPharmacie($this);
  646.         }
  647.         return $this;
  648.     }
  649.     public function removeIctusPanierSpecial(IctusPanierSpecial $ictusPanierSpecial): self
  650.     {
  651.         if ($this->ictusPanierSpecials->removeElement($ictusPanierSpecial)) {
  652.             // set the owning side to null (unless already changed)
  653.             if ($ictusPanierSpecial->getPharmacie() === $this) {
  654.                 $ictusPanierSpecial->setPharmacie(null);
  655.             }
  656.         }
  657.         return $this;
  658.     }
  659.     public function isIsCommandeSpecial(): ?bool
  660.     {
  661.         return $this->isCommandeSpecial;
  662.     }
  663.     public function setIsCommandeSpecial(?bool $isCommandeSpecial): self
  664.     {
  665.         $this->isCommandeSpecial $isCommandeSpecial;
  666.         return $this;
  667.     }
  668.     /**
  669.      * @return Collection<int, CommandeSpecial>
  670.      */
  671.     public function getCommandeSpecials(): Collection
  672.     {
  673.         return $this->commandeSpecials;
  674.     }
  675.     public function addCommandeSpecial(CommandeSpecial $commandeSpecial): self
  676.     {
  677.         if (!$this->commandeSpecials->contains($commandeSpecial)) {
  678.             $this->commandeSpecials[] = $commandeSpecial;
  679.             $commandeSpecial->setPharmacie($this);
  680.         }
  681.         return $this;
  682.     }
  683.     public function removeCommandeSpecial(CommandeSpecial $commandeSpecial): self
  684.     {
  685.         if ($this->commandeSpecials->removeElement($commandeSpecial)) {
  686.             // set the owning side to null (unless already changed)
  687.             if ($commandeSpecial->getPharmacie() === $this) {
  688.                 $commandeSpecial->setPharmacie(null);
  689.             }
  690.         }
  691.         return $this;
  692.     }
  693.     public function isIsValideAutomatique(): ?bool
  694.     {
  695.         return $this->isValideAutomatique;
  696.     }
  697.     public function setIsValideAutomatique(?bool $isValideAutomatique): self
  698.     {
  699.         $this->isValideAutomatique $isValideAutomatique;
  700.         return $this;
  701.     }
  702.     public function getPourcentageCommandeSpecial(): ?float
  703.     {
  704.         return $this->pourcentageCommandeSpecial;
  705.     }
  706.     public function setPourcentageCommandeSpecial(?float $pourcentageCommandeSpecial): self
  707.     {
  708.         $this->pourcentageCommandeSpecial $pourcentageCommandeSpecial;
  709.         return $this;
  710.     }
  711.     /**
  712.      * @return Collection<int, FacturePatient>
  713.      */
  714.     public function getFacturePatients(): Collection
  715.     {
  716.         return $this->facturePatients;
  717.     }
  718.     public function addFacturePatient(FacturePatient $facturePatient): self
  719.     {
  720.         if (!$this->facturePatients->contains($facturePatient)) {
  721.             $this->facturePatients[] = $facturePatient;
  722.             $facturePatient->setPharmacie($this);
  723.         }
  724.         return $this;
  725.     }
  726.     public function removeFacturePatient(FacturePatient $facturePatient): self
  727.     {
  728.         if ($this->facturePatients->removeElement($facturePatient)) {
  729.             // set the owning side to null (unless already changed)
  730.             if ($facturePatient->getPharmacie() === $this) {
  731.                 $facturePatient->setPharmacie(null);
  732.             }
  733.         }
  734.         return $this;
  735.     }
  736.     public function getRcs(): ?string
  737.     {
  738.         return $this->rcs;
  739.     }
  740.     public function setRcs(?string $rcs): self
  741.     {
  742.         $this->rcs $rcs;
  743.         return $this;
  744.     }
  745.     /**
  746.      * @return Collection<int, ProductBlackList>
  747.      */
  748.     public function getProductBlackLists(): Collection
  749.     {
  750.         return $this->productBlackLists;
  751.     }
  752.     public function addProductBlackList(ProductBlackList $productBlackList): self
  753.     {
  754.         if (!$this->productBlackLists->contains($productBlackList)) {
  755.             $this->productBlackLists[] = $productBlackList;
  756.             $productBlackList->setPharmacie($this);
  757.         }
  758.         return $this;
  759.     }
  760.     public function removeProductBlackList(ProductBlackList $productBlackList): self
  761.     {
  762.         if ($this->productBlackLists->removeElement($productBlackList)) {
  763.             // set the owning side to null (unless already changed)
  764.             if ($productBlackList->getPharmacie() === $this) {
  765.                 $productBlackList->setPharmacie(null);
  766.             }
  767.         }
  768.         return $this;
  769.     }
  770.     /**
  771.      * @return Collection<int, HistoriqueMaj>
  772.      */
  773.     public function getHistoriqueMajs(): Collection
  774.     {
  775.         return $this->historiqueMajs;
  776.     }
  777.     public function addHistoriqueMaj(HistoriqueMaj $historiqueMaj): self
  778.     {
  779.         if (!$this->historiqueMajs->contains($historiqueMaj)) {
  780.             $this->historiqueMajs[] = $historiqueMaj;
  781.             $historiqueMaj->setPharmacie($this);
  782.         }
  783.         return $this;
  784.     }
  785.     public function removeHistoriqueMaj(HistoriqueMaj $historiqueMaj): self
  786.     {
  787.         if ($this->historiqueMajs->removeElement($historiqueMaj)) {
  788.             // set the owning side to null (unless already changed)
  789.             if ($historiqueMaj->getPharmacie() === $this) {
  790.                 $historiqueMaj->setPharmacie(null);
  791.             }
  792.         }
  793.         return $this;
  794.     }
  795.     /**
  796.      * @return Collection<int, Tierpayant>
  797.      */
  798.     public function getTierpayants(): Collection
  799.     {
  800.         return $this->tierpayants;
  801.     }
  802.     public function addTierpayant(Tierpayant $tierpayant): self
  803.     {
  804.         if (!$this->tierpayants->contains($tierpayant)) {
  805.             $this->tierpayants[] = $tierpayant;
  806.             $tierpayant->addPharmacie($this);
  807.         }
  808.         return $this;
  809.     }
  810.     public function removeTierpayant(Tierpayant $tierpayant): self
  811.     {
  812.         if ($this->tierpayants->removeElement($tierpayant)) {
  813.             $tierpayant->removePharmacie($this);
  814.         }
  815.         return $this;
  816.     }
  817.     public function getMailResponsable(): ?string
  818.     {
  819.         return $this->mailResponsable;
  820.     }
  821.     public function setMailResponsable(?string $mailResponsable): self
  822.     {
  823.         $this->mailResponsable $mailResponsable;
  824.         return $this;
  825.     }
  826.     /**
  827.      * @return Collection<int, FacturePharmacie>
  828.      */
  829.     public function getFacturePharmacies(): Collection
  830.     {
  831.         return $this->facturePharmacies;
  832.     }
  833.     public function addFacturePharmacy(FacturePharmacie $facturePharmacy): self
  834.     {
  835.         if (!$this->facturePharmacies->contains($facturePharmacy)) {
  836.             $this->facturePharmacies[] = $facturePharmacy;
  837.             $facturePharmacy->setPharmacie($this);
  838.         }
  839.         return $this;
  840.     }
  841.     public function removeFacturePharmacy(FacturePharmacie $facturePharmacy): self
  842.     {
  843.         if ($this->facturePharmacies->removeElement($facturePharmacy)) {
  844.             // set the owning side to null (unless already changed)
  845.             if ($facturePharmacy->getPharmacie() === $this) {
  846.                 $facturePharmacy->setPharmacie(null);
  847.             }
  848.         }
  849.         return $this;
  850.     }
  851.     /**
  852.      * @return Collection<int, Rate>
  853.      */
  854.     public function getRates(): Collection
  855.     {
  856.         return $this->rates;
  857.     }
  858.     public function addRate(Rate $rate): self
  859.     {
  860.         if (!$this->rates->contains($rate)) {
  861.             $this->rates[] = $rate;
  862.             $rate->setPharmacie($this);
  863.         }
  864.         return $this;
  865.     }
  866.     public function removeRate(Rate $rate): self
  867.     {
  868.         if ($this->rates->removeElement($rate)) {
  869.             // set the owning side to null (unless already changed)
  870.             if ($rate->getPharmacie() === $this) {
  871.                 $rate->setPharmacie(null);
  872.             }
  873.         }
  874.         return $this;
  875.     }
  876.     /**
  877.      * @return Collection<int, IctusReclamation>
  878.      */
  879.     public function getIctusReclamations(): Collection
  880.     {
  881.         return $this->ictusReclamations;
  882.     }
  883.     public function addIctusReclamation(IctusReclamation $ictusReclamation): self
  884.     {
  885.         if (!$this->ictusReclamations->contains($ictusReclamation)) {
  886.             $this->ictusReclamations[] = $ictusReclamation;
  887.             $ictusReclamation->setPharmacie($this);
  888.         }
  889.         return $this;
  890.     }
  891.     public function removeIctusReclamation(IctusReclamation $ictusReclamation): self
  892.     {
  893.         if ($this->ictusReclamations->removeElement($ictusReclamation)) {
  894.             // set the owning side to null (unless already changed)
  895.             if ($ictusReclamation->getPharmacie() === $this) {
  896.                 $ictusReclamation->setPharmacie(null);
  897.             }
  898.         }
  899.         return $this;
  900.     }
  901.     public function getRealDesignation(): ?string
  902.     {
  903.         return $this->realDesignation;
  904.     }
  905.     public function setRealDesignation(?string $realDesignation): self
  906.     {
  907.         $this->realDesignation $realDesignation;
  908.         return $this;
  909.     }
  910.     /**
  911.      * @return Collection<int, RemiseUserPharmacie>
  912.      */
  913.     public function getRemiseUserPharmacies(): Collection
  914.     {
  915.         return $this->remiseUserPharmacies;
  916.     }
  917.     public function addRemiseUserPharmacy(RemiseUserPharmacie $remiseUserPharmacy): self
  918.     {
  919.         if (!$this->remiseUserPharmacies->contains($remiseUserPharmacy)) {
  920.             $this->remiseUserPharmacies[] = $remiseUserPharmacy;
  921.             $remiseUserPharmacy->setPharmacie($this);
  922.         }
  923.         return $this;
  924.     }
  925.     public function removeRemiseUserPharmacy(RemiseUserPharmacie $remiseUserPharmacy): self
  926.     {
  927.         if ($this->remiseUserPharmacies->removeElement($remiseUserPharmacy)) {
  928.             // set the owning side to null (unless already changed)
  929.             if ($remiseUserPharmacy->getPharmacie() === $this) {
  930.                 $remiseUserPharmacy->setPharmacie(null);
  931.             }
  932.         }
  933.         return $this;
  934.     }
  935.     /**
  936.      * @param float $userLatitude
  937.      * @param float $userLongitude
  938.      */
  939.     public function getDistance(float $userLatitudefloat $userLongitude): ?float
  940.     {
  941.         $rayonDeLaTerre 6371071.03;
  942.         if ($this->latitude === null || $this->logitude === null) {
  943.             return null;
  944.         }
  945.         $lat1 deg2rad($userLatitude);
  946.         $lon1 deg2rad($userLongitude);
  947.         $lat2 deg2rad($this->latitude);
  948.         $lon2 deg2rad($this->logitude);
  949.         $deltaLat $lat2 $lat1;
  950.         $deltaLon $lon2 $lon1;
  951.         $a sin($deltaLat 2) ** cos($lat1) * cos($lat2) * sin($deltaLon 2) ** 2;
  952.         $c asin(sqrt($a));
  953.         return $rayonDeLaTerre $c;
  954.     }
  955.     public function checkHorraire(): ?array
  956.     {
  957.         $dateSemaine = ['Monday' => 1'Tuesday' => 2'Wednesday' => 3'Thursday' => 4'Friday' => 5'Saturday' => 6'Sunday' => 7];
  958.         $result['classHoraire'] = "";
  959.         $result['textHoraire'] = "";
  960.         $result['descHoraire'] = "";
  961.         $dateTimeNow = new DateTime();
  962.         $dateTimeNow->modify('+2 hours');
  963.         if (count($this->getIctusHoraires()) > 0) {
  964.             $jour $dateSemaine[date("l"strtotime($dateTimeNow->format('Y-m-d')))];
  965.             $time $dateTimeNow->format('H:i:s');
  966.             $horaireNow $this->verifHoraireByTime($jour$time);
  967.             if ($horaireNow) {
  968.                 $heureDebut = new \DateTime($time);
  969.                 $heureFin = new \DateTime($horaireNow->getFin());
  970.                 $diff $heureDebut->diff($heureFin);
  971.                 $result['classHoraire'] = "bg-success text-white";
  972.                 $result['textHoraire'] = 'Ouverte';
  973.                 $result['descHoraire'] = 'sera fermée dans ' $diff->format('%Hh %Imn');
  974.             } else {
  975.                 $result['classHoraire'] = "bg-danger text-white";
  976.                 $result['textHoraire'] = 'Fermée';
  977.                 $horaireOtherOwnDay $this->getOtherHoraireOwnDay($jour$time);
  978.                 if ($horaireOtherOwnDay) {
  979.                     $heureDebut = new \DateTime($time);
  980.                     $heureFin = new \DateTime($horaireOtherOwnDay->getDebut());
  981.                     $diff $heureDebut->diff($heureFin);
  982.                     $result['descHoraire'] = 'sera ouverte dans ' $diff->format('%Hh %Imn');
  983.                 } else {
  984.                     $horaireOtherDay $this->getOtherHoraireNextDay($jour);
  985.                     if ($horaireOtherDay) {
  986.                         $diffDay = (int)$horaireOtherDay[0]->getJour() - $jour;
  987.                         $dateDebut = new \DateTime($dateTimeNow->format('Y-m-d H:i:s'));
  988.                         $dateFin = new \DateTime(date('Y-m-d ' $horaireOtherDay[0]->getDebut(), strtotime(' + ' $diffDay ' days')));
  989.                         $diff $dateDebut->diff($dateFin);
  990.                         $delais "";
  991.                         if ((int)$diff->format('%d') == 0) {
  992.                             $delais $diff->format('%Hh %Imn');
  993.                         } else {
  994.                             $delais $diff->format('%dj');
  995.                         }
  996.                         $result['descHoraire'] = 'sera ouverte dans ' $delais;
  997.                     } else {
  998.                         $horaireDebusSemaine $this->getFirstHoraire($jour);
  999.                         if ($horaireDebusSemaine) {
  1000.                             $diffDay = (int)$horaireDebusSemaine->getJour() + ($jour);
  1001.                             $dateDebut = new \DateTime($dateTimeNow->format('Y-m-d H:i:s'));
  1002.                             $dateFin = new \DateTime(date('Y-m-d ' $horaireDebusSemaine->getDebut(), strtotime(' + ' $diffDay ' days')));
  1003.                             $diff $dateDebut->diff($dateFin);
  1004.                             $delais "";
  1005.                             if ((int)$diff->format('%d') == 0) {
  1006.                                 $delais $diff->format('%Hh %Imn');
  1007.                             } else {
  1008.                                 $delais $diff->format('%dj');
  1009.                             }
  1010.                             $result['descHoraire'] = 'sera ouverte dans ' $delais;
  1011.                         }
  1012.                     }
  1013.                 }
  1014.             }
  1015.         } else {
  1016.             $result null;
  1017.         }
  1018.         return $result;
  1019.     }
  1020.     private function verifHoraireByTime($jour$time): ?IctusHoraire
  1021.     {
  1022.         foreach ($this->getIctusHoraires() as $horaire) {
  1023.             if (
  1024.                 $horaire->getJour() === $jour &&
  1025.                 $horaire->getDebut() <= $time &&
  1026.                 $horaire->getFin() > $time
  1027.             ) {
  1028.                 return $horaire;
  1029.             }
  1030.         }
  1031.         return null;
  1032.     }
  1033.     private function getOtherHoraireOwnDay($jour$time): ?IctusHoraire
  1034.     {
  1035.         foreach ($this->getIctusHoraires() as $horaire) {
  1036.             if (
  1037.                 $horaire->getJour() === $jour &&
  1038.                 $horaire->getFin() > $time
  1039.             ) {
  1040.                 return $horaire;
  1041.             }
  1042.         }
  1043.         return null;
  1044.     }
  1045.     private function getOtherHoraireNextDay($jour): ?IctusHoraire
  1046.     {
  1047.         $resultats = [];
  1048.         foreach ($this->getIctusHoraires() as $horaire) {
  1049.             if ($horaire->getJour() > $jour) {
  1050.                 $resultats[] = $horaire;
  1051.             }
  1052.         }
  1053.         usort($resultats, function ($a$b) {
  1054.             return $a->getDebut() <=> $b->getDebut();
  1055.         });
  1056.         return $resultats[0] ?? null;
  1057.     }
  1058.     private function getFirstHoraire(): ?IctusHoraire
  1059.     {
  1060.         $horaires $this->getIctusHoraires()->toArray();
  1061.         if (empty($horaires)) {
  1062.             return null;
  1063.         }
  1064.         usort($horaires, function ($a$b) {
  1065.             $cmpJour $a->getJour() <=> $b->getJour();
  1066.             return $cmpJour !== $cmpJour : ($a->getDebut() <=> $b->getDebut());
  1067.         });
  1068.         return $horaires[0] ?? null;
  1069.     }
  1070.     /**
  1071.      * @return Collection<int, Assurance>
  1072.      */
  1073.     public function getAssurances(): Collection
  1074.     {
  1075.         return $this->assurances;
  1076.     }
  1077.     public function addAssurance(Assurance $assurance): self
  1078.     {
  1079.         if (!$this->assurances->contains($assurance)) {
  1080.             $this->assurances[] = $assurance;
  1081.             $assurance->addPharmacie($this);
  1082.         }
  1083.         return $this;
  1084.     }
  1085.     public function removeAssurance(Assurance $assurance): self
  1086.     {
  1087.         if ($this->assurances->removeElement($assurance)) {
  1088.             $assurance->removePharmacie($this);
  1089.         }
  1090.         return $this;
  1091.     }
  1092.     /**
  1093.      * @return Collection<int, CertCertificat>
  1094.      */
  1095.     public function getCertCertificats(): Collection
  1096.     {
  1097.         return $this->certCertificats;
  1098.     }
  1099.     public function addCertCertificat(CertCertificat $certCertificat): self
  1100.     {
  1101.         if (!$this->certCertificats->contains($certCertificat)) {
  1102.             $this->certCertificats[] = $certCertificat;
  1103.             $certCertificat->setPharmacie($this);
  1104.         }
  1105.         return $this;
  1106.     }
  1107.     public function removeCertCertificat(CertCertificat $certCertificat): self
  1108.     {
  1109.         if ($this->certCertificats->removeElement($certCertificat)) {
  1110.             // set the owning side to null (unless already changed)
  1111.             if ($certCertificat->getPharmacie() === $this) {
  1112.                 $certCertificat->setPharmacie(null);
  1113.             }
  1114.         }
  1115.         return $this;
  1116.     }
  1117.     public function isIsShowPrice(): ?bool
  1118.     {
  1119.         return $this->isShowPrice;
  1120.     }
  1121.     public function setIsShowPrice(?bool $isShowPrice): self
  1122.     {
  1123.         $this->isShowPrice $isShowPrice;
  1124.         return $this;
  1125.     }
  1126.     public function isIsActiveReservation(): ?bool
  1127.     {
  1128.         return $this->isActiveReservation;
  1129.     }
  1130.     public function setIsActiveReservation(?bool $isActiveReservation): self
  1131.     {
  1132.         $this->isActiveReservation $isActiveReservation;
  1133.         return $this;
  1134.     }
  1135.     public function isIs24And7(): ?bool
  1136.     {
  1137.         return $this->is24And7;
  1138.     }
  1139.     public function setIs24And7(?bool $is24And7): self
  1140.     {
  1141.         $this->is24And7 $is24And7;
  1142.         return $this;
  1143.     }
  1144.     public function getCodeParrainageOther(): ?string
  1145.     {
  1146.         return $this->codeParrainageOther;
  1147.     }
  1148.     public function setCodeParrainageOther(?string $codeParrainageOther): self
  1149.     {
  1150.         $this->codeParrainageOther $codeParrainageOther;
  1151.         return $this;
  1152.     }
  1153.     public function getCodeParrainageMine(): ?string
  1154.     {
  1155.         return $this->codeParrainageMine;
  1156.     }
  1157.     public function setCodeParrainageMine(?string $codeParrainageMine): self
  1158.     {
  1159.         $this->codeParrainageMine $codeParrainageMine;
  1160.         return $this;
  1161.     }
  1162.     public function getFullAdresse(): ?string
  1163.     {
  1164.         return $this->getAdresse() . ", " $this->getQuartier()->getName() . ", " $this->getQuartier()->getVille()->getName();
  1165.     }
  1166. }