<?php
namespace App\Entity\Adherent;
use App\Entity\Adherent\Annuaire\MagasinContact;
use App\Entity\Adherent\Annuaire\MagasinContactQualifier;
use App\Entity\Alertes\MagasinMarquesAlertes;
use App\Entity\Crm\CrmResponseIa;
use App\Entity\Crm\CrmSettings;
use App\Entity\EvenementsGroupeAll\AvisEvenement;
use App\Entity\ImagePartner;
use App\Entity\Kpi\KpiObjectifs;
use App\Entity\Kpi\KpiParameters;
use App\Entity\Retrocession\Annonce;
use App\Entity\VenteRechercheMagasins\VenteRechercheMagasinsAlertes;
use App\Entity\Webfactory\Navigation;
use App\Entity\Webfactory\Page\PageAbstract;
use App\Entity\Webfactory\SeoVilles;
use App\Entity\Webfactory\Widget\Createur\Faq;
use App\Entity\Webfactory\Widget\WidgetAbstract;
use App\Entity\Webfactory\Widget\WidgetContent;
use App\Repository\Adherent\MagasinRepository;
use DateTimeImmutable;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Stringable;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Table(name: 'magasin')]
#[ORM\Index(columns: ['k_adherent'], name: 'k_adherent')]
#[ORM\Index(columns: ['k_mag'], name: 'k_mag')]
#[ORM\Entity(repositoryClass: MagasinRepository::class)]
#[ORM\HasLifecycleCallbacks]
class Magasin implements Stringable
{
#[ORM\Id]
#[ORM\GeneratedValue('NONE')]
#[ORM\Column(type: 'string', length: 255)]
#[Groups(groups: ['contact_history'])]
private string $k_adherent;
/**
* Unique = false car un adhérent peut faire une reprise de magasin
*/
#[ORM\Column(type: 'string', length: 255, unique: false)]
private string $k_mag;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $siret;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $siren;
#[ORM\Column(type: 'string', length: 255)]
private ?string $lib;
#[ORM\Column(type: 'string', length: 255)]
private ?string $k_pays;
#[ORM\Column(type: 'string', length: 255)]
private ?string $k_langue;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $lat;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $lon;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $k_user_suivi;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $k_logiciel;
#[ORM\Column(type: 'datetime_immutable')]
private DateTimeImmutable $createdAt;
#[ORM\Column(type: 'boolean')]
private ?bool $updated;
#[ORM\Column(type: 'boolean', nullable: true)]
private ?bool $deleted;
#[ORM\Column(type: 'datetime_immutable', nullable: true)]
private ?DateTimeImmutable $deletedAt;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: MagasinCoordonnees::class)]
private $magasinCoordonnees;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: MagasinHoraires::class)]
private $magasinHoraires;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: MagasinHorairesExceptionnelles::class)]
private $magasinHorairesExceptionnelles;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $ADH_MM;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $K_NIVEAUADH;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $K_TYPE_CLIENT;
#[ORM\Column(type: 'boolean', nullable: true)]
private ?bool $L_BLACKLIST;
#[ORM\OneToMany(mappedBy: 'k_adherent', targetEntity: MagasinConviction::class)]
private $magasinConvictions;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $user_rs;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $user_cpv;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $user_adv;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $user_achat;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $user_paiement;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $user_op;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $user_cpv_conf;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $ADH_SITE_WEB; // plus utilisé, se trouve dans magasin_url -> type = siteweb
#[ORM\Column(name: 'adh_crm', type: 'string', length: 11, nullable: true)]
private ?string $adhCrm = null;
#[ORM\JoinTable(name: 'magasin_services')]
#[ORM\JoinColumn(name: 'k_adherent', referencedColumnName: 'k_adherent')]
#[ORM\InverseJoinColumn(name: 'service_id', referencedColumnName: 'id')]
#[ORM\ManyToMany(targetEntity: Service::class, inversedBy: 'magasins')]
private $services;
#[ORM\JoinTable(name: 'magasin_specialites')]
#[ORM\JoinColumn(name: 'k_adherent', referencedColumnName: 'k_adherent')]
#[ORM\InverseJoinColumn(name: 'specialite_id', referencedColumnName: 'id')]
#[ORM\ManyToMany(targetEntity: Specialite::class, inversedBy: 'magasins')]
private $specialites;
/**
* @var Complement[]
*/
#[ORM\JoinTable(name: 'magasin_complements')]
#[ORM\JoinColumn(name: 'k_adherent', referencedColumnName: 'k_adherent')]
#[ORM\InverseJoinColumn(name: 'complement_id', referencedColumnName: 'id')]
#[ORM\ManyToMany(targetEntity: Complement::class, inversedBy: 'magasins')]
private $complements;
/**
* @var OperateursRemboursement[]
*/
#[ORM\JoinTable(name: 'magasin_operateurs')]
#[ORM\JoinColumn(name: 'k_adherent', referencedColumnName: 'k_adherent')]
#[ORM\InverseJoinColumn(name: 'operateur_id', referencedColumnName: 'id')]
#[ORM\ManyToMany(targetEntity: OperateursRemboursement::class, inversedBy: 'magasins')]
private $operateursRemboursement;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: WidgetAbstract::class)]
private $widgetAbstracts;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: PageAbstract::class)]
private $pageAbstracts;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: MagasinCollaborateurs::class)]
private $magasinCollaborateurs;
#[ORM\OneToOne(mappedBy: 'magasin', targetEntity: MagasinEquipe::class)]
private mixed $magasinEquipe;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: MagasinMarques::class)]
private $magasinMarques;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: Navigation::class)]
private $navigations;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: MagasinUrl::class)]
private $magasinUrl;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: MagasinJuridique::class)]
private $magasinJuridiques;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private mixed $adhMmStat;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: MagasinContact::class, cascade: ['persist', 'remove'])]
private $magasinContacts;
#[ORM\Column(type: 'boolean')]
private mixed $packOpc;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private mixed $centrale;
#[ORM\OneToMany(mappedBy: 'adherent', targetEntity: Annonce::class)]
private $annonces;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: MagasinAlert::class)]
private Collection $magasinAlerts;
#[ORM\Column(type: 'boolean', nullable: false)]
private bool $wantFacturationPapier = false;
#[ORM\Column(type: 'boolean', nullable: false)]
private bool $avisGmbActive = false;
#[ORM\Column(type: 'boolean')]
private bool $affAvisCrmOpc = false; // Affichage des avis CRM sur OPC
#[ORM\OneToMany(mappedBy: 'k_adherent', targetEntity: MagasinMarquesAlertes::class)]
private Collection $magasinMarquesAlertes;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: VenteRechercheMagasinsAlertes::class)]
private Collection $venteRechercheMagasinsAlertes;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: MagasinConsentements::class)]
private Collection $consentements;
#[ORM\OneToMany(mappedBy: 'k_adh', targetEntity: AvisEvenement::class)]
private Collection $avis35ans;
# J'accepte que mes services, spécialités et informations complémentaires soient visibles sur les différentes plateformes web du Groupe all.
#[ORM\Column(type: 'boolean')]
private mixed $consentServSpecInfoComple;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: MagasinReseaux::class, cascade: ['persist', 'remove'])]
private $magasinReseaux;
#[ORM\Column(type: 'text', nullable: true)]
private mixed $convictionFr;
#[ORM\Column(type: 'text', nullable: true)]
private mixed $convictionNl;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: SeoVilles::class)]
private Collection $seoVilles;
#[ORM\OneToMany(mappedBy: 'adherent', targetEntity: Faq::class)]
private Collection $faqs;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: ImagePartner::class)]
private Collection $imagePartners;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: KpiParameters::class, cascade: ['persist', 'remove'])]
private Collection $exercices;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: KpiObjectifs::class, cascade: ['persist', 'remove'])]
private Collection $kpiObjectifs;
#[ORM\OneToOne(mappedBy: 'magasin', cascade: ['persist', 'remove'])]
private ?CrmSettings $crmSettings = null;
#[ORM\OneToMany(mappedBy: 'magasin', targetEntity: CrmResponseIa::class)]
private Collection $crmResponseIas;
public function __construct()
{
$this->createdAt = new DateTimeImmutable('now');
$this->magasinCoordonnees = new ArrayCollection();
$this->magasinHoraires = new ArrayCollection();
$this->magasinHorairesExceptionnelles = new ArrayCollection();
$this->magasinConvictions = new ArrayCollection();
$this->services = new ArrayCollection();
$this->specialites = new ArrayCollection();
$this->complements = new ArrayCollection();
$this->operateursRemboursement = new ArrayCollection();
$this->widgetAbstracts = new ArrayCollection();
$this->pageAbstracts = new ArrayCollection();
$this->magasinCollaborateurs = new ArrayCollection();
$this->magasinMarques = new ArrayCollection();
$this->navigations = new ArrayCollection();
$this->magasinJuridiques = new ArrayCollection();
$this->magasinContacts = new ArrayCollection();
$this->annonces = new ArrayCollection();
$this->magasinAlerts = new ArrayCollection();
$this->magasinMarquesAlertes = new ArrayCollection();
$this->consentements = new ArrayCollection();
$this->avis35ans = new ArrayCollection();
$this->magasinReseaux = new ArrayCollection();
$this->consentServSpecInfoComple = false;
$this->seoVilles = new ArrayCollection();
$this->lang = new ArrayCollection();
$this->crmResponseIas = new ArrayCollection();
$this->exercices = new ArrayCollection();
$this->kpiObjectifs = new ArrayCollection();
}
public function __toString(): string
{
return ($this->k_adherent . ' - ' . $this->getLib());
}
public function setKAdherent($adherent)
{
$this->k_adherent = $adherent;
return $this;
}
public function getKAdherent(): ?string
{
return $this->k_adherent;
}
public function getKMag(): ?string
{
return $this->k_mag;
}
public function setKMag(string $k_mag): self
{
$this->k_mag = $k_mag;
return $this;
}
public function getSiret(): ?string
{
return $this->siret;
}
public function setSiret(?string $siret): self
{
$this->siret = $siret;
return $this;
}
public function getSiren(): ?string
{
return $this->siren;
}
public function setSiren(?string $siren): self
{
$this->siren = $siren;
return $this;
}
public function getLib(): ?string
{
return $this->lib;
}
public function setLib(string $lib): self
{
$this->lib = $lib;
return $this;
}
public function getKPays(): ?string
{
return $this->k_pays;
}
public function setKPays(string $k_pays): self
{
$this->k_pays = $k_pays;
return $this;
}
public function getKLangue(): ?string
{
return $this->k_langue;
}
public function setKLangue(string $k_langue): self
{
$this->k_langue = $k_langue;
return $this;
}
public function getLat(): ?string
{
return $this->lat;
}
public function setLat(?string $lat): self
{
$this->lat = $lat;
return $this;
}
public function getLon(): ?string
{
return $this->lon;
}
public function setLon(?string $lon): self
{
$this->lon = $lon;
return $this;
}
public function getKUserSuivi(): ?string
{
return $this->k_user_suivi;
}
public function setKUserSuivi(?string $k_user_suivi): self
{
$this->k_user_suivi = $k_user_suivi;
return $this;
}
public function getKLogiciel(): ?string
{
return $this->k_logiciel;
}
public function setKLogiciel(?string $k_logiciel): self
{
$this->k_logiciel = $k_logiciel;
return $this;
}
public function getCreatedAt(): ?DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdated(): ?bool
{
return $this->updated;
}
public function setUpdated(bool $updated): self
{
$this->updated = $updated;
return $this;
}
public function getDeleted(): ?bool
{
return $this->deleted;
}
public function setDeleted(?bool $deleted): self
{
$this->deleted = $deleted;
return $this;
}
public function getDeletedAt(): ?DateTimeImmutable
{
return $this->deletedAt;
}
public function setDeletedAt(?DateTimeImmutable $deletedAt): self
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getADHMM(): ?string
{
return $this->ADH_MM;
}
public function setADHMM(?string $ADH_MM): self
{
$this->ADH_MM = $ADH_MM;
return $this;
}
public function getKNIVEAUADH(): ?string
{
return $this->K_NIVEAUADH;
}
public function setKNIVEAUADH(?string $K_NIVEAUADH): self
{
$this->K_NIVEAUADH = $K_NIVEAUADH;
return $this;
}
public function getKTYPECLIENT(): ?string
{
return $this->K_TYPE_CLIENT;
}
public function setKTYPECLIENT(?string $K_TYPE_CLIENT): self
{
$this->K_TYPE_CLIENT = $K_TYPE_CLIENT;
return $this;
}
public function getLBLACKLIST(): ?bool
{
return $this->L_BLACKLIST;
}
public function setLBLACKLIST(?bool $L_BLACKLIST): self
{
$this->L_BLACKLIST = $L_BLACKLIST;
return $this;
}
public function getUserRs(): ?string
{
return $this->user_rs;
}
public function setUserRs(?string $user_rs): self
{
$this->user_rs = $user_rs;
return $this;
}
public function getUserCpv(): ?string
{
return $this->user_cpv;
}
public function setUserCpv(?string $user_cpv): self
{
$this->user_cpv = $user_cpv;
return $this;
}
public function getUserAdv(): ?string
{
return $this->user_adv;
}
public function setUserAdv(?string $user_adv): self
{
$this->user_adv = $user_adv;
return $this;
}
public function getUserAchat(): ?string
{
return $this->user_achat;
}
public function setUserAchat(?string $user_achat): self
{
$this->user_achat = $user_achat;
return $this;
}
public function getUserPaiement(): ?string
{
return $this->user_paiement;
}
public function setUserPaiement(?string $user_paiement): self
{
$this->user_paiement = $user_paiement;
return $this;
}
public function getUserOp(): ?string
{
return $this->user_op;
}
public function setUserOp(?string $user_op): self
{
$this->user_op = $user_op;
return $this;
}
public function getUserCpvConf(): ?string
{
return $this->user_cpv_conf;
}
public function setUserCpvConf(?string $user_cpv_conf): self
{
$this->user_cpv_conf = $user_cpv_conf;
return $this;
}
public function getADHSITEWEB(): ?string
{
return $this->ADH_SITE_WEB;
}
public function setADHSITEWEB(?string $ADH_SITE_WEB): self
{
$this->ADH_SITE_WEB = $ADH_SITE_WEB;
return $this;
}
public function getMagasinCoordonnees($type = null)
{
// Retourne directement le type d'adresse souhaité
$allow = ['MARKETING', 'MAGASIN', 'SIEGE'];
if (!is_null($type)) {
$adresse = [];
if (in_array($type, $allow)) {
foreach ($this->magasinCoordonnees as $adresse) {
if ($adresse->getType() == strtoupper((string)$type)) {
return $adresse;
}
}
return $adresse;
} else {
return null;
}
return null;
}
// Sinon on retourne toute la collection
return $this->magasinCoordonnees;
}
public function addMagasinCoordonnee(MagasinCoordonnees $magasinCoordonnee): self
{
if (!$this->magasinCoordonnees->contains($magasinCoordonnee)) {
$this->magasinCoordonnees[] = $magasinCoordonnee;
$magasinCoordonnee->setMagasin($this);
}
return $this;
}
public function removeMagasinCoordonnee(MagasinCoordonnees $magasinCoordonnee): self
{
if ($this->magasinCoordonnees->removeElement($magasinCoordonnee)) {
// set the owning side to null (unless already changed)
if ($magasinCoordonnee->getMagasin() === $this) {
$magasinCoordonnee->setMagasin(null);
}
}
return $this;
}
public function getMagasinHoraires(): Collection
{
return $this->magasinHoraires;
}
public function addMagasinHoraire(MagasinHoraires $magasinHoraire): self
{
if (!$this->magasinHoraires->contains($magasinHoraire)) {
$this->magasinHoraires[] = $magasinHoraire;
$magasinHoraire->setMagasin($this);
}
return $this;
}
public function removeMagasinHoraire(MagasinHoraires $magasinHoraire): self
{
if ($this->magasinHoraires->removeElement($magasinHoraire)) {
// set the owning side to null (unless already changed)
if ($magasinHoraire->getMagasin() === $this) {
$magasinHoraire->setMagasin(null);
}
}
return $this;
}
public function getMagasinHorairesExceptionnelles(): Collection
{
return $this->magasinHorairesExceptionnelles;
}
public function addMagasinHorairesExceptionnelle(MagasinHorairesExceptionnelles $magasinHorairesExceptionnelle): self
{
if (!$this->magasinHorairesExceptionnelles->contains($magasinHorairesExceptionnelle)) {
$this->magasinHorairesExceptionnelles[] = $magasinHorairesExceptionnelle;
$magasinHorairesExceptionnelle->setMagasin($this);
}
return $this;
}
public function removeMagasinHorairesExceptionnelle(MagasinHorairesExceptionnelles $magasinHorairesExceptionnelle): self
{
if ($this->magasinHorairesExceptionnelles->removeElement($magasinHorairesExceptionnelle)) {
// set the owning side to null (unless already changed)
if ($magasinHorairesExceptionnelle->getMagasin() === $this) {
$magasinHorairesExceptionnelle->setMagasin(null);
}
}
return $this;
}
public
function getMagasinConvictions(): Collection
{
return $this->magasinConvictions;
}
public
function addMagasinConviction(MagasinConviction $magasinConviction): self
{
if (!$this->magasinConvictions->contains($magasinConviction)) {
$this->magasinConvictions[] = $magasinConviction;
$magasinConviction->setKAdherent($this);
}
return $this;
}
public
function removeMagasinConviction(MagasinConviction $magasinConviction): self
{
if ($this->magasinConvictions->removeElement($magasinConviction)) {
// set the owning side to null (unless already changed)
if ($magasinConviction->getKAdherent() === $this) {
$magasinConviction->setKAdherent(null);
}
}
return $this;
}
public
function getServices(): Collection
{
return $this->services;
}
public
function addService(Service $service): self
{
if (!$this->services->contains($service)) {
$this->services[] = $service;
}
return $this;
}
public
function removeService(Service $service): self
{
$this->services->removeElement($service);
return $this;
}
public
function getSpecialites(): Collection
{
return $this->specialites;
}
public
function addSpecialite(Specialite $specialite): self
{
if (!$this->specialites->contains($specialite)) {
$this->specialites[] = $specialite;
}
return $this;
}
public
function removeSpecialite(Specialite $specialite): self
{
$this->specialites->removeElement($specialite);
return $this;
}
public function getComplements($type = null): Collection|array
{
if (!is_null($type)) {
$datas = [];
foreach ($this->complements as $complement) {
if ($complement->getType() == $type) {
$datas[] = $complement;
}
}
return $datas;
}
return $this->complements;
}
public
function addComplement(Complement $complement): self
{
if (!$this->complements->contains($complement)) {
$this->complements[] = $complement;
}
return $this;
}
public
function removeComplement(Complement $complement): self
{
$this->complements->removeElement($complement);
return $this;
}
public
function getOperateursRemboursement(): Collection
{
return $this->operateursRemboursement;
}
public
function addOperateursRemboursement(OperateursRemboursement $operateursRemboursement): self
{
if (!$this->operateursRemboursement->contains($operateursRemboursement)) {
$this->operateursRemboursement[] = $operateursRemboursement;
}
return $this;
}
public
function removeOperateursRemboursement(OperateursRemboursement $operateursRemboursement): self
{
$this->operateursRemboursement->removeElement($operateursRemboursement);
return $this;
}
public
function getWidgetAbstracts(): Collection
{
return $this->widgetAbstracts;
}
public
function addWidgetAbstract(WidgetAbstract $widgetAbstract): self
{
if (!$this->widgetAbstracts->contains($widgetAbstract)) {
$this->widgetAbstracts[] = $widgetAbstract;
$widgetAbstract->setMagasin($this);
}
return $this;
}
public
function removeWidgetAbstract(WidgetAbstract $widgetAbstract): self
{
if ($this->widgetAbstracts->removeElement($widgetAbstract)) {
// set the owning side to null (unless already changed)
if ($widgetAbstract->getMagasin() === $this) {
$widgetAbstract->setMagasin(null);
}
}
return $this;
}
public
function getPageAbstracts(): Collection
{
return $this->pageAbstracts;
}
public
function addPageAbstract(PageAbstract $pageAbstract): self
{
if (!$this->pageAbstracts->contains($pageAbstract)) {
$this->pageAbstracts[] = $pageAbstract;
$pageAbstract->setMagasin($this);
}
return $this;
}
public
function removePageAbstract(PageAbstract $pageAbstract): self
{
if ($this->pageAbstracts->removeElement($pageAbstract)) {
// set the owning side to null (unless already changed)
if ($pageAbstract->getMagasin() === $this) {
$pageAbstract->setMagasin(null);
}
}
return $this;
}
public
function getMagasinCollaborateurs(): Collection
{
return $this->magasinCollaborateurs;
}
public
function addMagasinCollaborateur(MagasinCollaborateurs $magasinCollaborateur): self
{
if (!$this->magasinCollaborateurs->contains($magasinCollaborateur)) {
$this->magasinCollaborateurs[] = $magasinCollaborateur;
$magasinCollaborateur->setMagasin($this);
}
return $this;
}
public
function removeMagasinCollaborateur(MagasinCollaborateurs $magasinCollaborateur): self
{
if ($this->magasinCollaborateurs->removeElement($magasinCollaborateur)) {
// set the owning side to null (unless already changed)
if ($magasinCollaborateur->getMagasin() === $this) {
$magasinCollaborateur->setMagasin(null);
}
}
return $this;
}
public
function getMagasinEquipe()
{
return $this->magasinEquipe;
}
public
function setMagasinEquipe(mixed $magasinEquipe): void
{
$this->magasinEquipe = $magasinEquipe;
}
public
function getMagasinMarques(): Collection
{
return $this->magasinMarques;
}
public
function addMagasinMarque(MagasinMarques $magasinMarque): self
{
if (!$this->magasinMarques->contains($magasinMarque)) {
$this->magasinMarques[] = $magasinMarque;
$magasinMarque->setMagasin($this);
}
return $this;
}
public
function removeMagasinMarque(MagasinMarques $magasinMarque): self
{
if ($this->magasinMarques->removeElement($magasinMarque)) {
// set the owning side to null (unless already changed)
if ($magasinMarque->getMagasin() === $this) {
$magasinMarque->setMagasin(null);
}
}
return $this;
}
public
function getNavigations(): Collection
{
return $this->navigations;
}
public
function addNavigation(Navigation $navigation): self
{
if (!$this->navigations->contains($navigation)) {
$this->navigations[] = $navigation;
$navigation->setMagasin($this);
}
return $this;
}
public
function removeNavigation(Navigation $navigation): self
{
if ($this->navigations->removeElement($navigation)) {
// set the owning side to null (unless already changed)
if ($navigation->getMagasin() === $this) {
$navigation->setMagasin(null);
}
}
return $this;
}
public function getMagasinUrl($type = null)
{
if (!is_null($type)) {
foreach ($this->magasinUrl as $url) {
if ($url->getType() == $type) {
return $url;
}
}
return null;
} else {
return $this->magasinUrl;
}
}
public function addMagasinUrl(MagasinUrl $magasinUrl): self
{
if (!$this->magasinUrl->contains($magasinUrl)) {
$this->magasinUrl[] = $magasinUrl;
$magasinUrl->setMagasin($this);
}
return $this;
}
public function removeMagasinUrl(MagasinUrl $magasinUrl): self
{
if ($this->magasinUrl->removeElement($magasinUrl)) {
// set the owning side to null (unless already changed)
if ($magasinUrl->getMagasin() === $this) {
$magasinUrl->setMagasin(null);
}
}
return $this;
}
public function getMagasinJuridiques(): Collection
{
return $this->magasinJuridiques;
}
public
function addMagasinJuridique(MagasinJuridique $magasinJuridique): self
{
if (!$this->magasinJuridiques->contains($magasinJuridique)) {
$this->magasinJuridiques[] = $magasinJuridique;
$magasinJuridique->setMagasin($this);
}
return $this;
}
public
function removeMagasinJuridique(MagasinJuridique $magasinJuridique): self
{
if ($this->magasinJuridiques->removeElement($magasinJuridique)) {
// set the owning side to null (unless already changed)
if ($magasinJuridique->getMagasin() === $this) {
$magasinJuridique->setMagasin(null);
}
}
return $this;
}
public
function getAdhMmStat()
{
return $this->adhMmStat;
}
public
function setAdhMmStat(mixed $adhMmStat): void
{
$this->adhMmStat = $adhMmStat;
}
public
function getMagasinContacts(MagasinContactQualifier $qualifier = null, $principal = false): Collection
{
if (!is_null($qualifier)) {
$data = new ArrayCollection();
foreach ($this->magasinContacts as $contact) {
if ($contact->getQualifier() === $qualifier && $contact->isPrincipal() === $principal) {
$data->add($contact);
}
}
return $data;
}
return $this->magasinContacts;
}
public function hasMagasinContact(MagasinContact $contact, MagasinContactQualifier $qualifier): bool
{
return array_reduce($this->magasinContacts->toArray(), fn($carry, $magContact) => $carry || ($contact !== $magContact && $magContact->getQualifier() === $qualifier), false);
}
public function allowExistMagasinContact(MagasinContact $contact): bool
{
return array_reduce($this->magasinContacts->toArray(), fn($carry, $magContact) => $carry || ($contact !== $magContact && $contact->getValue() === $magContact->getValue() && $magContact->getQualifier() === $contact->getQualifier()), false);
}
public function getSpecificMagContact(MagasinContactQualifier $qualifier, bool|null $principal = null, $initialize = false)
{
foreach ($this->magasinContacts as $contact) {
if ($contact->getQualifier() === $qualifier && (!is_bool($principal) || $contact->isPrincipal() === $principal)) {
return $contact;
}
}
if ($initialize) {
$contact = new MagasinContact();
$contact->setQualifier($qualifier);
$contact->setMagasin($this);
$contact->setName($qualifier->getLabel());
if (is_bool($principal)) {
$contact->setPrincipal($principal);
}
return $contact;
}
return null;
}
public
function addMagasinContact(MagasinContact $magasinContact): self
{
if (!$this->magasinContacts->contains($magasinContact)) {
$this->magasinContacts[] = $magasinContact;
$magasinContact->setMagasin($this);
}
return $this;
}
public
function removeMagasinContact(MagasinContact $magasinContact): self
{
if ($this->magasinContacts->removeElement($magasinContact)) {
// set the owning side to null (unless already changed)
if ($magasinContact->getMagasin() === $this) {
$magasinContact->setMagasin(null);
}
}
return $this;
}
public
function setAdhCrm($adhCrm = null)
{
$this->adhCrm = $adhCrm;
return $this;
}
public
function getAdhCrm()
{
return $this->adhCrm;
}
public function getPackOpc()
{
return $this->packOpc;
}
public function setPackOpc($packOpc): void
{
$this->packOpc = $packOpc;
}
public function getAnnonces(): Collection
{
return $this->annonces;
}
public function addAnnonce(Annonce $annonce): self
{
if (!$this->annonces->contains($annonce)) {
$this->annonces[] = $annonce;
$annonce->setAdherent($this);
}
return $this;
}
public function removeAnnonce(Annonce $annonce): self
{
if ($this->annonces->removeElement($annonce)) {
// set the owning side to null (unless already changed)
if ($annonce->getAdherent() === $this) {
$annonce->setAdherent(null);
}
}
return $this;
}
public function getMagasinAlert($type)
{
$magasinAlert = [];
$datas = $this->magasinAlerts->toArray();
foreach ($datas as $data) {
if ($data->getType() == $type)
$magasinAlert[] = $data;
}
return current($magasinAlert);
}
public function addMagasinAlert(MagasinAlert $magasinAlert): self
{
if (!$this->magasinAlerts->contains($magasinAlert)) {
$this->magasinAlerts->add($magasinAlert);
$magasinAlert->setMagasin($this);
}
return $this;
}
public function getConsentements(): Collection
{
return $this->consentements;
}
public function addConsentement(MagasinConsentements $consentement): self
{
if (!$this->consentements->contains($consentement)) {
$this->consentements->add($consentement);
$consentement->setMagasin($this);
}
return $this;
}
public function removeMagasinAlert(MagasinAlert $magasinAlert): self
{
if ($this->magasinAlerts->removeElement($magasinAlert)) {
// set the owning side to null (unless already changed)
if ($magasinAlert->getMagasin() === $this) {
$magasinAlert->setMagasin(null);
}
}
return $this;
}
public function getMagasinMarquesAlertes(): Collection
{
return $this->magasinMarquesAlertes;
}
public function addMagasinMarquesAlerte(MagasinMarquesAlertes $magasinMarquesAlerte): self
{
if (!$this->magasinMarquesAlertes->contains($magasinMarquesAlerte)) {
$this->magasinMarquesAlertes->add($magasinMarquesAlerte);
$magasinMarquesAlerte->setKAdherent($this);
}
return $this;
}
public function removeMagasinMarquesAlerte(MagasinMarquesAlertes $magasinMarquesAlerte): self
{
if ($this->magasinMarquesAlertes->removeElement($magasinMarquesAlerte)) {
// set the owning side to null (unless already changed)
if ($magasinMarquesAlerte->getKAdherent() === $this) {
$magasinMarquesAlerte->setKAdherent(null);
}
}
return $this;
}
public function getFirstMagasinContacts()
{
if (!empty($this->magasinContacts->toArray())) {
return $this->magasinContacts->toArray()[0];
}
return null;
}
public function getSpecificConsentement(string $type)
{
foreach ($this->consentements as $consentement) {
if (strtolower($consentement->getType()) === strtolower($type)) {
return $consentement;
}
}
return null;
}
public function removeConsentement(MagasinConsentements $consentement): self
{
if ($this->consentements->removeElement($consentement)) {
// set the owning side to null (unless already changed)
if ($consentement->getMagasin() === $this) {
$consentement->setMagasin(null);
}
}
return $this;
}
public function getAvis35ans(): Collection
{
return $this->avis35ans;
}
public function addAvis35an(AvisEvenement $avis35an): static
{
if (!$this->avis35ans->contains($avis35an)) {
$this->avis35ans->add($avis35an);
$avis35an->setKAdh($this);
}
return $this;
}
public function removeAvis35an(AvisEvenement $avis35an): static
{
if ($this->avis35ans->removeElement($avis35an)) {
// set the owning side to null (unless already changed)
if ($avis35an->getKAdh() === $this) {
$avis35an->setKAdh(null);
}
}
return $this;
}
public function getCentrale(): mixed
{
return $this->centrale;
}
public function setCentrale($centrale): void
{
$this->centrale = $centrale;
}
public function getConvictionFr(): mixed
{
return $this->convictionFr;
}
public function setConvictionFr($convictionFr): void
{
$this->convictionFr = $convictionFr;
}
public function getConvictionNl(): mixed
{
return $this->convictionNl;
}
public function setConvictionNl(mixed $convictionNl): void
{
$this->convictionNl = $convictionNl;
}
public function setConsentement($magasinConsentements): self
{
foreach ($magasinConsentements as $magasinConsentement) {
if (!$this->consentements->contains($magasinConsentement)) {
$this->consentements[] = $magasinConsentement;
$magasinConsentement->setMagasin($this);
}
}
return $this;
}
public function addMagasinReseau(MagasinReseaux $magasinReseau): self
{
if (!$this->magasinReseaux->contains($magasinReseau)) {
$this->magasinReseaux[] = $magasinReseau;
$magasinReseau->setMagasin($this);
}
return $this;
}
public function removeMagasinReseau(MagasinReseaux $magasinReseau): self
{
if ($this->magasinReseaux->removeElement($magasinReseau)) {
// set the owning side to null (unless already changed)
if ($magasinReseau->getMagasin() === $this) {
$magasinReseau->setMagasin(null);
}
}
return $this;
}
public function setMagasinReseaux($magasinReseaux): self
{
foreach ($magasinReseaux as $magasinReseau) {
if (!$this->magasinReseaux->contains($magasinReseau)) {
$this->magasinReseaux[] = $magasinReseau;
$magasinReseau->setMagasin($this);
}
}
return $this;
}
public function getMagasinReseaux(): Collection
{
return $this->magasinReseaux;
}
public function setConsentServSpecInfoComple($consentServSpecInfoComple): void
{
$this->consentServSpecInfoComple = $consentServSpecInfoComple;
}
public function getConsentServSpecInfoComple(): mixed
{
return $this->consentServSpecInfoComple;
}
/**
* @return Collection<int, SeoVilles>
*/
public function getSeoVilles(): Collection
{
return $this->seoVilles;
}
public function addSeoVille(SeoVilles $seoVille): static
{
if (!$this->seoVilles->contains($seoVille)) {
$this->seoVilles->add($seoVille);
$seoVille->setMagasin($this);
}
return $this;
}
public function removeSeoVille(SeoVilles $seoVille): static
{
if ($this->seoVilles->removeElement($seoVille)) {
// set the owning side to null (unless already changed)
if ($seoVille->getMagasin() === $this) {
$seoVille->setMagasin(null);
}
}
return $this;
}
public function getMagasinAlerts(): Collection
{
return $this->magasinAlerts;
}
public function setMagasinAlerts(Collection $magasinAlerts): void
{
$this->magasinAlerts = $magasinAlerts;
}
public function isWantFacturationPapier(): bool
{
return $this->wantFacturationPapier;
}
public function setWantFacturationPapier(bool $wantFacturationPapier): void
{
$this->wantFacturationPapier = $wantFacturationPapier;
}
public function isAvisGmbActive(): bool
{
return $this->avisGmbActive;
}
public function setAvisGmbActive(bool $avisGmbActive): void
{
$this->avisGmbActive = $avisGmbActive;
}
public function isAffAvisCrmOpc(): bool
{
return $this->affAvisCrmOpc;
}
public function setAffAvisCrmOpc(bool $affAvisCrmOpc): void
{
$this->affAvisCrmOpc = $affAvisCrmOpc;
}
public function getFaqs(): Collection
{
return $this->faqs;
}
public function setFaqs(Collection $faqs): void
{
$this->faqs = $faqs;
}
/**
* @return Collection
*/
public function getVenteRechercheMagasinsAlertes(): Collection
{
return $this->venteRechercheMagasinsAlertes;
}
/**
* @param Collection $venteRechercheMagasinsAlertes
*/
public function setVenteRechercheMagasinsAlertes(Collection $venteRechercheMagasinsAlertes): void
{
$this->venteRechercheMagasinsAlertes = $venteRechercheMagasinsAlertes;
}
public function initializeMagContact(MagasinContactQualifier $magasinContactQualifier): MagasinContact
{
$newContact = new MagasinContact();
$newContact->setQualifier($magasinContactQualifier);
$newContact->setMagasin($this);
return $newContact;
}
// Vérifie si l'adhérent lié au moins 1 contact à un canal précis
public function hasActiveContactCanal(string $canalIdentifier): bool
{
foreach ($this->magasinContacts as $magasinContact) {
foreach ($magasinContact->getCanaux() as $canal) {
if ($canal->getIdentifier() === $canalIdentifier) {
return true;
}
}
}
return false;
}
public function getSocialsMediaUrls()
{
$data = [];
foreach ($this->magasinUrl as $magUrl) {
if (in_array($magUrl->getType(), ['facebook', 'instagram', 'linkedin', 'snapchat', 'tiktok', 'twitter', 'whatsapp', 'youtube'])) {
$data[$magUrl->getType()] = $magUrl;
}
}
return $data;
}
/**
* @return Collection<int, ImagePartner>
*/
public function getImagePartners(): Collection
{
return $this->imagePartners;
}
public function addImagePartner(ImagePartner $imagePartner): static
{
if (!$this->imagePartners->contains($imagePartner)) {
$this->imagePartners->add($imagePartner);
$imagePartner->setMagasin($this);
}
return $this;
}
public function removeImagePartner(ImagePartner $imagePartner): static
{
if ($this->imagePartners->removeElement($imagePartner)) {
// set the owning side to null (unless already changed)
if ($imagePartner->getMagasin() === $this) {
$imagePartner->setMagasin(null);
}
}
return $this;
}
/**
* @return Collection<int, KpiParameters>
*/
public function getExercices(): Collection
{
return $this->exercices;
}
public function addExercice(KpiParameters $exercice): self
{
if (!$this->exercices->contains($exercice)) {
$this->exercices->add($exercice);
$exercice->setMagasin($this);
}
return $this;
}
public function removeExercice(KpiParameters $exercice): self
{
if ($this->exercices->removeElement($exercice)) {
if ($exercice->getMagasin() === $this) {
$exercice->setMagasin(null);
}
}
return $this;
}
/**
* @return Collection<int, KpiObjectifs>
*/
public function getKpiObjectifs(): Collection
{
return $this->kpiObjectifs;
}
public function getExerciceEnCours(): ?KpiParameters
{
foreach ($this->exercices as $param) {
if ($param->getStatus() === 'EN_COURS') {
return $param;
}
}
return null;
}
public function getExercicePrecedent(): ?KpiParameters
{
foreach ($this->exercices as $param) {
if ($param->getStatus() === 'TERMINE') {
return $param;
}
}
return null;
}
public function getObjectifsExerciceEnCours(): ?KpiObjectifs
{
foreach ($this->exercices as $param) {
if ($param->getStatus() === 'EN_COURS') {
return $param->getObjectifs();
}
}
return null;
}
public function getObjectifsExercicePrecedent(): ?KpiObjectifs
{
foreach ($this->exercices as $param) {
if ($param->getStatus() === 'TERMINE') {
return $param->getObjectifs();
}
}
return null;
}
public function getCrmSettings(): ?CrmSettings
{
return $this->crmSettings;
}
public function setCrmSettings(?CrmSettings $crmSettings): static
{
// unset the owning side of the relation if necessary
if ($crmSettings === null && $this->crmSettings !== null) {
$this->crmSettings->setMagasin(null);
}
// set the owning side of the relation if necessary
if ($crmSettings !== null && $crmSettings->getMagasin() !== $this) {
$crmSettings->setMagasin($this);
}
$this->crmSettings = $crmSettings;
return $this;
}
/**
* @return Collection<int, CrmResponseIa>
*/
public function getCrmResponseIas(): Collection
{
return $this->crmResponseIas;
}
public function addCrmResponseIa(CrmResponseIa $crmResponseIa): static
{
if (!$this->crmResponseIas->contains($crmResponseIa)) {
$this->crmResponseIas->add($crmResponseIa);
$crmResponseIa->setMagasin($this);
}
return $this;
}
public function removeCrmResponseIa(CrmResponseIa $crmResponseIa): static
{
if ($this->crmResponseIas->removeElement($crmResponseIa)) {
// set the owning side to null (unless already changed)
if ($crmResponseIa->getMagasin() === $this) {
$crmResponseIa->setMagasin(null);
}
}
return $this;
}
}