src/Entity/ReferencePublic.php line 33

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ReferencePublicRepository;
  4. use Cofondateur\SocleTechniqueBundle\Annotation\CrudField;
  5. use Cofondateur\SocleTechniqueBundle\Traits\SEOInterface;
  6. use Cofondateur\SocleTechniqueBundle\Traits\SEOTrait;
  7. use Cofondateur\SocleTechniqueBundle\Traits\SluggableInterface;
  8. use Cofondateur\SocleTechniqueBundle\Traits\SluggableTrait;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\Common\Collections\Collection;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Gedmo\Mapping\Annotation\ReferenceOne;
  13. use Symfony\Component\HttpFoundation\File\File;
  14. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  15. use Vich\UploaderBundle\Mapping\Annotation\Uploadable;
  16. use App\Form\ReferenceBlocFormType;
  17. use App\Form\ReferenceMediaFormType;
  18. use Cofondateur\SocleTechniqueBundle\Traits\SortableTrait;
  19. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  20. use Symfony\Component\Validator\Constraints as Assert;
  21. /**
  22.  * @ORM\Entity(repositoryClass=ReferencePublicRepository::class)
  23.  * @UniqueEntity(
  24.  *     fields={"slug"},
  25.  *     errorPath="slug",
  26.  *     message="Ce slug est déjà utilisé pour une autre référence publique"
  27.  * )
  28.  * @Uploadable()
  29.  */
  30. class ReferencePublic implements SEOInterfaceSluggableInterface
  31. {
  32.     
  33.     use SEOTrait;
  34.     use SortableTrait;    
  35.     use SluggableTrait;
  36.     
  37.     /**
  38.      * @ORM\Id
  39.      * @ORM\GeneratedValue
  40.      * @ORM\Column(type="integer")
  41.      */
  42.     private $id;
  43.     /**
  44.      * @ORM\Column(type="string", length=255)
  45.      * @CrudField(label="Titre", index=true)
  46.      */
  47.     private $title;
  48.     /**
  49.      * @ORM\Column(type="string")
  50.      */
  51.     private $coverName;
  52.     /**
  53.      * @ORM\Column(type="integer")
  54.      */
  55.     private $coverSize;
  56.     /**
  57.      * @ORM\Column(type="datetime", nullable=true)
  58.      */
  59.     private $coverUpdatedAt;
  60.     /**
  61.      * @Vich\UploadableField(mapping="default", fileNameProperty="coverName", size="coverSize")
  62.      * @CrudField(label="Visuel principal (bandeau top)")
  63.      */
  64.     private $coverFile;
  65.     /**
  66.      * @ORM\Column(type="string", nullable=true)
  67.      * @CrudField(label="Alt")
  68.      */
  69.     private $coverAlt;
  70.     /**
  71.      * @ORM\Column(type="string", length=255)
  72.      * @CrudField(index=true, label="Nom de l'entreprise")
  73.      */
  74.     private $firmName;
  75.     /**
  76.      * @ORM\ManyToOne(targetEntity=ReferenceCity::class, inversedBy="referencePublics")
  77.      * @ORM\JoinColumn(nullable=false)
  78.      * @CrudField(label="Ville")
  79.      */
  80.     private $city;
  81.     /**
  82.      * @ORM\Column(type="string", nullable=true)
  83.      */
  84.     private $logoName;
  85.     /**
  86.      * @ORM\Column(type="integer", nullable=true)
  87.      */
  88.     private $logoSize;
  89.     /**
  90.      * @ORM\Column(type="datetime", nullable=true)
  91.      */
  92.     private $logoUpdatedAt;
  93.     /**
  94.      * @Vich\UploadableField(mapping="default", fileNameProperty="logoName", size="logoSize")
  95.      * @CrudField(label="Logo")
  96.      */
  97.     private $logoFile;
  98.     /**
  99.      * @ORM\Column(type="string", nullable=true)
  100.      * @CrudField(label="Alt")
  101.      */
  102.     private $logoAlt;
  103.     /**
  104.      * @ORM\Column(type="text")
  105.      * @CrudField(label="Résumé")
  106.      */
  107.     private $resume;
  108.     /**
  109.      * @ORM\Column(type="string", length=255)
  110.      * @CrudField(tab="Introduction", label="Titre (mettre entre étoiles pour rendre le titre avec le surlignage Exemple : 'ceci est en bleu *ceci est surligné*')")
  111.      */
  112.     private $introTitle;
  113.     /**
  114.      * @ORM\Column(type="text")
  115.      * @CrudField(tab="Introduction", label="Paragraphe", ckeditor=true)
  116.      */
  117.     private $introParagraph;
  118.     /**
  119.      * @ORM\Column(type="string")
  120.      */
  121.     private $introVisuelPanoramiqueName;
  122.     /**
  123.      * @ORM\Column(type="integer")
  124.      */
  125.     private $introVisuelPanoramiqueSize;
  126.     /**
  127.      * @ORM\Column(type="datetime", nullable=true)
  128.      */
  129.     private $introVisuelPanoramiqueUpdatedAt;
  130.     /**
  131.      * @Vich\UploadableField(mapping="default", fileNameProperty="introVisuelPanoramiqueName", size="introVisuelPanoramiqueSize")
  132.      * @CrudField(tab="Introduction", label="Visuel panoramique (Poster de la vidéo si saisie)")
  133.      */
  134.     private $introVisuelPanoramiqueFile;
  135.     /**
  136.      * @ORM\Column(type="string", nullable=true)
  137.      * @CrudField(tab="Introduction", label="Alt")
  138.      */
  139.     private $introVisuelPanoramiqueAlt;
  140.     /**
  141.      * @ORM\Column(type="string", length=255, nullable=true)
  142.      * @CrudField(tab="Introduction", label="Url youtube")
  143.      */
  144.     private $introVideoUrl;
  145.     /**
  146.      * @ORM\Column(type="array")
  147.      * @CrudField(tab="En savoir plus", label="Secteurs")
  148.      */
  149.     private $moreSectors = [];
  150.     /**
  151.      * @ORM\Column(type="array")
  152.      * @CrudField(tab="En savoir plus", label="Expertises mobilisées")
  153.      */
  154.     private $moreExpertises = [];
  155.     /**
  156.      * @ORM\Column(type="string", length=255)
  157.      * @CrudField(tab="En savoir plus", label="Titre")
  158.      */
  159.     private $moreTitle;
  160.     /**
  161.      * @ORM\Column(type="text")
  162.      * @CrudField(tab="En savoir plus", label="Paragraphe", ckeditor=true)
  163.      */
  164.     private $moreParagraph;
  165.     /**
  166.      * @ORM\Column(type="string", length=255)
  167.      * @CrudField(tab="Section bleu", label="Sur-titre")
  168.      */
  169.     private $blueSubTitle;
  170.     /**
  171.      * @ORM\Column(type="string", length=255)
  172.      * @CrudField(tab="Section bleu", label="Titre (mettre entre étoiles pour rendre le titre avec le surlignage Exemple : 'ceci est en bleu *ceci est surligné*')")
  173.      */
  174.     private $blueTitle;
  175.     /**
  176.      * @ORM\Column(type="text")
  177.      * @CrudField(tab="Section bleu", label="Premier paragraphe", ckeditor=true)
  178.      */
  179.     private $blueParagraph1;
  180.     /**
  181.      * @ORM\Column(type="text", nullable=true)
  182.      * @CrudField(tab="Section bleu", label="Second paragraphe", ckeditor=true)
  183.      */
  184.     private $blueParagraph2;
  185.     /**
  186.      * @ORM\OneToMany(targetEntity=ReferenceBloc::class, mappedBy="referencePublic", cascade={"persist", "remove"})
  187.      * @CrudField(label="Blocs", formType=ReferenceBlocFormType::class, tab="Blocs")
  188.      */
  189.     private $blocs;
  190.     /**
  191.      * @ORM\Column(type="string", length=255, nullable=true)
  192.      * @CrudField(tab="Chiffres clés", label="Premier chiffre clé")
  193.      */
  194.     private $keyNumber1Number;
  195.     /**
  196.      * @ORM\Column(type="string", length=255, nullable=true)
  197.      * @CrudField(tab="Chiffres clés", label="Premier libellé")
  198.      */
  199.     private $keyNumber1Libelle;
  200.     /**
  201.      * @ORM\Column(type="string", length=255, nullable=true)
  202.      * @CrudField(tab="Chiffres clés", label="Second chiffre clé")
  203.      */
  204.     private $keyNumber2Number;
  205.     /**
  206.      * @ORM\Column(type="string", length=255, nullable=true)
  207.      * @CrudField(tab="Chiffres clés", label="Second libellé")
  208.      */
  209.     private $keyNumber2Libelle;
  210.     /**
  211.      * @ORM\Column(type="string", length=255, nullable=true)
  212.      * @CrudField(tab="Chiffres clés", label="Troisème chiffre clé")
  213.      */
  214.     private $keyNumber3Number;
  215.     /**
  216.      * @ORM\Column(type="string", length=255, nullable=true)
  217.      * @CrudField(tab="Chiffres clés", label="Troisième libellé")
  218.      */
  219.     private $keyNumber3Libelle;
  220.     /**
  221.      * @ORM\Column(type="string", length=255, nullable=true)
  222.      * @CrudField(tab="Chiffres clés", label="Quatrième chiffre clé")
  223.      */
  224.     private $keyNumber4Number;
  225.     /**
  226.      * @ORM\Column(type="string", length=255, nullable=true)
  227.      * @CrudField(tab="Chiffres clés", label="Quatrième libellé")
  228.      */
  229.     private $keyNumber4Libelle;
  230.     /**
  231.      * @ORM\OneToMany(targetEntity=ReferenceMedia::class, mappedBy="referencePublic", cascade={"persist", "remove"})
  232.      * @ORM\OrderBy({"position" = "ASC"})
  233.      * @CrudField(label="Galerie", formType=ReferenceMediaFormType::class, tab="Galerie")
  234.      */
  235.     private $referenceMedia;
  236.     /**
  237.      * @ORM\Column(type="string", length=255)
  238.      * @CrudField(tab="Contact", label="Titre")
  239.      */
  240.     private $contactTitle;
  241.     /**
  242.      * @ORM\Column(type="text")
  243.      * @CrudField(tab="Contact", label="Paragraphe")
  244.      */
  245.     private $contactParagraph;
  246.     /**
  247.      * @ORM\ManyToMany(targetEntity=ExpertisePublic::class, mappedBy="referencesPublics")
  248.      */
  249.     private $expertisePublics;
  250.     /**
  251.      * @ORM\ManyToMany(targetEntity=Solution::class, mappedBy="referencesPublics")
  252.      */
  253.     private $solutions;
  254.     /**
  255.      * @ORM\ManyToMany(targetEntity=Homepage::class, mappedBy="referencesPublics")
  256.      */
  257.     private $homepages;
  258.     /**
  259.      * @ORM\Column(type="boolean", nullable=true)
  260.      * @CrudField(label="Afficher dans le menu", index=true)
  261.      */
  262.     private $displayOnMenu;
  263.     /**
  264.      * @ORM\ManyToMany(targetEntity=Actualite::class, mappedBy="referencesPublic")
  265.      */
  266.     private $actualites;
  267.     /**
  268.      * @ORM\OneToMany(targetEntity=SolutionReference::class, mappedBy="referencePublic")
  269.      */
  270.     private $solutionReferences;
  271.     public function __construct()
  272.     {
  273.         $this->blocs = new ArrayCollection();
  274.         $this->referenceMedia = new ArrayCollection();
  275.         $this->expertisePublics = new ArrayCollection();
  276.         $this->solutions = new ArrayCollection();
  277.         $this->homepages = new ArrayCollection();
  278.         $this->actualites = new ArrayCollection();
  279.         $this->solutionReferences = new ArrayCollection();
  280.     }
  281.     public function __toString(): string
  282.     {
  283.         return $this->title ?? $this->getId() ?? "N/A";
  284.     }
  285.     public function getId(): ?int
  286.     {
  287.         return $this->id;
  288.     }
  289.     public function getTitle(): ?string
  290.     {
  291.         return $this->title;
  292.     }
  293.     public function setTitle(string $title): self
  294.     {
  295.         $this->title $title;
  296.         return $this;
  297.     }
  298.     public function getCoverName(): ?string
  299.     {
  300.         return $this->coverName;
  301.     }
  302.     public function setCoverName(?string $coverName): self
  303.     {
  304.         $this->coverName $coverName;
  305.         return $this;
  306.     }
  307.     public function getCoverSize(): ?int
  308.     {
  309.         return $this->coverSize;
  310.     }
  311.     public function setCoverSize(?int $coverSize): self
  312.     {
  313.         $this->coverSize $coverSize;
  314.         return $this;
  315.     }
  316.     public function getCoverUpdatedAt(): ?\DateTimeInterface
  317.     {
  318.         return $this->coverUpdatedAt;
  319.     }
  320.     public function setCoverUpdatedAt(?\DateTimeInterface $coverUpdatedAt): self
  321.     {
  322.         $this->coverUpdatedAt $coverUpdatedAt;
  323.         return $this;
  324.     }
  325.     public function getCoverFile(): ?File
  326.     {
  327.         return $this->coverFile;
  328.     }
  329.     public function setCoverFile(?File $coverFile): self
  330.     {
  331.         $this->coverFile $coverFile;
  332.         if (null !== $this->coverFile) {
  333.             $this->coverUpdatedAt = new \DateTimeImmutable();
  334.         }
  335.         return $this;
  336.     }
  337.     public function getCoverAlt(): ?string
  338.     {
  339.         return $this->coverAlt;
  340.     }
  341.     public function setCoverAlt(?string $coverAlt): self
  342.     {
  343.         $this->coverAlt $coverAlt;
  344.         return $this;
  345.     }
  346.     public function getFirmName(): ?string
  347.     {
  348.         return $this->firmName;
  349.     }
  350.     public function setFirmName(string $firmName): self
  351.     {
  352.         $this->firmName $firmName;
  353.         return $this;
  354.     }
  355.     public function getCity(): ?ReferenceCity
  356.     {
  357.         return $this->city;
  358.     }
  359.     public function setCity(?ReferenceCity $city): self
  360.     {
  361.         $this->city $city;
  362.         return $this;
  363.     }
  364.     public function getLogoName(): ?string
  365.     {
  366.         return $this->logoName;
  367.     }
  368.     public function setLogoName(?string $logoName): self
  369.     {
  370.         $this->logoName $logoName;
  371.         return $this;
  372.     }
  373.     public function getLogoSize(): ?int
  374.     {
  375.         return $this->logoSize;
  376.     }
  377.     public function setLogoSize(?int $logoSize): self
  378.     {
  379.         $this->logoSize $logoSize;
  380.         return $this;
  381.     }
  382.     public function getLogoUpdatedAt(): ?\DateTimeInterface
  383.     {
  384.         return $this->logoUpdatedAt;
  385.     }
  386.     public function setLogoUpdatedAt(?\DateTimeInterface $logoUpdatedAt): self
  387.     {
  388.         $this->logoUpdatedAt $logoUpdatedAt;
  389.         return $this;
  390.     }
  391.     public function getLogoFile(): ?File
  392.     {
  393.         return $this->logoFile;
  394.     }
  395.     public function setLogoFile(?File $logoFile): self
  396.     {
  397.         $this->logoFile $logoFile;
  398.         if (null !== $this->logoFile) {
  399.             $this->logoUpdatedAt = new \DateTimeImmutable();
  400.         }
  401.         return $this;
  402.     }
  403.     public function getLogoAlt(): ?string
  404.     {
  405.         return $this->logoAlt;
  406.     }
  407.     public function setLogoAlt(?string $logoAlt): self
  408.     {
  409.         $this->logoAlt $logoAlt;
  410.         return $this;
  411.     }
  412.     public function getResume(): ?string
  413.     {
  414.         return $this->resume;
  415.     }
  416.     public function setResume(string $resume): self
  417.     {
  418.         $this->resume $resume;
  419.         return $this;
  420.     }
  421.     public function getIntroTitle(): ?string
  422.     {
  423.         return $this->introTitle;
  424.     }
  425.     public function setIntroTitle(string $introTitle): self
  426.     {
  427.         $this->introTitle $introTitle;
  428.         return $this;
  429.     }
  430.     public function getIntroParagraph(): ?string
  431.     {
  432.         return $this->introParagraph;
  433.     }
  434.     public function setIntroParagraph(string $introParagraph): self
  435.     {
  436.         $this->introParagraph $introParagraph;
  437.         return $this;
  438.     }
  439.     public function getIntroVisuelPanoramiqueName(): ?string
  440.     {
  441.         return $this->introVisuelPanoramiqueName;
  442.     }
  443.     public function setIntroVisuelPanoramiqueName(?string $introVisuelPanoramiqueName): self
  444.     {
  445.         $this->introVisuelPanoramiqueName $introVisuelPanoramiqueName;
  446.         return $this;
  447.     }
  448.     public function getIntroVisuelPanoramiqueSize(): ?int
  449.     {
  450.         return $this->introVisuelPanoramiqueSize;
  451.     }
  452.     public function setIntroVisuelPanoramiqueSize(?int $introVisuelPanoramiqueSize): self
  453.     {
  454.         $this->introVisuelPanoramiqueSize $introVisuelPanoramiqueSize;
  455.         return $this;
  456.     }
  457.     public function getIntroVisuelPanoramiqueUpdatedAt(): ?\DateTimeInterface
  458.     {
  459.         return $this->introVisuelPanoramiqueUpdatedAt;
  460.     }
  461.     public function setIntroVisuelPanoramiqueUpdatedAt(?\DateTimeInterface $introVisuelPanoramiqueUpdatedAt): self
  462.     {
  463.         $this->introVisuelPanoramiqueUpdatedAt $introVisuelPanoramiqueUpdatedAt;
  464.         return $this;
  465.     }
  466.     public function getIntroVisuelPanoramiqueFile(): ?File
  467.     {
  468.         return $this->introVisuelPanoramiqueFile;
  469.     }
  470.     public function setIntroVisuelPanoramiqueFile(?File $introVisuelPanoramiqueFile): self
  471.     {
  472.         $this->introVisuelPanoramiqueFile $introVisuelPanoramiqueFile;
  473.         if (null !== $this->introVisuelPanoramiqueFile) {
  474.             $this->introVisuelPanoramiqueUpdatedAt = new \DateTimeImmutable();
  475.         }
  476.         return $this;
  477.     }
  478.     public function getIntroVisuelPanoramiqueAlt(): ?string
  479.     {
  480.         return $this->introVisuelPanoramiqueAlt;
  481.     }
  482.     public function setIntroVisuelPanoramiqueAlt(?string $introVisuelPanoramiqueAlt): self
  483.     {
  484.         $this->introVisuelPanoramiqueAlt $introVisuelPanoramiqueAlt;
  485.         return $this;
  486.     }
  487.     public function getIntroVideoUrl(): ?string
  488.     {
  489.         return $this->introVideoUrl;
  490.     }
  491.     public function setIntroVideoUrl(?string $introVideoUrl): self
  492.     {
  493.         if ($this->isYouTubeUrl($introVideoUrl) && !$this->isYouTubeEmbedUrl($introVideoUrl)) {
  494.             // Transforme l'URL en URL embed
  495.             $introVideoUrl $this->convertToEmbedUrl($introVideoUrl);
  496.         }
  497.         $this->introVideoUrl $introVideoUrl;
  498.         return $this;
  499.     }
  500.     private function isYouTubeUrl(?string $url): bool
  501.     {
  502.         // Vérifie si l'URL est une URL YouTube valide (à adapter selon tes besoins)
  503.         // Retourne true ou false en fonction du format de l'URL
  504.         // Par exemple, en vérifiant si l'URL contient "youtube.com" ou "youtu.be"
  505.         return (bool) preg_match('/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/'$url);
  506.     }
  507.     private function isYouTubeEmbedUrl(?string $url): bool
  508.     {
  509.         // Vérifie si l'URL est déjà au format embed YouTube
  510.         // Retourne true ou false en fonction du format de l'URL
  511.         // Par exemple, en vérifiant si l'URL contient "youtube.com/embed/"
  512.         return (bool) preg_match('/youtube\.com\/embed\//'$url);
  513.     }
  514.     private function convertToEmbedUrl(string $url): string
  515.     {
  516.         // Transforme une URL YouTube classique en URL embed
  517.         // Par exemple, en remplaçant le début de l'URL
  518.         // Tu devras adapter cette logique pour transformer correctement l'URL
  519.         $videoId $this->getYouTubeVideoId($url);
  520.         return "https://www.youtube.com/embed/{$videoId}";
  521.     }
  522.     private function getYouTubeVideoId(string $url): string
  523.     {
  524.         // Récupère l'identifiant de la vidéo YouTube depuis l'URL
  525.         // Par exemple, en extrayant l'ID de la vidéo depuis l'URL
  526.         // Tu devras adapter cette logique pour extraire correctement l'ID de la vidéo
  527.         $videoId ''// Logique pour extraire l'ID de la vidéo
  528.         // Modèle de regex pour l'URL de YouTube
  529.         $pattern '/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/';
  530.         // Vérification si l'URL correspond au modèle regex
  531.         if (preg_match($pattern$url$matches)) {
  532.             // Le groupe de capture 1 contient l'ID de la vidéo
  533.             $videoId $matches[1];
  534.         }
  535.         return $videoId;
  536.     }
  537.     public function getMoreSectors(): ?array
  538.     {
  539.         return $this->moreSectors;
  540.     }
  541.     public function setMoreSectors(array $moreSectors): self
  542.     {
  543.         $this->moreSectors $moreSectors;
  544.         return $this;
  545.     }
  546.     public function getMoreExpertises(): ?array
  547.     {
  548.         return $this->moreExpertises;
  549.     }
  550.     public function setMoreExpertises(array $moreExpertises): self
  551.     {
  552.         $this->moreExpertises $moreExpertises;
  553.         return $this;
  554.     }
  555.     public function getMoreTitle(): ?string
  556.     {
  557.         return $this->moreTitle;
  558.     }
  559.     public function setMoreTitle(string $moreTitle): self
  560.     {
  561.         $this->moreTitle $moreTitle;
  562.         return $this;
  563.     }
  564.     public function getMoreParagraph(): ?string
  565.     {
  566.         return $this->moreParagraph;
  567.     }
  568.     public function setMoreParagraph(string $moreParagraph): self
  569.     {
  570.         $this->moreParagraph $moreParagraph;
  571.         return $this;
  572.     }
  573.     public function getBlueSubTitle(): ?string
  574.     {
  575.         return $this->blueSubTitle;
  576.     }
  577.     public function setBlueSubTitle(string $blueSubTitle): self
  578.     {
  579.         $this->blueSubTitle $blueSubTitle;
  580.         return $this;
  581.     }
  582.     public function getBlueTitle(): ?string
  583.     {
  584.         return $this->blueTitle;
  585.     }
  586.     public function setBlueTitle(string $blueTitle): self
  587.     {
  588.         $this->blueTitle $blueTitle;
  589.         return $this;
  590.     }
  591.     public function getBlueParagraph1(): ?string
  592.     {
  593.         return $this->blueParagraph1;
  594.     }
  595.     public function setBlueParagraph1(string $blueParagraph1): self
  596.     {
  597.         $this->blueParagraph1 $blueParagraph1;
  598.         return $this;
  599.     }
  600.     public function getBlueParagraph2(): ?string
  601.     {
  602.         return $this->blueParagraph2;
  603.     }
  604.     public function setBlueParagraph2(?string $blueParagraph2): self
  605.     {
  606.         $this->blueParagraph2 $blueParagraph2;
  607.         return $this;
  608.     }
  609.     /**
  610.      * @return Collection<int, ReferenceBloc>
  611.      */
  612.     public function getBlocs(): Collection
  613.     {
  614.         return $this->blocs;
  615.     }
  616.     public function addBloc(ReferenceBloc $bloc): self
  617.     {
  618.         if (!$this->blocs->contains($bloc)) {
  619.             $this->blocs[] = $bloc;
  620.             $bloc->setReferencePublic($this);
  621.         }
  622.         return $this;
  623.     }
  624.     public function removeBloc(ReferenceBloc $bloc): self
  625.     {
  626.         if ($this->blocs->removeElement($bloc)) {
  627.             // set the owning side to null (unless already changed)
  628.             if ($bloc->getReferencePublic() === $this) {
  629.                 $bloc->setReferencePublic(null);
  630.             }
  631.         }
  632.         return $this;
  633.     }
  634.     public function getKeyNumber1Number(): ?string
  635.     {
  636.         return $this->keyNumber1Number;
  637.     }
  638.     public function setKeyNumber1Number(?string $keyNumber1Number): self
  639.     {
  640.         $this->keyNumber1Number $keyNumber1Number;
  641.         return $this;
  642.     }
  643.     public function getKeyNumber1Libelle(): ?string
  644.     {
  645.         return $this->keyNumber1Libelle;
  646.     }
  647.     public function setKeyNumber1Libelle(?string $keyNumber1Libelle): self
  648.     {
  649.         $this->keyNumber1Libelle $keyNumber1Libelle;
  650.         return $this;
  651.     }
  652.     public function getKeyNumber2Number(): ?string
  653.     {
  654.         return $this->keyNumber2Number;
  655.     }
  656.     public function setKeyNumber2Number(?string $keyNumber2Number): self
  657.     {
  658.         $this->keyNumber2Number $keyNumber2Number;
  659.         return $this;
  660.     }
  661.     public function getKeyNumber2Libelle(): ?string
  662.     {
  663.         return $this->keyNumber2Libelle;
  664.     }
  665.     public function setKeyNumber2Libelle(?string $keyNumber2Libelle): self
  666.     {
  667.         $this->keyNumber2Libelle $keyNumber2Libelle;
  668.         return $this;
  669.     }
  670.     public function getKeyNumber3Number(): ?string
  671.     {
  672.         return $this->keyNumber3Number;
  673.     }
  674.     public function setKeyNumber3Number(?string $keyNumber3Number): self
  675.     {
  676.         $this->keyNumber3Number $keyNumber3Number;
  677.         return $this;
  678.     }
  679.     public function getKeyNumber3Libelle(): ?string
  680.     {
  681.         return $this->keyNumber3Libelle;
  682.     }
  683.     public function setKeyNumber3Libelle(?string $keyNumber3Libelle): self
  684.     {
  685.         $this->keyNumber3Libelle $keyNumber3Libelle;
  686.         return $this;
  687.     }
  688.     public function getKeyNumber4Number(): ?string
  689.     {
  690.         return $this->keyNumber4Number;
  691.     }
  692.     public function setKeyNumber4Number(?string $keyNumber4Number): self
  693.     {
  694.         $this->keyNumber4Number $keyNumber4Number;
  695.         return $this;
  696.     }
  697.     public function getKeyNumber4Libelle(): ?string
  698.     {
  699.         return $this->keyNumber4Libelle;
  700.     }
  701.     public function setKeyNumber4Libelle(?string $keyNumber4Libelle): self
  702.     {
  703.         $this->keyNumber4Libelle $keyNumber4Libelle;
  704.         return $this;
  705.     }
  706.     /**
  707.      * @return Collection<int, ReferenceMedia>
  708.      */
  709.     public function getReferenceMedia(): Collection
  710.     {
  711.         return $this->referenceMedia;
  712.     }
  713.     public function addReferenceMedium(ReferenceMedia $referenceMedium): self
  714.     {
  715.         if (!$this->referenceMedia->contains($referenceMedium)) {
  716.             $this->referenceMedia[] = $referenceMedium;
  717.             $referenceMedium->setReferencePublic($this);
  718.         }
  719.         return $this;
  720.     }
  721.     public function removeReferenceMedium(ReferenceMedia $referenceMedium): self
  722.     {
  723.         if ($this->referenceMedia->removeElement($referenceMedium)) {
  724.             // set the owning side to null (unless already changed)
  725.             if ($referenceMedium->getReferencePublic() === $this) {
  726.                 $referenceMedium->setReferencePublic(null);
  727.             }
  728.         }
  729.         return $this;
  730.     }
  731.     public function getContactTitle(): ?string
  732.     {
  733.         return $this->contactTitle;
  734.     }
  735.     public function setContactTitle(string $contactTitle): self
  736.     {
  737.         $this->contactTitle $contactTitle;
  738.         return $this;
  739.     }
  740.     public function getContactParagraph(): ?string
  741.     {
  742.         return $this->contactParagraph;
  743.     }
  744.     public function setContactParagraph(string $contactParagraph): self
  745.     {
  746.         $this->contactParagraph $contactParagraph;
  747.         return $this;
  748.     }
  749.     /**
  750.      * @return Collection<int, ExpertisePublic>
  751.      */
  752.     public function getExpertisePublics(): Collection
  753.     {
  754.         return $this->expertisePublics;
  755.     }
  756.     public function addExpertisePublic(ExpertisePublic $expertisePublic): self
  757.     {
  758.         if (!$this->expertisePublics->contains($expertisePublic)) {
  759.             $this->expertisePublics[] = $expertisePublic;
  760.             $expertisePublic->addReferencesPublic($this);
  761.         }
  762.         return $this;
  763.     }
  764.     public function removeExpertisePublic(ExpertisePublic $expertisePublic): self
  765.     {
  766.         if ($this->expertisePublics->removeElement($expertisePublic)) {
  767.             $expertisePublic->removeReferencesPublic($this);
  768.         }
  769.         return $this;
  770.     }
  771.     /**
  772.      * @return Collection<int, Solution>
  773.      */
  774.     public function getSolutions(): Collection
  775.     {
  776.         return $this->solutions;
  777.     }
  778.     public function addSolution(Solution $solution): self
  779.     {
  780.         if (!$this->solutions->contains($solution)) {
  781.             $this->solutions[] = $solution;
  782.             $solution->addReferencesPublic($this);
  783.         }
  784.         return $this;
  785.     }
  786.     public function removeSolution(Solution $solution): self
  787.     {
  788.         if ($this->solutions->removeElement($solution)) {
  789.             $solution->removeReferencesPublic($this);
  790.         }
  791.         return $this;
  792.     }
  793.     /**
  794.      * @return Collection<int, Homepage>
  795.      */
  796.     public function getHomepages(): Collection
  797.     {
  798.         return $this->homepages;
  799.     }
  800.     public function addHomepage(Homepage $homepage): self
  801.     {
  802.         if (!$this->homepages->contains($homepage)) {
  803.             $this->homepages[] = $homepage;
  804.             $homepage->addReferencesPublic($this);
  805.         }
  806.         return $this;
  807.     }
  808.     public function removeHomepage(Homepage $homepage): self
  809.     {
  810.         if ($this->homepages->removeElement($homepage)) {
  811.             $homepage->removeReferencesPublic($this);
  812.         }
  813.         return $this;
  814.     }
  815.     public function isDisplayOnMenu(): ?bool
  816.     {
  817.         return $this->displayOnMenu;
  818.     }
  819.     public function setDisplayOnMenu(?bool $displayOnMenu): self
  820.     {
  821.         $this->displayOnMenu $displayOnMenu;
  822.         return $this;
  823.     }
  824.     /**
  825.      * @return Collection<int, Actualite>
  826.      */
  827.     public function getActualites(): Collection
  828.     {
  829.         return $this->actualites;
  830.     }
  831.     public function addActualite(Actualite $actualite): self
  832.     {
  833.         if (!$this->actualites->contains($actualite)) {
  834.             $this->actualites[] = $actualite;
  835.             $actualite->addReferencesPublic($this);
  836.         }
  837.         return $this;
  838.     }
  839.     public function removeActualite(Actualite $actualite): self
  840.     {
  841.         if ($this->actualites->removeElement($actualite)) {
  842.             $actualite->removeReferencesPublic($this);
  843.         }
  844.         return $this;
  845.     }
  846.     /**
  847.      * @return Collection<int, SolutionReference>
  848.      */
  849.     public function getSolutionReferences(): Collection
  850.     {
  851.         return $this->solutionReferences;
  852.     }
  853.     public function addSolutionReference(SolutionReference $solutionReference): self
  854.     {
  855.         if (!$this->solutionReferences->contains($solutionReference)) {
  856.             $this->solutionReferences[] = $solutionReference;
  857.             $solutionReference->setReferencePublic($this);
  858.         }
  859.         return $this;
  860.     }
  861.     public function removeSolutionReference(SolutionReference $solutionReference): self
  862.     {
  863.         if ($this->solutionReferences->removeElement($solutionReference)) {
  864.             // set the owning side to null (unless already changed)
  865.             if ($solutionReference->getReferencePublic() === $this) {
  866.                 $solutionReference->setReferencePublic(null);
  867.             }
  868.         }
  869.         return $this;
  870.     }
  871. }