src/Entity/Adherent/Magasin.php line 35

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Adherent;
  3. use App\Entity\Adherent\Annuaire\MagasinContact;
  4. use App\Entity\Adherent\Annuaire\MagasinContactQualifier;
  5. use App\Entity\Alertes\MagasinMarquesAlertes;
  6. use App\Entity\Crm\CrmResponseIa;
  7. use App\Entity\Crm\CrmSettings;
  8. use App\Entity\EvenementsGroupeAll\AvisEvenement;
  9. use App\Entity\ImagePartner;
  10. use App\Entity\Kpi\KpiObjectifs;
  11. use App\Entity\Kpi\KpiParameters;
  12. use App\Entity\Retrocession\Annonce;
  13. use App\Entity\VenteRechercheMagasins\VenteRechercheMagasinsAlertes;
  14. use App\Entity\Webfactory\Navigation;
  15. use App\Entity\Webfactory\Page\PageAbstract;
  16. use App\Entity\Webfactory\SeoVilles;
  17. use App\Entity\Webfactory\Widget\Createur\Faq;
  18. use App\Entity\Webfactory\Widget\WidgetAbstract;
  19. use App\Entity\Webfactory\Widget\WidgetContent;
  20. use App\Repository\Adherent\MagasinRepository;
  21. use DateTimeImmutable;
  22. use Doctrine\Common\Collections\ArrayCollection;
  23. use Doctrine\Common\Collections\Collection;
  24. use Doctrine\ORM\Mapping as ORM;
  25. use Stringable;
  26. use Symfony\Component\Serializer\Annotation\Groups;
  27. #[ORM\Table(name'magasin')]
  28. #[ORM\Index(columns: ['k_adherent'], name'k_adherent')]
  29. #[ORM\Index(columns: ['k_mag'], name'k_mag')]
  30. #[ORM\Entity(repositoryClassMagasinRepository::class)]
  31. #[ORM\HasLifecycleCallbacks]
  32. class Magasin implements Stringable
  33. {
  34.     #[ORM\Id]
  35.     #[ORM\GeneratedValue('NONE')]
  36.     #[ORM\Column(type'string'length255)]
  37.     #[Groups(groups: ['contact_history'])]
  38.     private string $k_adherent;
  39.     /**
  40.      * Unique = false car un adhérent peut faire une reprise de magasin
  41.      */
  42.     #[ORM\Column(type'string'length255uniquefalse)]
  43.     private string $k_mag;
  44.     #[ORM\Column(type'string'length255nullabletrue)]
  45.     private ?string $siret;
  46.     #[ORM\Column(type'string'length255nullabletrue)]
  47.     private ?string $siren;
  48.     #[ORM\Column(type'string'length255)]
  49.     private ?string $lib;
  50.     #[ORM\Column(type'string'length255)]
  51.     private ?string $k_pays;
  52.     #[ORM\Column(type'string'length255)]
  53.     private ?string $k_langue;
  54.     #[ORM\Column(type'string'length255nullabletrue)]
  55.     private ?string $lat;
  56.     #[ORM\Column(type'string'length255nullabletrue)]
  57.     private ?string $lon;
  58.     #[ORM\Column(type'string'length255nullabletrue)]
  59.     private ?string $k_user_suivi;
  60.     #[ORM\Column(type'string'length255nullabletrue)]
  61.     private ?string $k_logiciel;
  62.     #[ORM\Column(type'datetime_immutable')]
  63.     private DateTimeImmutable $createdAt;
  64.     #[ORM\Column(type'boolean')]
  65.     private ?bool $updated;
  66.     #[ORM\Column(type'boolean'nullabletrue)]
  67.     private ?bool $deleted;
  68.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  69.     private ?DateTimeImmutable $deletedAt;
  70.     #[ORM\OneToMany(mappedBy'magasin'targetEntityMagasinCoordonnees::class)]
  71.     private $magasinCoordonnees;
  72.     #[ORM\OneToMany(mappedBy'magasin'targetEntityMagasinHoraires::class)]
  73.     private $magasinHoraires;
  74.     #[ORM\OneToMany(mappedBy'magasin'targetEntityMagasinHorairesExceptionnelles::class)]
  75.     private $magasinHorairesExceptionnelles;
  76.     #[ORM\Column(type'string'length255nullabletrue)]
  77.     private ?string $ADH_MM;
  78.     #[ORM\Column(type'string'length255nullabletrue)]
  79.     private ?string $K_NIVEAUADH;
  80.     #[ORM\Column(type'string'length255nullabletrue)]
  81.     private ?string $K_TYPE_CLIENT;
  82.     #[ORM\Column(type'boolean'nullabletrue)]
  83.     private ?bool $L_BLACKLIST;
  84.     #[ORM\OneToMany(mappedBy'k_adherent'targetEntityMagasinConviction::class)]
  85.     private $magasinConvictions;
  86.     #[ORM\Column(type'string'length255nullabletrue)]
  87.     private ?string $user_rs;
  88.     #[ORM\Column(type'string'length255nullabletrue)]
  89.     private ?string $user_cpv;
  90.     #[ORM\Column(type'string'length255nullabletrue)]
  91.     private ?string $user_adv;
  92.     #[ORM\Column(type'string'length255nullabletrue)]
  93.     private ?string $user_achat;
  94.     #[ORM\Column(type'string'length255nullabletrue)]
  95.     private ?string $user_paiement;
  96.     #[ORM\Column(type'string'length255nullabletrue)]
  97.     private ?string $user_op;
  98.     #[ORM\Column(type'string'length255nullabletrue)]
  99.     private ?string $user_cpv_conf;
  100.     #[ORM\Column(type'string'length255nullabletrue)]
  101.     private ?string $ADH_SITE_WEB// plus utilisé, se trouve dans magasin_url -> type = siteweb
  102.     #[ORM\Column(name'adh_crm'type'string'length11nullabletrue)]
  103.     private ?string $adhCrm null;
  104.     #[ORM\JoinTable(name'magasin_services')]
  105.     #[ORM\JoinColumn(name'k_adherent'referencedColumnName'k_adherent')]
  106.     #[ORM\InverseJoinColumn(name'service_id'referencedColumnName'id')]
  107.     #[ORM\ManyToMany(targetEntityService::class, inversedBy'magasins')]
  108.     private $services;
  109.     #[ORM\JoinTable(name'magasin_specialites')]
  110.     #[ORM\JoinColumn(name'k_adherent'referencedColumnName'k_adherent')]
  111.     #[ORM\InverseJoinColumn(name'specialite_id'referencedColumnName'id')]
  112.     #[ORM\ManyToMany(targetEntitySpecialite::class, inversedBy'magasins')]
  113.     private $specialites;
  114.     /**
  115.      * @var Complement[]
  116.      */
  117.     #[ORM\JoinTable(name'magasin_complements')]
  118.     #[ORM\JoinColumn(name'k_adherent'referencedColumnName'k_adherent')]
  119.     #[ORM\InverseJoinColumn(name'complement_id'referencedColumnName'id')]
  120.     #[ORM\ManyToMany(targetEntityComplement::class, inversedBy'magasins')]
  121.     private $complements;
  122.     /**
  123.      * @var OperateursRemboursement[]
  124.      */
  125.     #[ORM\JoinTable(name'magasin_operateurs')]
  126.     #[ORM\JoinColumn(name'k_adherent'referencedColumnName'k_adherent')]
  127.     #[ORM\InverseJoinColumn(name'operateur_id'referencedColumnName'id')]
  128.     #[ORM\ManyToMany(targetEntityOperateursRemboursement::class, inversedBy'magasins')]
  129.     private $operateursRemboursement;
  130.     #[ORM\OneToMany(mappedBy'magasin'targetEntityWidgetAbstract::class)]
  131.     private $widgetAbstracts;
  132.     #[ORM\OneToMany(mappedBy'magasin'targetEntityPageAbstract::class)]
  133.     private $pageAbstracts;
  134.     #[ORM\OneToMany(mappedBy'magasin'targetEntityMagasinCollaborateurs::class)]
  135.     private $magasinCollaborateurs;
  136.     #[ORM\OneToOne(mappedBy'magasin'targetEntityMagasinEquipe::class)]
  137.     private mixed $magasinEquipe;
  138.     #[ORM\OneToMany(mappedBy'magasin'targetEntityMagasinMarques::class)]
  139.     private $magasinMarques;
  140.     #[ORM\OneToMany(mappedBy'magasin'targetEntityNavigation::class)]
  141.     private $navigations;
  142.     #[ORM\OneToMany(mappedBy'magasin'targetEntityMagasinUrl::class)]
  143.     private $magasinUrl;
  144.     #[ORM\OneToMany(mappedBy'magasin'targetEntityMagasinJuridique::class)]
  145.     private $magasinJuridiques;
  146.     #[ORM\Column(type'string'length255nullabletrue)]
  147.     private mixed $adhMmStat;
  148.     #[ORM\OneToMany(mappedBy'magasin'targetEntityMagasinContact::class, cascade: ['persist''remove'])]
  149.     private $magasinContacts;
  150.     #[ORM\Column(type'boolean')]
  151.     private mixed $packOpc;
  152.     #[ORM\Column(type'string'length255nullabletrue)]
  153.     private mixed $centrale;
  154.     #[ORM\OneToMany(mappedBy'adherent'targetEntityAnnonce::class)]
  155.     private $annonces;
  156.     #[ORM\OneToMany(mappedBy'magasin'targetEntityMagasinAlert::class)]
  157.     private Collection $magasinAlerts;
  158.     #[ORM\Column(type'boolean'nullablefalse)]
  159.     private bool $wantFacturationPapier false;
  160.     #[ORM\Column(type'boolean'nullablefalse)]
  161.     private bool $avisGmbActive false;
  162.     #[ORM\Column(type'boolean')]
  163.     private bool $affAvisCrmOpc false// Affichage des avis CRM sur OPC
  164.     #[ORM\OneToMany(mappedBy'k_adherent'targetEntityMagasinMarquesAlertes::class)]
  165.     private Collection $magasinMarquesAlertes;
  166.     #[ORM\OneToMany(mappedBy'magasin'targetEntityVenteRechercheMagasinsAlertes::class)]
  167.     private Collection $venteRechercheMagasinsAlertes;
  168.     #[ORM\OneToMany(mappedBy'magasin'targetEntityMagasinConsentements::class)]
  169.     private Collection $consentements;
  170.     #[ORM\OneToMany(mappedBy'k_adh'targetEntityAvisEvenement::class)]
  171.     private Collection $avis35ans;
  172.     # J'accepte que mes services, spécialités et informations complémentaires soient visibles sur les différentes plateformes web du Groupe all.
  173.     #[ORM\Column(type'boolean')]
  174.     private mixed $consentServSpecInfoComple;
  175.     #[ORM\OneToMany(mappedBy'magasin'targetEntityMagasinReseaux::class, cascade: ['persist''remove'])]
  176.     private $magasinReseaux;
  177.     #[ORM\Column(type'text'nullabletrue)]
  178.     private mixed $convictionFr;
  179.     #[ORM\Column(type'text'nullabletrue)]
  180.     private mixed $convictionNl;
  181.     #[ORM\OneToMany(mappedBy'magasin'targetEntitySeoVilles::class)]
  182.     private Collection $seoVilles;
  183.     #[ORM\OneToMany(mappedBy'adherent'targetEntityFaq::class)]
  184.     private Collection $faqs;
  185.     #[ORM\OneToMany(mappedBy'magasin'targetEntityImagePartner::class)]
  186.     private Collection $imagePartners;
  187.     #[ORM\OneToMany(mappedBy'magasin'targetEntityKpiParameters::class, cascade: ['persist''remove'])]
  188.     private Collection $exercices;
  189.     #[ORM\OneToMany(mappedBy'magasin'targetEntityKpiObjectifs::class, cascade: ['persist''remove'])]
  190.     private Collection $kpiObjectifs;
  191.     #[ORM\OneToOne(mappedBy'magasin'cascade: ['persist''remove'])]
  192.     private ?CrmSettings $crmSettings null;
  193.     #[ORM\OneToMany(mappedBy'magasin'targetEntityCrmResponseIa::class)]
  194.     private Collection $crmResponseIas;
  195.     public function __construct()
  196.     {
  197.         $this->createdAt = new DateTimeImmutable('now');
  198.         $this->magasinCoordonnees = new ArrayCollection();
  199.         $this->magasinHoraires = new ArrayCollection();
  200.         $this->magasinHorairesExceptionnelles = new ArrayCollection();
  201.         $this->magasinConvictions = new ArrayCollection();
  202.         $this->services = new ArrayCollection();
  203.         $this->specialites = new ArrayCollection();
  204.         $this->complements = new ArrayCollection();
  205.         $this->operateursRemboursement = new ArrayCollection();
  206.         $this->widgetAbstracts = new ArrayCollection();
  207.         $this->pageAbstracts = new ArrayCollection();
  208.         $this->magasinCollaborateurs = new ArrayCollection();
  209.         $this->magasinMarques = new ArrayCollection();
  210.         $this->navigations = new ArrayCollection();
  211.         $this->magasinJuridiques = new ArrayCollection();
  212.         $this->magasinContacts = new ArrayCollection();
  213.         $this->annonces = new ArrayCollection();
  214.         $this->magasinAlerts = new ArrayCollection();
  215.         $this->magasinMarquesAlertes = new ArrayCollection();
  216.         $this->consentements = new ArrayCollection();
  217.         $this->avis35ans = new ArrayCollection();
  218.         $this->magasinReseaux = new ArrayCollection();
  219.         $this->consentServSpecInfoComple false;
  220.         $this->seoVilles = new ArrayCollection();
  221.         $this->lang = new ArrayCollection();
  222.         $this->crmResponseIas = new ArrayCollection();
  223.         $this->exercices = new ArrayCollection();
  224.         $this->kpiObjectifs = new ArrayCollection();
  225.     }
  226.     public function __toString(): string
  227.     {
  228.         return ($this->k_adherent ' - ' $this->getLib());
  229.     }
  230.     public function setKAdherent($adherent)
  231.     {
  232.         $this->k_adherent $adherent;
  233.         return $this;
  234.     }
  235.     public function getKAdherent(): ?string
  236.     {
  237.         return $this->k_adherent;
  238.     }
  239.     public function getKMag(): ?string
  240.     {
  241.         return $this->k_mag;
  242.     }
  243.     public function setKMag(string $k_mag): self
  244.     {
  245.         $this->k_mag $k_mag;
  246.         return $this;
  247.     }
  248.     public function getSiret(): ?string
  249.     {
  250.         return $this->siret;
  251.     }
  252.     public function setSiret(?string $siret): self
  253.     {
  254.         $this->siret $siret;
  255.         return $this;
  256.     }
  257.     public function getSiren(): ?string
  258.     {
  259.         return $this->siren;
  260.     }
  261.     public function setSiren(?string $siren): self
  262.     {
  263.         $this->siren $siren;
  264.         return $this;
  265.     }
  266.     public function getLib(): ?string
  267.     {
  268.         return $this->lib;
  269.     }
  270.     public function setLib(string $lib): self
  271.     {
  272.         $this->lib $lib;
  273.         return $this;
  274.     }
  275.     public function getKPays(): ?string
  276.     {
  277.         return $this->k_pays;
  278.     }
  279.     public function setKPays(string $k_pays): self
  280.     {
  281.         $this->k_pays $k_pays;
  282.         return $this;
  283.     }
  284.     public function getKLangue(): ?string
  285.     {
  286.         return $this->k_langue;
  287.     }
  288.     public function setKLangue(string $k_langue): self
  289.     {
  290.         $this->k_langue $k_langue;
  291.         return $this;
  292.     }
  293.     public function getLat(): ?string
  294.     {
  295.         return $this->lat;
  296.     }
  297.     public function setLat(?string $lat): self
  298.     {
  299.         $this->lat $lat;
  300.         return $this;
  301.     }
  302.     public function getLon(): ?string
  303.     {
  304.         return $this->lon;
  305.     }
  306.     public function setLon(?string $lon): self
  307.     {
  308.         $this->lon $lon;
  309.         return $this;
  310.     }
  311.     public function getKUserSuivi(): ?string
  312.     {
  313.         return $this->k_user_suivi;
  314.     }
  315.     public function setKUserSuivi(?string $k_user_suivi): self
  316.     {
  317.         $this->k_user_suivi $k_user_suivi;
  318.         return $this;
  319.     }
  320.     public function getKLogiciel(): ?string
  321.     {
  322.         return $this->k_logiciel;
  323.     }
  324.     public function setKLogiciel(?string $k_logiciel): self
  325.     {
  326.         $this->k_logiciel $k_logiciel;
  327.         return $this;
  328.     }
  329.     public function getCreatedAt(): ?DateTimeImmutable
  330.     {
  331.         return $this->createdAt;
  332.     }
  333.     public function setCreatedAt(DateTimeImmutable $createdAt): self
  334.     {
  335.         $this->createdAt $createdAt;
  336.         return $this;
  337.     }
  338.     public function getUpdated(): ?bool
  339.     {
  340.         return $this->updated;
  341.     }
  342.     public function setUpdated(bool $updated): self
  343.     {
  344.         $this->updated $updated;
  345.         return $this;
  346.     }
  347.     public function getDeleted(): ?bool
  348.     {
  349.         return $this->deleted;
  350.     }
  351.     public function setDeleted(?bool $deleted): self
  352.     {
  353.         $this->deleted $deleted;
  354.         return $this;
  355.     }
  356.     public function getDeletedAt(): ?DateTimeImmutable
  357.     {
  358.         return $this->deletedAt;
  359.     }
  360.     public function setDeletedAt(?DateTimeImmutable $deletedAt): self
  361.     {
  362.         $this->deletedAt $deletedAt;
  363.         return $this;
  364.     }
  365.     public function getADHMM(): ?string
  366.     {
  367.         return $this->ADH_MM;
  368.     }
  369.     public function setADHMM(?string $ADH_MM): self
  370.     {
  371.         $this->ADH_MM $ADH_MM;
  372.         return $this;
  373.     }
  374.     public function getKNIVEAUADH(): ?string
  375.     {
  376.         return $this->K_NIVEAUADH;
  377.     }
  378.     public function setKNIVEAUADH(?string $K_NIVEAUADH): self
  379.     {
  380.         $this->K_NIVEAUADH $K_NIVEAUADH;
  381.         return $this;
  382.     }
  383.     public function getKTYPECLIENT(): ?string
  384.     {
  385.         return $this->K_TYPE_CLIENT;
  386.     }
  387.     public function setKTYPECLIENT(?string $K_TYPE_CLIENT): self
  388.     {
  389.         $this->K_TYPE_CLIENT $K_TYPE_CLIENT;
  390.         return $this;
  391.     }
  392.     public function getLBLACKLIST(): ?bool
  393.     {
  394.         return $this->L_BLACKLIST;
  395.     }
  396.     public function setLBLACKLIST(?bool $L_BLACKLIST): self
  397.     {
  398.         $this->L_BLACKLIST $L_BLACKLIST;
  399.         return $this;
  400.     }
  401.     public function getUserRs(): ?string
  402.     {
  403.         return $this->user_rs;
  404.     }
  405.     public function setUserRs(?string $user_rs): self
  406.     {
  407.         $this->user_rs $user_rs;
  408.         return $this;
  409.     }
  410.     public function getUserCpv(): ?string
  411.     {
  412.         return $this->user_cpv;
  413.     }
  414.     public function setUserCpv(?string $user_cpv): self
  415.     {
  416.         $this->user_cpv $user_cpv;
  417.         return $this;
  418.     }
  419.     public function getUserAdv(): ?string
  420.     {
  421.         return $this->user_adv;
  422.     }
  423.     public function setUserAdv(?string $user_adv): self
  424.     {
  425.         $this->user_adv $user_adv;
  426.         return $this;
  427.     }
  428.     public function getUserAchat(): ?string
  429.     {
  430.         return $this->user_achat;
  431.     }
  432.     public function setUserAchat(?string $user_achat): self
  433.     {
  434.         $this->user_achat $user_achat;
  435.         return $this;
  436.     }
  437.     public function getUserPaiement(): ?string
  438.     {
  439.         return $this->user_paiement;
  440.     }
  441.     public function setUserPaiement(?string $user_paiement): self
  442.     {
  443.         $this->user_paiement $user_paiement;
  444.         return $this;
  445.     }
  446.     public function getUserOp(): ?string
  447.     {
  448.         return $this->user_op;
  449.     }
  450.     public function setUserOp(?string $user_op): self
  451.     {
  452.         $this->user_op $user_op;
  453.         return $this;
  454.     }
  455.     public function getUserCpvConf(): ?string
  456.     {
  457.         return $this->user_cpv_conf;
  458.     }
  459.     public function setUserCpvConf(?string $user_cpv_conf): self
  460.     {
  461.         $this->user_cpv_conf $user_cpv_conf;
  462.         return $this;
  463.     }
  464.     public function getADHSITEWEB(): ?string
  465.     {
  466.         return $this->ADH_SITE_WEB;
  467.     }
  468.     public function setADHSITEWEB(?string $ADH_SITE_WEB): self
  469.     {
  470.         $this->ADH_SITE_WEB $ADH_SITE_WEB;
  471.         return $this;
  472.     }
  473.     public function getMagasinCoordonnees($type null)
  474.     {
  475.         // Retourne directement le type d'adresse souhaité
  476.         $allow = ['MARKETING''MAGASIN''SIEGE'];
  477.         if (!is_null($type)) {
  478.             $adresse = [];
  479.             if (in_array($type$allow)) {
  480.                 foreach ($this->magasinCoordonnees as $adresse) {
  481.                     if ($adresse->getType() == strtoupper((string)$type)) {
  482.                         return $adresse;
  483.                     }
  484.                 }
  485.                 return $adresse;
  486.             } else {
  487.                 return null;
  488.             }
  489.             return null;
  490.         }
  491.         // Sinon on retourne toute la collection
  492.         return $this->magasinCoordonnees;
  493.     }
  494.     public function addMagasinCoordonnee(MagasinCoordonnees $magasinCoordonnee): self
  495.     {
  496.         if (!$this->magasinCoordonnees->contains($magasinCoordonnee)) {
  497.             $this->magasinCoordonnees[] = $magasinCoordonnee;
  498.             $magasinCoordonnee->setMagasin($this);
  499.         }
  500.         return $this;
  501.     }
  502.     public function removeMagasinCoordonnee(MagasinCoordonnees $magasinCoordonnee): self
  503.     {
  504.         if ($this->magasinCoordonnees->removeElement($magasinCoordonnee)) {
  505.             // set the owning side to null (unless already changed)
  506.             if ($magasinCoordonnee->getMagasin() === $this) {
  507.                 $magasinCoordonnee->setMagasin(null);
  508.             }
  509.         }
  510.         return $this;
  511.     }
  512.     public function getMagasinHoraires(): Collection
  513.     {
  514.         return $this->magasinHoraires;
  515.     }
  516.     public function addMagasinHoraire(MagasinHoraires $magasinHoraire): self
  517.     {
  518.         if (!$this->magasinHoraires->contains($magasinHoraire)) {
  519.             $this->magasinHoraires[] = $magasinHoraire;
  520.             $magasinHoraire->setMagasin($this);
  521.         }
  522.         return $this;
  523.     }
  524.     public function removeMagasinHoraire(MagasinHoraires $magasinHoraire): self
  525.     {
  526.         if ($this->magasinHoraires->removeElement($magasinHoraire)) {
  527.             // set the owning side to null (unless already changed)
  528.             if ($magasinHoraire->getMagasin() === $this) {
  529.                 $magasinHoraire->setMagasin(null);
  530.             }
  531.         }
  532.         return $this;
  533.     }
  534.     public function getMagasinHorairesExceptionnelles(): Collection
  535.     {
  536.         return $this->magasinHorairesExceptionnelles;
  537.     }
  538.     public function addMagasinHorairesExceptionnelle(MagasinHorairesExceptionnelles $magasinHorairesExceptionnelle): self
  539.     {
  540.         if (!$this->magasinHorairesExceptionnelles->contains($magasinHorairesExceptionnelle)) {
  541.             $this->magasinHorairesExceptionnelles[] = $magasinHorairesExceptionnelle;
  542.             $magasinHorairesExceptionnelle->setMagasin($this);
  543.         }
  544.         return $this;
  545.     }
  546.     public function removeMagasinHorairesExceptionnelle(MagasinHorairesExceptionnelles $magasinHorairesExceptionnelle): self
  547.     {
  548.         if ($this->magasinHorairesExceptionnelles->removeElement($magasinHorairesExceptionnelle)) {
  549.             // set the owning side to null (unless already changed)
  550.             if ($magasinHorairesExceptionnelle->getMagasin() === $this) {
  551.                 $magasinHorairesExceptionnelle->setMagasin(null);
  552.             }
  553.         }
  554.         return $this;
  555.     }
  556.     public
  557.     function getMagasinConvictions(): Collection
  558.     {
  559.         return $this->magasinConvictions;
  560.     }
  561.     public
  562.     function addMagasinConviction(MagasinConviction $magasinConviction): self
  563.     {
  564.         if (!$this->magasinConvictions->contains($magasinConviction)) {
  565.             $this->magasinConvictions[] = $magasinConviction;
  566.             $magasinConviction->setKAdherent($this);
  567.         }
  568.         return $this;
  569.     }
  570.     public
  571.     function removeMagasinConviction(MagasinConviction $magasinConviction): self
  572.     {
  573.         if ($this->magasinConvictions->removeElement($magasinConviction)) {
  574.             // set the owning side to null (unless already changed)
  575.             if ($magasinConviction->getKAdherent() === $this) {
  576.                 $magasinConviction->setKAdherent(null);
  577.             }
  578.         }
  579.         return $this;
  580.     }
  581.     public
  582.     function getServices(): Collection
  583.     {
  584.         return $this->services;
  585.     }
  586.     public
  587.     function addService(Service $service): self
  588.     {
  589.         if (!$this->services->contains($service)) {
  590.             $this->services[] = $service;
  591.         }
  592.         return $this;
  593.     }
  594.     public
  595.     function removeService(Service $service): self
  596.     {
  597.         $this->services->removeElement($service);
  598.         return $this;
  599.     }
  600.     public
  601.     function getSpecialites(): Collection
  602.     {
  603.         return $this->specialites;
  604.     }
  605.     public
  606.     function addSpecialite(Specialite $specialite): self
  607.     {
  608.         if (!$this->specialites->contains($specialite)) {
  609.             $this->specialites[] = $specialite;
  610.         }
  611.         return $this;
  612.     }
  613.     public
  614.     function removeSpecialite(Specialite $specialite): self
  615.     {
  616.         $this->specialites->removeElement($specialite);
  617.         return $this;
  618.     }
  619.     public function getComplements($type null): Collection|array
  620.     {
  621.         if (!is_null($type)) {
  622.             $datas = [];
  623.             foreach ($this->complements as $complement) {
  624.                 if ($complement->getType() == $type) {
  625.                     $datas[] = $complement;
  626.                 }
  627.             }
  628.             return $datas;
  629.         }
  630.         return $this->complements;
  631.     }
  632.     public
  633.     function addComplement(Complement $complement): self
  634.     {
  635.         if (!$this->complements->contains($complement)) {
  636.             $this->complements[] = $complement;
  637.         }
  638.         return $this;
  639.     }
  640.     public
  641.     function removeComplement(Complement $complement): self
  642.     {
  643.         $this->complements->removeElement($complement);
  644.         return $this;
  645.     }
  646.     public
  647.     function getOperateursRemboursement(): Collection
  648.     {
  649.         return $this->operateursRemboursement;
  650.     }
  651.     public
  652.     function addOperateursRemboursement(OperateursRemboursement $operateursRemboursement): self
  653.     {
  654.         if (!$this->operateursRemboursement->contains($operateursRemboursement)) {
  655.             $this->operateursRemboursement[] = $operateursRemboursement;
  656.         }
  657.         return $this;
  658.     }
  659.     public
  660.     function removeOperateursRemboursement(OperateursRemboursement $operateursRemboursement): self
  661.     {
  662.         $this->operateursRemboursement->removeElement($operateursRemboursement);
  663.         return $this;
  664.     }
  665.     public
  666.     function getWidgetAbstracts(): Collection
  667.     {
  668.         return $this->widgetAbstracts;
  669.     }
  670.     public
  671.     function addWidgetAbstract(WidgetAbstract $widgetAbstract): self
  672.     {
  673.         if (!$this->widgetAbstracts->contains($widgetAbstract)) {
  674.             $this->widgetAbstracts[] = $widgetAbstract;
  675.             $widgetAbstract->setMagasin($this);
  676.         }
  677.         return $this;
  678.     }
  679.     public
  680.     function removeWidgetAbstract(WidgetAbstract $widgetAbstract): self
  681.     {
  682.         if ($this->widgetAbstracts->removeElement($widgetAbstract)) {
  683.             // set the owning side to null (unless already changed)
  684.             if ($widgetAbstract->getMagasin() === $this) {
  685.                 $widgetAbstract->setMagasin(null);
  686.             }
  687.         }
  688.         return $this;
  689.     }
  690.     public
  691.     function getPageAbstracts(): Collection
  692.     {
  693.         return $this->pageAbstracts;
  694.     }
  695.     public
  696.     function addPageAbstract(PageAbstract $pageAbstract): self
  697.     {
  698.         if (!$this->pageAbstracts->contains($pageAbstract)) {
  699.             $this->pageAbstracts[] = $pageAbstract;
  700.             $pageAbstract->setMagasin($this);
  701.         }
  702.         return $this;
  703.     }
  704.     public
  705.     function removePageAbstract(PageAbstract $pageAbstract): self
  706.     {
  707.         if ($this->pageAbstracts->removeElement($pageAbstract)) {
  708.             // set the owning side to null (unless already changed)
  709.             if ($pageAbstract->getMagasin() === $this) {
  710.                 $pageAbstract->setMagasin(null);
  711.             }
  712.         }
  713.         return $this;
  714.     }
  715.     public
  716.     function getMagasinCollaborateurs(): Collection
  717.     {
  718.         return $this->magasinCollaborateurs;
  719.     }
  720.     public
  721.     function addMagasinCollaborateur(MagasinCollaborateurs $magasinCollaborateur): self
  722.     {
  723.         if (!$this->magasinCollaborateurs->contains($magasinCollaborateur)) {
  724.             $this->magasinCollaborateurs[] = $magasinCollaborateur;
  725.             $magasinCollaborateur->setMagasin($this);
  726.         }
  727.         return $this;
  728.     }
  729.     public
  730.     function removeMagasinCollaborateur(MagasinCollaborateurs $magasinCollaborateur): self
  731.     {
  732.         if ($this->magasinCollaborateurs->removeElement($magasinCollaborateur)) {
  733.             // set the owning side to null (unless already changed)
  734.             if ($magasinCollaborateur->getMagasin() === $this) {
  735.                 $magasinCollaborateur->setMagasin(null);
  736.             }
  737.         }
  738.         return $this;
  739.     }
  740.     public
  741.     function getMagasinEquipe()
  742.     {
  743.         return $this->magasinEquipe;
  744.     }
  745.     public
  746.     function setMagasinEquipe(mixed $magasinEquipe): void
  747.     {
  748.         $this->magasinEquipe $magasinEquipe;
  749.     }
  750.     public
  751.     function getMagasinMarques(): Collection
  752.     {
  753.         return $this->magasinMarques;
  754.     }
  755.     public
  756.     function addMagasinMarque(MagasinMarques $magasinMarque): self
  757.     {
  758.         if (!$this->magasinMarques->contains($magasinMarque)) {
  759.             $this->magasinMarques[] = $magasinMarque;
  760.             $magasinMarque->setMagasin($this);
  761.         }
  762.         return $this;
  763.     }
  764.     public
  765.     function removeMagasinMarque(MagasinMarques $magasinMarque): self
  766.     {
  767.         if ($this->magasinMarques->removeElement($magasinMarque)) {
  768.             // set the owning side to null (unless already changed)
  769.             if ($magasinMarque->getMagasin() === $this) {
  770.                 $magasinMarque->setMagasin(null);
  771.             }
  772.         }
  773.         return $this;
  774.     }
  775.     public
  776.     function getNavigations(): Collection
  777.     {
  778.         return $this->navigations;
  779.     }
  780.     public
  781.     function addNavigation(Navigation $navigation): self
  782.     {
  783.         if (!$this->navigations->contains($navigation)) {
  784.             $this->navigations[] = $navigation;
  785.             $navigation->setMagasin($this);
  786.         }
  787.         return $this;
  788.     }
  789.     public
  790.     function removeNavigation(Navigation $navigation): self
  791.     {
  792.         if ($this->navigations->removeElement($navigation)) {
  793.             // set the owning side to null (unless already changed)
  794.             if ($navigation->getMagasin() === $this) {
  795.                 $navigation->setMagasin(null);
  796.             }
  797.         }
  798.         return $this;
  799.     }
  800.     public function getMagasinUrl($type null)
  801.     {
  802.         if (!is_null($type)) {
  803.             foreach ($this->magasinUrl as $url) {
  804.                 if ($url->getType() == $type) {
  805.                     return $url;
  806.                 }
  807.             }
  808.             return null;
  809.         } else {
  810.             return $this->magasinUrl;
  811.         }
  812.     }
  813.     public function addMagasinUrl(MagasinUrl $magasinUrl): self
  814.     {
  815.         if (!$this->magasinUrl->contains($magasinUrl)) {
  816.             $this->magasinUrl[] = $magasinUrl;
  817.             $magasinUrl->setMagasin($this);
  818.         }
  819.         return $this;
  820.     }
  821.     public function removeMagasinUrl(MagasinUrl $magasinUrl): self
  822.     {
  823.         if ($this->magasinUrl->removeElement($magasinUrl)) {
  824.             // set the owning side to null (unless already changed)
  825.             if ($magasinUrl->getMagasin() === $this) {
  826.                 $magasinUrl->setMagasin(null);
  827.             }
  828.         }
  829.         return $this;
  830.     }
  831.     public function getMagasinJuridiques(): Collection
  832.     {
  833.         return $this->magasinJuridiques;
  834.     }
  835.     public
  836.     function addMagasinJuridique(MagasinJuridique $magasinJuridique): self
  837.     {
  838.         if (!$this->magasinJuridiques->contains($magasinJuridique)) {
  839.             $this->magasinJuridiques[] = $magasinJuridique;
  840.             $magasinJuridique->setMagasin($this);
  841.         }
  842.         return $this;
  843.     }
  844.     public
  845.     function removeMagasinJuridique(MagasinJuridique $magasinJuridique): self
  846.     {
  847.         if ($this->magasinJuridiques->removeElement($magasinJuridique)) {
  848.             // set the owning side to null (unless already changed)
  849.             if ($magasinJuridique->getMagasin() === $this) {
  850.                 $magasinJuridique->setMagasin(null);
  851.             }
  852.         }
  853.         return $this;
  854.     }
  855.     public
  856.     function getAdhMmStat()
  857.     {
  858.         return $this->adhMmStat;
  859.     }
  860.     public
  861.     function setAdhMmStat(mixed $adhMmStat): void
  862.     {
  863.         $this->adhMmStat $adhMmStat;
  864.     }
  865.     public
  866.     function getMagasinContacts(MagasinContactQualifier $qualifier null$principal false): Collection
  867.     {
  868.         if (!is_null($qualifier)) {
  869.             $data = new ArrayCollection();
  870.             foreach ($this->magasinContacts as $contact) {
  871.                 if ($contact->getQualifier() === $qualifier && $contact->isPrincipal() === $principal) {
  872.                     $data->add($contact);
  873.                 }
  874.             }
  875.             return $data;
  876.         }
  877.         return $this->magasinContacts;
  878.     }
  879.     public function hasMagasinContact(MagasinContact $contactMagasinContactQualifier $qualifier): bool
  880.     {
  881.         return array_reduce($this->magasinContacts->toArray(), fn($carry$magContact) => $carry || ($contact !== $magContact && $magContact->getQualifier() === $qualifier), false);
  882.     }
  883.     public function allowExistMagasinContact(MagasinContact $contact): bool
  884.     {
  885.         return array_reduce($this->magasinContacts->toArray(), fn($carry$magContact) => $carry || ($contact !== $magContact && $contact->getValue() === $magContact->getValue() && $magContact->getQualifier() === $contact->getQualifier()), false);
  886.     }
  887.     public function getSpecificMagContact(MagasinContactQualifier $qualifierbool|null $principal null$initialize false)
  888.     {
  889.         foreach ($this->magasinContacts as $contact) {
  890.             if ($contact->getQualifier() === $qualifier && (!is_bool($principal) || $contact->isPrincipal() === $principal)) {
  891.                 return $contact;
  892.             }
  893.         }
  894.         if ($initialize) {
  895.             $contact = new MagasinContact();
  896.             $contact->setQualifier($qualifier);
  897.             $contact->setMagasin($this);
  898.             $contact->setName($qualifier->getLabel());
  899.             if (is_bool($principal)) {
  900.                 $contact->setPrincipal($principal);
  901.             }
  902.             return $contact;
  903.         }
  904.         return null;
  905.     }
  906.     public
  907.     function addMagasinContact(MagasinContact $magasinContact): self
  908.     {
  909.         if (!$this->magasinContacts->contains($magasinContact)) {
  910.             $this->magasinContacts[] = $magasinContact;
  911.             $magasinContact->setMagasin($this);
  912.         }
  913.         return $this;
  914.     }
  915.     public
  916.     function removeMagasinContact(MagasinContact $magasinContact): self
  917.     {
  918.         if ($this->magasinContacts->removeElement($magasinContact)) {
  919.             // set the owning side to null (unless already changed)
  920.             if ($magasinContact->getMagasin() === $this) {
  921.                 $magasinContact->setMagasin(null);
  922.             }
  923.         }
  924.         return $this;
  925.     }
  926.     public
  927.     function setAdhCrm($adhCrm null)
  928.     {
  929.         $this->adhCrm $adhCrm;
  930.         return $this;
  931.     }
  932.     public
  933.     function getAdhCrm()
  934.     {
  935.         return $this->adhCrm;
  936.     }
  937.     public function getPackOpc()
  938.     {
  939.         return $this->packOpc;
  940.     }
  941.     public function setPackOpc($packOpc): void
  942.     {
  943.         $this->packOpc $packOpc;
  944.     }
  945.     public function getAnnonces(): Collection
  946.     {
  947.         return $this->annonces;
  948.     }
  949.     public function addAnnonce(Annonce $annonce): self
  950.     {
  951.         if (!$this->annonces->contains($annonce)) {
  952.             $this->annonces[] = $annonce;
  953.             $annonce->setAdherent($this);
  954.         }
  955.         return $this;
  956.     }
  957.     public function removeAnnonce(Annonce $annonce): self
  958.     {
  959.         if ($this->annonces->removeElement($annonce)) {
  960.             // set the owning side to null (unless already changed)
  961.             if ($annonce->getAdherent() === $this) {
  962.                 $annonce->setAdherent(null);
  963.             }
  964.         }
  965.         return $this;
  966.     }
  967.     public function getMagasinAlert($type)
  968.     {
  969.         $magasinAlert = [];
  970.         $datas $this->magasinAlerts->toArray();
  971.         foreach ($datas as $data) {
  972.             if ($data->getType() == $type)
  973.                 $magasinAlert[] = $data;
  974.         }
  975.         return current($magasinAlert);
  976.     }
  977.     public function addMagasinAlert(MagasinAlert $magasinAlert): self
  978.     {
  979.         if (!$this->magasinAlerts->contains($magasinAlert)) {
  980.             $this->magasinAlerts->add($magasinAlert);
  981.             $magasinAlert->setMagasin($this);
  982.         }
  983.         return $this;
  984.     }
  985.     public function getConsentements(): Collection
  986.     {
  987.         return $this->consentements;
  988.     }
  989.     public function addConsentement(MagasinConsentements $consentement): self
  990.     {
  991.         if (!$this->consentements->contains($consentement)) {
  992.             $this->consentements->add($consentement);
  993.             $consentement->setMagasin($this);
  994.         }
  995.         return $this;
  996.     }
  997.     public function removeMagasinAlert(MagasinAlert $magasinAlert): self
  998.     {
  999.         if ($this->magasinAlerts->removeElement($magasinAlert)) {
  1000.             // set the owning side to null (unless already changed)
  1001.             if ($magasinAlert->getMagasin() === $this) {
  1002.                 $magasinAlert->setMagasin(null);
  1003.             }
  1004.         }
  1005.         return $this;
  1006.     }
  1007.     public function getMagasinMarquesAlertes(): Collection
  1008.     {
  1009.         return $this->magasinMarquesAlertes;
  1010.     }
  1011.     public function addMagasinMarquesAlerte(MagasinMarquesAlertes $magasinMarquesAlerte): self
  1012.     {
  1013.         if (!$this->magasinMarquesAlertes->contains($magasinMarquesAlerte)) {
  1014.             $this->magasinMarquesAlertes->add($magasinMarquesAlerte);
  1015.             $magasinMarquesAlerte->setKAdherent($this);
  1016.         }
  1017.         return $this;
  1018.     }
  1019.     public function removeMagasinMarquesAlerte(MagasinMarquesAlertes $magasinMarquesAlerte): self
  1020.     {
  1021.         if ($this->magasinMarquesAlertes->removeElement($magasinMarquesAlerte)) {
  1022.             // set the owning side to null (unless already changed)
  1023.             if ($magasinMarquesAlerte->getKAdherent() === $this) {
  1024.                 $magasinMarquesAlerte->setKAdherent(null);
  1025.             }
  1026.         }
  1027.         return $this;
  1028.     }
  1029.     public function getFirstMagasinContacts()
  1030.     {
  1031.         if (!empty($this->magasinContacts->toArray())) {
  1032.             return $this->magasinContacts->toArray()[0];
  1033.         }
  1034.         return null;
  1035.     }
  1036.     public function getSpecificConsentement(string $type)
  1037.     {
  1038.         foreach ($this->consentements as $consentement) {
  1039.             if (strtolower($consentement->getType()) === strtolower($type)) {
  1040.                 return $consentement;
  1041.             }
  1042.         }
  1043.         return null;
  1044.     }
  1045.     public function removeConsentement(MagasinConsentements $consentement): self
  1046.     {
  1047.         if ($this->consentements->removeElement($consentement)) {
  1048.             // set the owning side to null (unless already changed)
  1049.             if ($consentement->getMagasin() === $this) {
  1050.                 $consentement->setMagasin(null);
  1051.             }
  1052.         }
  1053.         return $this;
  1054.     }
  1055.     public function getAvis35ans(): Collection
  1056.     {
  1057.         return $this->avis35ans;
  1058.     }
  1059.     public function addAvis35an(AvisEvenement $avis35an): static
  1060.     {
  1061.         if (!$this->avis35ans->contains($avis35an)) {
  1062.             $this->avis35ans->add($avis35an);
  1063.             $avis35an->setKAdh($this);
  1064.         }
  1065.         return $this;
  1066.     }
  1067.     public function removeAvis35an(AvisEvenement $avis35an): static
  1068.     {
  1069.         if ($this->avis35ans->removeElement($avis35an)) {
  1070.             // set the owning side to null (unless already changed)
  1071.             if ($avis35an->getKAdh() === $this) {
  1072.                 $avis35an->setKAdh(null);
  1073.             }
  1074.         }
  1075.         return $this;
  1076.     }
  1077.     public function getCentrale(): mixed
  1078.     {
  1079.         return $this->centrale;
  1080.     }
  1081.     public function setCentrale($centrale): void
  1082.     {
  1083.         $this->centrale $centrale;
  1084.     }
  1085.     public function getConvictionFr(): mixed
  1086.     {
  1087.         return $this->convictionFr;
  1088.     }
  1089.     public function setConvictionFr($convictionFr): void
  1090.     {
  1091.         $this->convictionFr $convictionFr;
  1092.     }
  1093.     public function getConvictionNl(): mixed
  1094.     {
  1095.         return $this->convictionNl;
  1096.     }
  1097.     public function setConvictionNl(mixed $convictionNl): void
  1098.     {
  1099.         $this->convictionNl $convictionNl;
  1100.     }
  1101.     public function setConsentement($magasinConsentements): self
  1102.     {
  1103.         foreach ($magasinConsentements as $magasinConsentement) {
  1104.             if (!$this->consentements->contains($magasinConsentement)) {
  1105.                 $this->consentements[] = $magasinConsentement;
  1106.                 $magasinConsentement->setMagasin($this);
  1107.             }
  1108.         }
  1109.         return $this;
  1110.     }
  1111.     public function addMagasinReseau(MagasinReseaux $magasinReseau): self
  1112.     {
  1113.         if (!$this->magasinReseaux->contains($magasinReseau)) {
  1114.             $this->magasinReseaux[] = $magasinReseau;
  1115.             $magasinReseau->setMagasin($this);
  1116.         }
  1117.         return $this;
  1118.     }
  1119.     public function removeMagasinReseau(MagasinReseaux $magasinReseau): self
  1120.     {
  1121.         if ($this->magasinReseaux->removeElement($magasinReseau)) {
  1122.             // set the owning side to null (unless already changed)
  1123.             if ($magasinReseau->getMagasin() === $this) {
  1124.                 $magasinReseau->setMagasin(null);
  1125.             }
  1126.         }
  1127.         return $this;
  1128.     }
  1129.     public function setMagasinReseaux($magasinReseaux): self
  1130.     {
  1131.         foreach ($magasinReseaux as $magasinReseau) {
  1132.             if (!$this->magasinReseaux->contains($magasinReseau)) {
  1133.                 $this->magasinReseaux[] = $magasinReseau;
  1134.                 $magasinReseau->setMagasin($this);
  1135.             }
  1136.         }
  1137.         return $this;
  1138.     }
  1139.     public function getMagasinReseaux(): Collection
  1140.     {
  1141.         return $this->magasinReseaux;
  1142.     }
  1143.     public function setConsentServSpecInfoComple($consentServSpecInfoComple): void
  1144.     {
  1145.         $this->consentServSpecInfoComple $consentServSpecInfoComple;
  1146.     }
  1147.     public function getConsentServSpecInfoComple(): mixed
  1148.     {
  1149.         return $this->consentServSpecInfoComple;
  1150.     }
  1151.     /**
  1152.      * @return Collection<int, SeoVilles>
  1153.      */
  1154.     public function getSeoVilles(): Collection
  1155.     {
  1156.         return $this->seoVilles;
  1157.     }
  1158.     public function addSeoVille(SeoVilles $seoVille): static
  1159.     {
  1160.         if (!$this->seoVilles->contains($seoVille)) {
  1161.             $this->seoVilles->add($seoVille);
  1162.             $seoVille->setMagasin($this);
  1163.         }
  1164.         return $this;
  1165.     }
  1166.     public function removeSeoVille(SeoVilles $seoVille): static
  1167.     {
  1168.         if ($this->seoVilles->removeElement($seoVille)) {
  1169.             // set the owning side to null (unless already changed)
  1170.             if ($seoVille->getMagasin() === $this) {
  1171.                 $seoVille->setMagasin(null);
  1172.             }
  1173.         }
  1174.         return $this;
  1175.     }
  1176.     public function getMagasinAlerts(): Collection
  1177.     {
  1178.         return $this->magasinAlerts;
  1179.     }
  1180.     public function setMagasinAlerts(Collection $magasinAlerts): void
  1181.     {
  1182.         $this->magasinAlerts $magasinAlerts;
  1183.     }
  1184.     public function isWantFacturationPapier(): bool
  1185.     {
  1186.         return $this->wantFacturationPapier;
  1187.     }
  1188.     public function setWantFacturationPapier(bool $wantFacturationPapier): void
  1189.     {
  1190.         $this->wantFacturationPapier $wantFacturationPapier;
  1191.     }
  1192.     public function isAvisGmbActive(): bool
  1193.     {
  1194.         return $this->avisGmbActive;
  1195.     }
  1196.     public function setAvisGmbActive(bool $avisGmbActive): void
  1197.     {
  1198.         $this->avisGmbActive $avisGmbActive;
  1199.     }
  1200.     public function isAffAvisCrmOpc(): bool
  1201.     {
  1202.         return $this->affAvisCrmOpc;
  1203.     }
  1204.     public function setAffAvisCrmOpc(bool $affAvisCrmOpc): void
  1205.     {
  1206.         $this->affAvisCrmOpc $affAvisCrmOpc;
  1207.     }
  1208.     public function getFaqs(): Collection
  1209.     {
  1210.         return $this->faqs;
  1211.     }
  1212.     public function setFaqs(Collection $faqs): void
  1213.     {
  1214.         $this->faqs $faqs;
  1215.     }
  1216.     /**
  1217.      * @return Collection
  1218.      */
  1219.     public function getVenteRechercheMagasinsAlertes(): Collection
  1220.     {
  1221.         return $this->venteRechercheMagasinsAlertes;
  1222.     }
  1223.     /**
  1224.      * @param Collection $venteRechercheMagasinsAlertes
  1225.      */
  1226.     public function setVenteRechercheMagasinsAlertes(Collection $venteRechercheMagasinsAlertes): void
  1227.     {
  1228.         $this->venteRechercheMagasinsAlertes $venteRechercheMagasinsAlertes;
  1229.     }
  1230.     public function initializeMagContact(MagasinContactQualifier $magasinContactQualifier): MagasinContact
  1231.     {
  1232.         $newContact = new MagasinContact();
  1233.         $newContact->setQualifier($magasinContactQualifier);
  1234.         $newContact->setMagasin($this);
  1235.         return $newContact;
  1236.     }
  1237.     // Vérifie si l'adhérent lié au moins 1 contact à un canal précis
  1238.     public function hasActiveContactCanal(string $canalIdentifier): bool
  1239.     {
  1240.         foreach ($this->magasinContacts as $magasinContact) {
  1241.             foreach ($magasinContact->getCanaux() as $canal) {
  1242.                 if ($canal->getIdentifier() === $canalIdentifier) {
  1243.                     return true;
  1244.                 }
  1245.             }
  1246.         }
  1247.         return false;
  1248.     }
  1249.     public function getSocialsMediaUrls()
  1250.     {
  1251.         $data = [];
  1252.         foreach ($this->magasinUrl as $magUrl) {
  1253.             if (in_array($magUrl->getType(), ['facebook''instagram''linkedin''snapchat''tiktok''twitter''whatsapp''youtube'])) {
  1254.                 $data[$magUrl->getType()] = $magUrl;
  1255.             }
  1256.         }
  1257.         return $data;
  1258.     }
  1259.     /**
  1260.      * @return Collection<int, ImagePartner>
  1261.      */
  1262.     public function getImagePartners(): Collection
  1263.     {
  1264.         return $this->imagePartners;
  1265.     }
  1266.     public function addImagePartner(ImagePartner $imagePartner): static
  1267.     {
  1268.         if (!$this->imagePartners->contains($imagePartner)) {
  1269.             $this->imagePartners->add($imagePartner);
  1270.             $imagePartner->setMagasin($this);
  1271.         }
  1272.         return $this;
  1273.     }
  1274.     public function removeImagePartner(ImagePartner $imagePartner): static
  1275.     {
  1276.         if ($this->imagePartners->removeElement($imagePartner)) {
  1277.             // set the owning side to null (unless already changed)
  1278.             if ($imagePartner->getMagasin() === $this) {
  1279.                 $imagePartner->setMagasin(null);
  1280.             }
  1281.         }
  1282.         return $this;
  1283.     }
  1284.     /**
  1285.      * @return Collection<int, KpiParameters>
  1286.      */
  1287.     public function getExercices(): Collection
  1288.     {
  1289.         return $this->exercices;
  1290.     }
  1291.     public function addExercice(KpiParameters $exercice): self
  1292.     {
  1293.         if (!$this->exercices->contains($exercice)) {
  1294.             $this->exercices->add($exercice);
  1295.             $exercice->setMagasin($this);
  1296.         }
  1297.         return $this;
  1298.     }
  1299.     public function removeExercice(KpiParameters $exercice): self
  1300.     {
  1301.         if ($this->exercices->removeElement($exercice)) {
  1302.             if ($exercice->getMagasin() === $this) {
  1303.                 $exercice->setMagasin(null);
  1304.             }
  1305.         }
  1306.         return $this;
  1307.     }
  1308.     /**
  1309.      * @return Collection<int, KpiObjectifs>
  1310.      */
  1311.     public function getKpiObjectifs(): Collection
  1312.     {
  1313.         return $this->kpiObjectifs;
  1314.     }
  1315.     public function getExerciceEnCours(): ?KpiParameters
  1316.     {
  1317.         foreach ($this->exercices as $param) {
  1318.             if ($param->getStatus() === 'EN_COURS') {
  1319.                 return $param;
  1320.             }
  1321.         }
  1322.         return null;
  1323.     }
  1324.     public function getExercicePrecedent(): ?KpiParameters
  1325.     {
  1326.         foreach ($this->exercices as $param) {
  1327.             if ($param->getStatus() === 'TERMINE') {
  1328.                 return $param;
  1329.             }
  1330.         }
  1331.         return null;
  1332.     }
  1333.     public function getObjectifsExerciceEnCours(): ?KpiObjectifs
  1334.     {
  1335.         foreach ($this->exercices as $param) {
  1336.             if ($param->getStatus() === 'EN_COURS') {
  1337.                 return $param->getObjectifs();
  1338.             }
  1339.         }
  1340.         return null;
  1341.     }
  1342.     public function getObjectifsExercicePrecedent(): ?KpiObjectifs
  1343.     {
  1344.         foreach ($this->exercices as $param) {
  1345.             if ($param->getStatus() === 'TERMINE') {
  1346.                 return $param->getObjectifs();
  1347.             }
  1348.         }
  1349.         return null;
  1350.     }
  1351.     public function getCrmSettings(): ?CrmSettings
  1352.     {
  1353.         return $this->crmSettings;
  1354.     }
  1355.     public function setCrmSettings(?CrmSettings $crmSettings): static
  1356.     {
  1357.         // unset the owning side of the relation if necessary
  1358.         if ($crmSettings === null && $this->crmSettings !== null) {
  1359.             $this->crmSettings->setMagasin(null);
  1360.         }
  1361.         // set the owning side of the relation if necessary
  1362.         if ($crmSettings !== null && $crmSettings->getMagasin() !== $this) {
  1363.             $crmSettings->setMagasin($this);
  1364.         }
  1365.         $this->crmSettings $crmSettings;
  1366.         return $this;
  1367.     }
  1368.     /**
  1369.      * @return Collection<int, CrmResponseIa>
  1370.      */
  1371.     public function getCrmResponseIas(): Collection
  1372.     {
  1373.         return $this->crmResponseIas;
  1374.     }
  1375.     public function addCrmResponseIa(CrmResponseIa $crmResponseIa): static
  1376.     {
  1377.         if (!$this->crmResponseIas->contains($crmResponseIa)) {
  1378.             $this->crmResponseIas->add($crmResponseIa);
  1379.             $crmResponseIa->setMagasin($this);
  1380.         }
  1381.         return $this;
  1382.     }
  1383.     public function removeCrmResponseIa(CrmResponseIa $crmResponseIa): static
  1384.     {
  1385.         if ($this->crmResponseIas->removeElement($crmResponseIa)) {
  1386.             // set the owning side to null (unless already changed)
  1387.             if ($crmResponseIa->getMagasin() === $this) {
  1388.                 $crmResponseIa->setMagasin(null);
  1389.             }
  1390.         }
  1391.         return $this;
  1392.     }
  1393. }