src/Entity/ExpertisePublic.php line 32

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\CitationTrait;
  4. use App\Repository\ExpertisePublicRepository;
  5. use Cofondateur\SocleTechniqueBundle\Annotation\CrudField;
  6. use Cofondateur\SocleTechniqueBundle\Traits\SEOInterface;
  7. use Cofondateur\SocleTechniqueBundle\Traits\SEOTrait;
  8. use Cofondateur\SocleTechniqueBundle\Traits\SluggableInterface;
  9. use Cofondateur\SocleTechniqueBundle\Traits\SluggableTrait;
  10. use Cofondateur\SocleTechniqueBundle\Traits\SortableTrait;
  11. use Doctrine\Common\Collections\ArrayCollection;
  12. use Doctrine\Common\Collections\Collection;
  13. use Doctrine\ORM\Mapping as ORM;
  14. use Symfony\Component\HttpFoundation\File\File;
  15. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  16. use Vich\UploaderBundle\Mapping\Annotation\Uploadable;
  17. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  18. use Symfony\Component\Validator\Constraints as Assert;
  19. use App\Form\BlockExpertiseFormType;
  20. /**
  21.  * @ORM\Entity(repositoryClass=ExpertisePublicRepository::class)
  22.  * @UniqueEntity(
  23.  *     fields={"slug"},
  24.  *     errorPath="slug",
  25.  *     message="Ce slug est déjà utilisé pour une autre expertise publique"
  26.  * )
  27.  * @Uploadable()
  28.  */
  29. class ExpertisePublic implements SEOInterfaceSluggableInterface
  30. {
  31.     
  32.     use SEOTrait;
  33.     use SortableTrait;
  34.     use SluggableTrait;
  35.     use CitationTrait;
  36.     
  37.     /**
  38.      * @ORM\Id
  39.      * @ORM\GeneratedValue
  40.      * @ORM\Column(type="integer")
  41.      */
  42.     private $id;
  43.     /**
  44.      * @ORM\Column(type="string")
  45.      */
  46.     private $coverName;
  47.     /**
  48.      * @ORM\Column(type="integer")
  49.      */
  50.     private $coverSize;
  51.     /**
  52.      * @ORM\Column(type="datetime", nullable=true)
  53.      */
  54.     private $coverUpdatedAt;
  55.     /**
  56.      * @Vich\UploadableField(mapping="default", fileNameProperty="coverName", size="coverSize")
  57.      * @CrudField(label="Visuel principal (bandeau top)")
  58.      */
  59.     private $coverFile;
  60.     /**
  61.      * @ORM\Column(type="string", nullable=true)
  62.      * @CrudField(label="Alt")
  63.      */
  64.     private $coverAlt;
  65.     /**
  66.      * @ORM\Column(type="string", length=255)
  67.      * @CrudField(index=true, label="Nom de l'expertise")
  68.      */
  69.     private $name;
  70.     /**
  71.      * @ORM\Column(type="string")
  72.      */
  73.     private $iconName;
  74.     /**
  75.      * @ORM\Column(type="integer")
  76.      */
  77.     private $iconSize;
  78.     /**
  79.      * @ORM\Column(type="datetime", nullable=true)
  80.      */
  81.     private $iconUpdatedAt;
  82.     /**
  83.      * @Vich\UploadableField(mapping="default", fileNameProperty="iconName", size="iconSize")
  84.      * @CrudField(label="Icone")
  85.      */
  86.     private $iconFile;
  87.     /**
  88.      * @ORM\Column(type="string", nullable=true)
  89.      * @CrudField(label="Alt")
  90.      */
  91.     private $iconAlt;
  92.     /**
  93.      * @ORM\Column(type="text")
  94.      * @CrudField(label="Résumé")
  95.      */
  96.     private $resume;
  97.     /**
  98.      * @ORM\Column(type="string", length=255)
  99.      * @CrudField(tab="Introduction", label="Sur-titre")
  100.      */
  101.     private $introSubTitle;
  102.     /**
  103.      * @ORM\Column(type="string", length=255)
  104.      * @CrudField(tab="Introduction", label="Titre (mettre entre étoiles pour rendre le titre avec le surlignage Exemple : 'ceci est en bleu *ceci est surligné*')")
  105.      */
  106.     private $introTitle;
  107.     /**
  108.      * @ORM\Column(type="text")
  109.      * @CrudField(tab="Introduction", label="Paragraphe", ckeditor=true)
  110.      */
  111.     private $introParagraphe;
  112.     /**
  113.      * @ORM\Column(type="string")
  114.      */
  115.     private $introVisuelPanoramiqueName;
  116.     /**
  117.      * @ORM\Column(type="integer")
  118.      */
  119.     private $introVisuelPanoramiqueSize;
  120.     /**
  121.      * @ORM\Column(type="datetime", nullable=true)
  122.      */
  123.     private $introVisuelPanoramiqueUpdatedAt;
  124.     /**
  125.      * @Vich\UploadableField(mapping="default", fileNameProperty="introVisuelPanoramiqueName", size="introVisuelPanoramiqueSize")
  126.      * @CrudField(tab="Introduction", label="Visuel panoramique")
  127.      */
  128.     private $introVisuelPanoramiqueFile;
  129.     /**
  130.      * @ORM\Column(type="string", nullable=true)
  131.      * @CrudField(tab="Introduction", label="Alt")
  132.      */
  133.     private $introVisuelPanoramiqueAlt;
  134.     /**
  135.      * @ORM\Column(type="text")
  136.      * @CrudField(tab="Introduction", label="Deuxième paragraphe", ckeditor=true)
  137.      */
  138.     private $introParagraphe2;
  139.     /**
  140.      * @ORM\Column(type="text")
  141.      * @CrudField(tab="Introduction", label="Troisième paragraphe", ckeditor=true)
  142.      */
  143.     private $introParagraphe3;
  144.     /**
  145.      * @ORM\OneToMany(targetEntity=BlockExpertise::class, mappedBy="expertisePublic", cascade={"persist", "remove"})
  146.      * @CrudField(label="Blocs", formType=BlockExpertiseFormType::class, tab="Blocs")
  147.      */
  148.     private $blocs;
  149.     /**
  150.      * @ORM\Column(type="string", length=255)
  151.      * @CrudField(tab="Pourquoi faire appel à NOOCARB ?", label="Sur-titre")
  152.      */
  153.     private $whyCallSubTitle;
  154.     /**
  155.      * @ORM\Column(type="string", length=255)
  156.      * @CrudField(tab="Pourquoi faire appel à NOOCARB ?", label="Titre (mettre entre étoiles pour rendre le titre avec le surlignage Exemple : 'ceci est en bleu *ceci est surligné*')")
  157.      */
  158.     private $whyCallTitle;
  159.     /**
  160.      * @ORM\Column(type="string", length=255, nullable=true)
  161.      * @CrudField(label="Sur-titre", tab="Citation")
  162.      */
  163.     private $citationsubTitle;
  164.     /**
  165.      * @ORM\ManyToMany(targetEntity=ReferencePublic::class, inversedBy="expertisePublics")
  166.      * @CrudField(tab="Références", label="Références publiques")
  167.      */
  168.     private $referencesPublics;
  169.     /**
  170.      * @ORM\Column(type="text")
  171.      * @CrudField(tab="Pourquoi faire appel à NOOCARB ?", label="Premier Paragraphe", ckeditor=true)
  172.      */
  173.     private $whyCallParagraphe;
  174.     /**
  175.      * @ORM\Column(type="text")
  176.      * @CrudField(tab="Pourquoi faire appel à NOOCARB ?", label="Second paragraphe", ckeditor=true)
  177.      */
  178.     private $whyCallParagraphe2;
  179.     /**
  180.      * @ORM\Column(type="string", length=255)
  181.      * @CrudField(tab="Contact", label="Titre")
  182.      */
  183.     private $contactTitle;
  184.     /**
  185.      * @ORM\Column(type="text")
  186.      * @CrudField(tab="Contact", label="Paragraphe")
  187.      */
  188.     private $contactParagraphe;
  189.     
  190.     public function __construct()
  191.     {
  192.         $this->blocs = new ArrayCollection();
  193.         $this->referencesPublics = new ArrayCollection();
  194.     }
  195.     public function __toString(): string
  196.     {
  197.         return $this->getId() ?? "N/A";
  198.     }
  199.     public function getId(): ?int
  200.     {
  201.         return $this->id;
  202.     }
  203.     public function getCoverName(): ?string
  204.     {
  205.         return $this->coverName;
  206.     }
  207.     public function setCoverName(?string $coverName): self
  208.     {
  209.         $this->coverName $coverName;
  210.         return $this;
  211.     }
  212.     public function getCoverSize(): ?int
  213.     {
  214.         return $this->coverSize;
  215.     }
  216.     public function setCoverSize(?int $coverSize): self
  217.     {
  218.         $this->coverSize $coverSize;
  219.         return $this;
  220.     }
  221.     public function getCoverUpdatedAt(): ?\DateTimeInterface
  222.     {
  223.         return $this->coverUpdatedAt;
  224.     }
  225.     public function setCoverUpdatedAt(?\DateTimeInterface $coverUpdatedAt): self
  226.     {
  227.         $this->coverUpdatedAt $coverUpdatedAt;
  228.         return $this;
  229.     }
  230.     public function getCoverFile(): ?File
  231.     {
  232.         return $this->coverFile;
  233.     }
  234.     public function setCoverFile(?File $coverFile): self
  235.     {
  236.         $this->coverFile $coverFile;
  237.         if (null !== $this->coverFile) {
  238.             $this->coverUpdatedAt = new \DateTimeImmutable();
  239.         }
  240.         return $this;
  241.     }
  242.     public function getCoverAlt(): ?string
  243.     {
  244.         return $this->coverAlt;
  245.     }
  246.     public function setCoverAlt(?string $coverAlt): self
  247.     {
  248.         $this->coverAlt $coverAlt;
  249.         return $this;
  250.     }
  251.     public function getName(): ?string
  252.     {
  253.         return $this->name;
  254.     }
  255.     public function setName(string $name): self
  256.     {
  257.         $this->name $name;
  258.         return $this;
  259.     }
  260.     public function getIconName(): ?string
  261.     {
  262.         return $this->iconName;
  263.     }
  264.     public function setIconName(?string $iconName): self
  265.     {
  266.         $this->iconName $iconName;
  267.         return $this;
  268.     }
  269.     public function getIconSize(): ?int
  270.     {
  271.         return $this->iconSize;
  272.     }
  273.     public function setIconSize(?int $iconSize): self
  274.     {
  275.         $this->iconSize $iconSize;
  276.         return $this;
  277.     }
  278.     public function getIconUpdatedAt(): ?\DateTimeInterface
  279.     {
  280.         return $this->iconUpdatedAt;
  281.     }
  282.     public function setIconUpdatedAt(?\DateTimeInterface $iconUpdatedAt): self
  283.     {
  284.         $this->iconUpdatedAt $iconUpdatedAt;
  285.         return $this;
  286.     }
  287.     public function getIconFile(): ?File
  288.     {
  289.         return $this->iconFile;
  290.     }
  291.     public function setIconFile(?File $iconFile): self
  292.     {
  293.         $this->iconFile $iconFile;
  294.         if (null !== $this->iconFile) {
  295.             $this->iconUpdatedAt = new \DateTimeImmutable();
  296.         }
  297.         return $this;
  298.     }
  299.     public function getIconAlt(): ?string
  300.     {
  301.         return $this->iconAlt;
  302.     }
  303.     public function setIconAlt(?string $iconAlt): self
  304.     {
  305.         $this->iconAlt $iconAlt;
  306.         return $this;
  307.     }
  308.     public function getIntroSubTitle(): ?string
  309.     {
  310.         return $this->introSubTitle;
  311.     }
  312.     public function setIntroSubTitle(string $introSubTitle): self
  313.     {
  314.         $this->introSubTitle $introSubTitle;
  315.         return $this;
  316.     }
  317.     public function getIntroTitle(): ?string
  318.     {
  319.         return $this->introTitle;
  320.     }
  321.     public function setIntroTitle(string $introTitle): self
  322.     {
  323.         $this->introTitle $introTitle;
  324.         return $this;
  325.     }
  326.     public function getIntroParagraphe(): ?string
  327.     {
  328.         return $this->introParagraphe;
  329.     }
  330.     public function setIntroParagraphe(string $introParagraphe): self
  331.     {
  332.         $this->introParagraphe $introParagraphe;
  333.         return $this;
  334.     }
  335.     public function getIntroVisuelPanoramiqueName(): ?string
  336.     {
  337.         return $this->introVisuelPanoramiqueName;
  338.     }
  339.     public function setIntroVisuelPanoramiqueName(?string $introVisuelPanoramiqueName): self
  340.     {
  341.         $this->introVisuelPanoramiqueName $introVisuelPanoramiqueName;
  342.         return $this;
  343.     }
  344.     public function getIntroVisuelPanoramiqueSize(): ?int
  345.     {
  346.         return $this->introVisuelPanoramiqueSize;
  347.     }
  348.     public function setIntroVisuelPanoramiqueSize(?int $introVisuelPanoramiqueSize): self
  349.     {
  350.         $this->introVisuelPanoramiqueSize $introVisuelPanoramiqueSize;
  351.         return $this;
  352.     }
  353.     public function getIntroVisuelPanoramiqueUpdatedAt(): ?\DateTimeInterface
  354.     {
  355.         return $this->introVisuelPanoramiqueUpdatedAt;
  356.     }
  357.     public function setIntroVisuelPanoramiqueUpdatedAt(?\DateTimeInterface $introVisuelPanoramiqueUpdatedAt): self
  358.     {
  359.         $this->introVisuelPanoramiqueUpdatedAt $introVisuelPanoramiqueUpdatedAt;
  360.         return $this;
  361.     }
  362.     public function getIntroVisuelPanoramiqueFile(): ?File
  363.     {
  364.         return $this->introVisuelPanoramiqueFile;
  365.     }
  366.     public function setIntroVisuelPanoramiqueFile(?File $introVisuelPanoramiqueFile): self
  367.     {
  368.         $this->introVisuelPanoramiqueFile $introVisuelPanoramiqueFile;
  369.         if (null !== $this->introVisuelPanoramiqueFile) {
  370.             $this->introVisuelPanoramiqueUpdatedAt = new \DateTimeImmutable();
  371.         }
  372.         return $this;
  373.     }
  374.     public function getIntroVisuelPanoramiqueAlt(): ?string
  375.     {
  376.         return $this->introVisuelPanoramiqueAlt;
  377.     }
  378.     public function setIntroVisuelPanoramiqueAlt(?string $introVisuelPanoramiqueAlt): self
  379.     {
  380.         $this->introVisuelPanoramiqueAlt $introVisuelPanoramiqueAlt;
  381.         return $this;
  382.     }
  383.     public function getIntroParagraphe2(): ?string
  384.     {
  385.         return $this->introParagraphe2;
  386.     }
  387.     public function setIntroParagraphe2(string $introParagraphe2): self
  388.     {
  389.         $this->introParagraphe2 $introParagraphe2;
  390.         return $this;
  391.     }
  392.     public function getIntroParagraphe3(): ?string
  393.     {
  394.         return $this->introParagraphe3;
  395.     }
  396.     public function setIntroParagraphe3(string $introParagraphe3): self
  397.     {
  398.         $this->introParagraphe3 $introParagraphe3;
  399.         return $this;
  400.     }
  401.     /**
  402.      * @return Collection<int, Block>
  403.      */
  404.     public function getBlocs(): Collection
  405.     {
  406.         return $this->blocs;
  407.     }
  408.     public function addBloc(BlockExpertise $bloc): self
  409.     {
  410.         if (!$this->blocs->contains($bloc)) {
  411.             $this->blocs[] = $bloc;
  412.             $bloc->setExpertisePublic($this);
  413.         }
  414.         return $this;
  415.     }
  416.     public function removeBloc(BlockExpertise $bloc): self
  417.     {
  418.         if ($this->blocs->removeElement($bloc)) {
  419.             // set the owning side to null (unless already changed)
  420.             if ($bloc->getExpertisePublic() === $this) {
  421.                 $bloc->setExpertisePublic(null);
  422.             }
  423.         }
  424.         return $this;
  425.     }
  426.     public function getWhyCallSubTitle(): ?string
  427.     {
  428.         return $this->whyCallSubTitle;
  429.     }
  430.     public function setWhyCallSubTitle(string $whyCallSubTitle): self
  431.     {
  432.         $this->whyCallSubTitle $whyCallSubTitle;
  433.         return $this;
  434.     }
  435.     public function getWhyCallTitle(): ?string
  436.     {
  437.         return $this->whyCallTitle;
  438.     }
  439.     public function setWhyCallTitle(string $whyCallTitle): self
  440.     {
  441.         $this->whyCallTitle $whyCallTitle;
  442.         return $this;
  443.     }
  444.     public function getWhyCallParagraphe(): ?string
  445.     {
  446.         return $this->whyCallParagraphe;
  447.     }
  448.     public function setWhyCallParagraphe(string $whyCallParagraphe): self
  449.     {
  450.         $this->whyCallParagraphe $whyCallParagraphe;
  451.         return $this;
  452.     }
  453.     public function getWhyCallParagraphe2(): ?string
  454.     {
  455.         return $this->whyCallParagraphe2;
  456.     }
  457.     public function setWhyCallParagraphe2(string $whyCallParagraphe2): self
  458.     {
  459.         $this->whyCallParagraphe2 $whyCallParagraphe2;
  460.         return $this;
  461.     }
  462.     public function getContactTitle(): ?string
  463.     {
  464.         return $this->contactTitle;
  465.     }
  466.     public function setContactTitle(string $contactTitle): self
  467.     {
  468.         $this->contactTitle $contactTitle;
  469.         return $this;
  470.     }
  471.     public function getContactParagraphe(): ?string
  472.     {
  473.         return $this->contactParagraphe;
  474.     }
  475.     public function setContactParagraphe(string $contactParagraphe): self
  476.     {
  477.         $this->contactParagraphe $contactParagraphe;
  478.         return $this;
  479.     }
  480.     /**
  481.      * @return Collection<int, ReferencePublic>
  482.      */
  483.     public function getReferencesPublics(): Collection
  484.     {
  485.         return $this->referencesPublics;
  486.     }
  487.     public function addReferencesPublic(ReferencePublic $referencesPublic): self
  488.     {
  489.         if (!$this->referencesPublics->contains($referencesPublic)) {
  490.             $this->referencesPublics[] = $referencesPublic;
  491.         }
  492.         return $this;
  493.     }
  494.     public function removeReferencesPublic(ReferencePublic $referencesPublic): self
  495.     {
  496.         $this->referencesPublics->removeElement($referencesPublic);
  497.         return $this;
  498.     }
  499.     public function getResume(): ?string
  500.     {
  501.         return $this->resume;
  502.     }
  503.     public function setResume(string $resume): self
  504.     {
  505.         $this->resume $resume;
  506.         return $this;
  507.     }
  508. }