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