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