<?php
namespace App\Entity;
use App\Entity\Traits\CitationTrait;
use App\Repository\ExpertisePriveRepository;
use Cofondateur\SocleTechniqueBundle\Annotation\CrudField;
use Cofondateur\SocleTechniqueBundle\Traits\SEOInterface;
use Cofondateur\SocleTechniqueBundle\Traits\SEOTrait;
use Cofondateur\SocleTechniqueBundle\Traits\SluggableInterface;
use Cofondateur\SocleTechniqueBundle\Traits\SluggableTrait;
use Cofondateur\SocleTechniqueBundle\Traits\SortableTrait;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Vich\UploaderBundle\Mapping\Annotation\Uploadable;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
use App\Form\BlockExpertiseFormType;
/**
* @ORM\Entity(repositoryClass=ExpertisePriveRepository::class)
* @UniqueEntity(
* fields={"slug"},
* errorPath="slug",
* message="Ce slug est déjà utilisé pour une autre expertise privée"
* )
* @Uploadable()
*/
class ExpertisePrive implements SEOInterface, SluggableInterface
{
use SEOTrait;
use SortableTrait;
use SluggableTrait;
use CitationTrait;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string")
*/
private $coverName;
/**
* @ORM\Column(type="integer")
*/
private $coverSize;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $coverUpdatedAt;
/**
* @Vich\UploadableField(mapping="default", fileNameProperty="coverName", size="coverSize")
* @CrudField(label="Visuel principal (bandeau top)")
*/
private $coverFile;
/**
* @ORM\Column(type="string", nullable=true)
* @CrudField(label="Alt")
*/
private $coverAlt;
/**
* @ORM\Column(type="string", length=255)
* @CrudField(index=true, label="Nom de l'expertise")
*/
private $name;
/**
* @ORM\Column(type="string")
*/
private $iconName;
/**
* @ORM\Column(type="integer")
*/
private $iconSize;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $iconUpdatedAt;
/**
* @Vich\UploadableField(mapping="default", fileNameProperty="iconName", size="iconSize")
* @CrudField(label="Icone")
*/
private $iconFile;
/**
* @ORM\Column(type="string", nullable=true)
* @CrudField(label="Alt")
*/
private $iconAlt;
/**
* @ORM\Column(type="text")
* @CrudField(label="Résumé")
*/
private $resume;
/**
* @ORM\Column(type="string", length=255)
* @CrudField(tab="Introduction", label="Sur-titre")
*/
private $introSubTitle;
/**
* @ORM\Column(type="string", length=255)
* @CrudField(tab="Introduction", label="Titre (mettre entre étoiles pour rendre le titre avec le surlignage Exemple : 'ceci est en bleu *ceci est surligné*')")
*/
private $introTitle;
/**
* @ORM\Column(type="text")
* @CrudField(tab="Introduction", label="Paragraphe", ckeditor=true)
*/
private $introParagraphe;
/**
* @ORM\Column(type="string")
*/
private $introVisuelPanoramiqueName;
/**
* @ORM\Column(type="integer")
*/
private $introVisuelPanoramiqueSize;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $introVisuelPanoramiqueUpdatedAt;
/**
* @Vich\UploadableField(mapping="default", fileNameProperty="introVisuelPanoramiqueName", size="introVisuelPanoramiqueSize")
* @CrudField(tab="Introduction", label="Visuel panoramique")
*/
private $introVisuelPanoramiqueFile;
/**
* @ORM\Column(type="string", nullable=true)
* @CrudField(tab="Introduction", label="Alt")
*/
private $introVisuelPanoramiqueAlt;
/**
* @ORM\Column(type="text")
* @CrudField(tab="Introduction", label="Deuxième paragraphe", ckeditor=true)
*/
private $introParagraphe2;
/**
* @ORM\Column(type="text")
* @CrudField(tab="Introduction", label="Troisième paragraphe", ckeditor=true)
*/
private $introParagraphe3;
/**
* @ORM\OneToMany(targetEntity=BlockExpertise::class, mappedBy="expertisePrive", cascade={"persist", "remove"})
* @CrudField(label="Blocs", formType=BlockExpertiseFormType::class, tab="Blocs")
*/
private $blocs;
/**
* @ORM\Column(type="string", length=255)
* @CrudField(tab="Pourquoi faire appel à NOOCARB ?", label="Sur-titre")
*/
private $whyCallSubTitle;
/**
* @ORM\Column(type="string", length=255)
* @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é*')")
*/
private $whyCallTitle;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @CrudField(label="Sur-titre", tab="Citation")
*/
private $citationsubTitle;
/**
* @ORM\ManyToMany(targetEntity=ReferencePrive::class, inversedBy="expertisePrives")
* @CrudField(tab="Références", label="Références privées")
*/
private $referencesPrives;
/**
* @ORM\Column(type="text")
* @CrudField(tab="Pourquoi faire appel à NOOCARB ?", label="Premier Paragraphe", ckeditor=true)
*/
private $whyCallParagraphe;
/**
* @ORM\Column(type="text")
* @CrudField(tab="Pourquoi faire appel à NOOCARB ?", label="Second paragraphe", ckeditor=true)
*/
private $whyCallParagraphe2;
/**
* @ORM\Column(type="string", length=255)
* @CrudField(tab="Contact", label="Titre")
*/
private $contactTitle;
/**
* @ORM\Column(type="text")
* @CrudField(tab="Contact", label="Paragraphe")
*/
private $contactParagraphe;
public function __construct()
{
$this->blocs = new ArrayCollection();
$this->referencesPrives = new ArrayCollection();
}
public function __toString(): string
{
return $this->getId() ?? "N/A";
}
public function getId(): ?int
{
return $this->id;
}
public function getCoverName(): ?string
{
return $this->coverName;
}
public function setCoverName(?string $coverName): self
{
$this->coverName = $coverName;
return $this;
}
public function getCoverSize(): ?int
{
return $this->coverSize;
}
public function setCoverSize(?int $coverSize): self
{
$this->coverSize = $coverSize;
return $this;
}
public function getCoverUpdatedAt(): ?\DateTimeInterface
{
return $this->coverUpdatedAt;
}
public function setCoverUpdatedAt(?\DateTimeInterface $coverUpdatedAt): self
{
$this->coverUpdatedAt = $coverUpdatedAt;
return $this;
}
public function getCoverFile(): ?File
{
return $this->coverFile;
}
public function setCoverFile(?File $coverFile): self
{
$this->coverFile = $coverFile;
if (null !== $this->coverFile) {
$this->coverUpdatedAt = new \DateTimeImmutable();
}
return $this;
}
public function getCoverAlt(): ?string
{
return $this->coverAlt;
}
public function setCoverAlt(?string $coverAlt): self
{
$this->coverAlt = $coverAlt;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getIconName(): ?string
{
return $this->iconName;
}
public function setIconName(?string $iconName): self
{
$this->iconName = $iconName;
return $this;
}
public function getIconSize(): ?int
{
return $this->iconSize;
}
public function setIconSize(?int $iconSize): self
{
$this->iconSize = $iconSize;
return $this;
}
public function getIconUpdatedAt(): ?\DateTimeInterface
{
return $this->iconUpdatedAt;
}
public function setIconUpdatedAt(?\DateTimeInterface $iconUpdatedAt): self
{
$this->iconUpdatedAt = $iconUpdatedAt;
return $this;
}
public function getIconFile(): ?File
{
return $this->iconFile;
}
public function setIconFile(?File $iconFile): self
{
$this->iconFile = $iconFile;
if (null !== $this->iconFile) {
$this->iconUpdatedAt = new \DateTimeImmutable();
}
return $this;
}
public function getIconAlt(): ?string
{
return $this->iconAlt;
}
public function setIconAlt(?string $iconAlt): self
{
$this->iconAlt = $iconAlt;
return $this;
}
public function getIntroSubTitle(): ?string
{
return $this->introSubTitle;
}
public function setIntroSubTitle(string $introSubTitle): self
{
$this->introSubTitle = $introSubTitle;
return $this;
}
public function getIntroTitle(): ?string
{
return $this->introTitle;
}
public function setIntroTitle(string $introTitle): self
{
$this->introTitle = $introTitle;
return $this;
}
public function getIntroParagraphe(): ?string
{
return $this->introParagraphe;
}
public function setIntroParagraphe(string $introParagraphe): self
{
$this->introParagraphe = $introParagraphe;
return $this;
}
public function getIntroVisuelPanoramiqueName(): ?string
{
return $this->introVisuelPanoramiqueName;
}
public function setIntroVisuelPanoramiqueName(?string $introVisuelPanoramiqueName): self
{
$this->introVisuelPanoramiqueName = $introVisuelPanoramiqueName;
return $this;
}
public function getIntroVisuelPanoramiqueSize(): ?int
{
return $this->introVisuelPanoramiqueSize;
}
public function setIntroVisuelPanoramiqueSize(?int $introVisuelPanoramiqueSize): self
{
$this->introVisuelPanoramiqueSize = $introVisuelPanoramiqueSize;
return $this;
}
public function getIntroVisuelPanoramiqueUpdatedAt(): ?\DateTimeInterface
{
return $this->introVisuelPanoramiqueUpdatedAt;
}
public function setIntroVisuelPanoramiqueUpdatedAt(?\DateTimeInterface $introVisuelPanoramiqueUpdatedAt): self
{
$this->introVisuelPanoramiqueUpdatedAt = $introVisuelPanoramiqueUpdatedAt;
return $this;
}
public function getIntroVisuelPanoramiqueFile(): ?File
{
return $this->introVisuelPanoramiqueFile;
}
public function setIntroVisuelPanoramiqueFile(?File $introVisuelPanoramiqueFile): self
{
$this->introVisuelPanoramiqueFile = $introVisuelPanoramiqueFile;
if (null !== $this->introVisuelPanoramiqueFile) {
$this->introVisuelPanoramiqueUpdatedAt = new \DateTimeImmutable();
}
return $this;
}
public function getIntroVisuelPanoramiqueAlt(): ?string
{
return $this->introVisuelPanoramiqueAlt;
}
public function setIntroVisuelPanoramiqueAlt(?string $introVisuelPanoramiqueAlt): self
{
$this->introVisuelPanoramiqueAlt = $introVisuelPanoramiqueAlt;
return $this;
}
public function getIntroParagraphe2(): ?string
{
return $this->introParagraphe2;
}
public function setIntroParagraphe2(string $introParagraphe2): self
{
$this->introParagraphe2 = $introParagraphe2;
return $this;
}
public function getIntroParagraphe3(): ?string
{
return $this->introParagraphe3;
}
public function setIntroParagraphe3(string $introParagraphe3): self
{
$this->introParagraphe3 = $introParagraphe3;
return $this;
}
/**
* @return Collection<int, Block>
*/
public function getBlocs(): Collection
{
return $this->blocs;
}
public function addBloc(BlockExpertise $bloc): self
{
if (!$this->blocs->contains($bloc)) {
$this->blocs[] = $bloc;
$bloc->setExpertisePrive($this);
}
return $this;
}
public function removeBloc(BlockExpertise $bloc): self
{
if ($this->blocs->removeElement($bloc)) {
// set the owning side to null (unless already changed)
if ($bloc->getExpertisePrive() === $this) {
$bloc->setExpertisePrive(null);
}
}
return $this;
}
public function getWhyCallSubTitle(): ?string
{
return $this->whyCallSubTitle;
}
public function setWhyCallSubTitle(string $whyCallSubTitle): self
{
$this->whyCallSubTitle = $whyCallSubTitle;
return $this;
}
public function getWhyCallTitle(): ?string
{
return $this->whyCallTitle;
}
public function setWhyCallTitle(string $whyCallTitle): self
{
$this->whyCallTitle = $whyCallTitle;
return $this;
}
public function getWhyCallParagraphe(): ?string
{
return $this->whyCallParagraphe;
}
public function setWhyCallParagraphe(string $whyCallParagraphe): self
{
$this->whyCallParagraphe = $whyCallParagraphe;
return $this;
}
public function getWhyCallParagraphe2(): ?string
{
return $this->whyCallParagraphe2;
}
public function setWhyCallParagraphe2(string $whyCallParagraphe2): self
{
$this->whyCallParagraphe2 = $whyCallParagraphe2;
return $this;
}
public function getContactTitle(): ?string
{
return $this->contactTitle;
}
public function setContactTitle(string $contactTitle): self
{
$this->contactTitle = $contactTitle;
return $this;
}
public function getContactParagraphe(): ?string
{
return $this->contactParagraphe;
}
public function setContactParagraphe(string $contactParagraphe): self
{
$this->contactParagraphe = $contactParagraphe;
return $this;
}
/**
* @return Collection<int, ReferencePrive>
*/
public function getReferencesPrives(): Collection
{
return $this->referencesPrives;
}
public function addReferencesPrife(ReferencePrive $referencesPrife): self
{
if (!$this->referencesPrives->contains($referencesPrife)) {
$this->referencesPrives[] = $referencesPrife;
}
return $this;
}
public function removeReferencesPrife(ReferencePrive $referencesPrife): self
{
$this->referencesPrives->removeElement($referencesPrife);
return $this;
}
public function getResume(): ?string
{
return $this->resume;
}
public function setResume(string $resume): self
{
$this->resume = $resume;
return $this;
}
}