<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\BlockRepository")
*/
class Block
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom interne"})
*/
private $name;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Intitulé du bloc"})
*/
private $label;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $labelTranslations;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"IcĂ´ne CSS type fontAwesome"})
*/
private $iconClass;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Classe CSS du champ"})
*/
private $CSSClass;
/**
* @ORM\Column(type="string", length=1024, nullable=true, options={"comment":"Largeur du block (type 1-3 1-2@m 1-1@s)"})
*/
private $blockWidth;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
*/
private $state;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\BlockField", mappedBy="block", cascade={"persist","remove"}, orphanRemoval=true)
* @ORM\OrderBy({"ordering" = "ASC"})
*/
private $fields;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\WebListBlock", mappedBy="block", cascade={"persist"})
*/
private $webLists;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\WebPageBlock", mappedBy="block", cascade={"persist"})
*/
private $webPages;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\EditionModeleRubriqueZone", mappedBy="block", cascade={"persist"})
*/
private $editionRubriqueZones;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="blocks")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
* })
*/
private $owner;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="blocks")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
* })
*/
private $entity;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Tag", inversedBy="blocks")
*/
private $tags;
/**
* @ORM\OneToMany(targetEntity="App\Entity\DiaporamaBlock", mappedBy="block", cascade={"persist"})
*/
private $diaporamas;
/**
* @ORM\OneToMany(targetEntity="App\Entity\WebMapPopupBlock", mappedBy="block", cascade={"persist"})
*/
private $webMapPopups;
public function __construct()
{
$this->fields = new ArrayCollection();
$this->webLists = new ArrayCollection();
$this->webPages = new ArrayCollection();
$this->editionRubriqueZones = new ArrayCollection();
$this->tags = new ArrayCollection();
$this->diaporamas = new ArrayCollection();
$this->webMapPopups = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(?string $label): self
{
$this->label = $label;
return $this;
}
public function getLabelTranslations(): ?array
{
return $this->labelTranslations;
}
public function setLabelTranslations(?array $labelTranslations): self
{
$this->labelTranslations = $labelTranslations;
return $this;
}
public function getIconClass(): ?string
{
return $this->iconClass;
}
public function setIconClass(?string $iconClass): self
{
$this->iconClass = $iconClass;
return $this;
}
public function getCSSClass(): ?string
{
return $this->CSSClass;
}
public function setCSSClass(?string $CSSClass): self
{
$this->CSSClass = $CSSClass;
return $this;
}
public function getBlockWidth(): ?string
{
return $this->blockWidth;
}
public function setBlockWidth(?string $blockWidth): self
{
$this->blockWidth = $blockWidth;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getState(): ?int
{
return $this->state;
}
public function setState(?int $state): self
{
$this->state = $state;
return $this;
}
public function getOwner(): ?User
{
return $this->owner;
}
public function setOwner(?User $owner): self
{
$this->owner = $owner;
return $this;
}
public function getEntity(): ?DnsitEntity
{
return $this->entity;
}
public function setEntity(?DnsitEntity $entity): self
{
$this->entity = $entity;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
/**
* @return Collection|BlockField[]
*/
public function getFields(): Collection
{
return $this->fields;
}
public function addField(BlockField $field): self
{
if (!$this->fields->contains($field)) {
$this->fields[] = $field;
$field->setBlock($this);
}
return $this;
}
public function removeField(BlockField $field): self
{
if ($this->fields->contains($field)) {
$this->fields->removeElement($field);
// set the owning side to null (unless already changed)
if ($field->getBlock() === $this) {
$field->setBlock(null);
}
}
return $this;
}
/**
* @return Collection|WebListBlock[]
*/
public function getWebLists(): Collection
{
return $this->webLists;
}
public function addWebList(WebListBlock $webList): self
{
if (!$this->webLists->contains($webList)) {
$this->webLists[] = $webList;
$webList->setBlock($this);
}
return $this;
}
public function removeWebList(WebListBlock $webList): self
{
if ($this->webLists->contains($webList)) {
$this->webLists->removeElement($webList);
// set the owning side to null (unless already changed)
if ($webList->getBlock() === $this) {
$webList->setBlock(null);
}
}
return $this;
}
/**
* @return Collection|WebPageBlock[]
*/
public function getWebPages(): Collection
{
return $this->webPages;
}
public function addWebPage(WebPageBlock $webPage): self
{
if (!$this->webPages->contains($webPage)) {
$this->webPages[] = $webPage;
$webPage->setBlock($this);
}
return $this;
}
public function removeWebPage(WebPageBlock $webPage): self
{
if ($this->webPages->contains($webPage)) {
$this->webPages->removeElement($webPage);
// set the owning side to null (unless already changed)
if ($webPage->getBlock() === $this) {
$webPage->setBlock(null);
}
}
return $this;
}
/**
* @return Collection|EditionModeleRubriqueZone[]
*/
public function getEditionRubriqueZones(): Collection
{
return $this->editionRubriqueZones;
}
public function addEditionRubriqueZone(EditionModeleRubriqueZone $editionRubriqueZone): self
{
if (!$this->editionRubriqueZones->contains($editionRubriqueZone)) {
$this->editionRubriqueZones[] = $editionRubriqueZone;
$editionRubriqueZone->setBlock($this);
}
return $this;
}
public function removeEditionRubriqueZone(EditionModeleRubriqueZone $editionRubriqueZone): self
{
if ($this->editionRubriqueZones->contains($editionRubriqueZone)) {
$this->editionRubriqueZones->removeElement($editionRubriqueZone);
// set the owning side to null (unless already changed)
if ($editionRubriqueZone->getBlock() === $this) {
$editionRubriqueZone->setBlock(null);
}
}
return $this;
}
/**
* @return Collection|Tag[]
*/
public function getTags(): Collection
{
return $this->tags;
}
public function addTag(Tag $tag): self
{
if (!$this->tags->contains($tag)) {
$this->tags[] = $tag;
}
return $this;
}
public function removeTag(Tag $tag): self
{
if ($this->tags->contains($tag)) {
$this->tags->removeElement($tag);
}
return $this;
}
/**
* @return Collection|DiaporamaBlock[]
*/
public function getDiaporamas(): Collection
{
return $this->diaporamas;
}
public function addDiaporama(DiaporamaBlock $diaporama): self
{
if (!$this->diaporamas->contains($diaporama)) {
$this->diaporamas[] = $diaporama;
$diaporama->setBlock($this);
}
return $this;
}
public function removeDiaporama(DiaporamaBlock $diaporama): self
{
if ($this->diaporamas->contains($diaporama)) {
$this->diaporamas->removeElement($diaporama);
// set the owning side to null (unless already changed)
if ($diaporama->getBlock() === $this) {
$diaporama->setBlock(null);
}
}
return $this;
}
/**
* @return Collection|WebMapPopupBlock[]
*/
public function getWebMapPopups(): Collection
{
return $this->webMapPopups;
}
public function addWebMapPopup(WebMapPopupBlock $webMapPopup): self
{
if (!$this->webMapPopups->contains($webMapPopup)) {
$this->webMapPopups[] = $webMapPopup;
$webMapPopup->setBlock($this);
}
return $this;
}
public function removeWebMapPopup(WebMapPopupBlock $webMapPopup): self
{
if ($this->webMapPopups->contains($webMapPopup)) {
$this->webMapPopups->removeElement($webMapPopup);
// set the owning side to null (unless already changed)
if ($webMapPopup->getBlock() === $this) {
$webMapPopup->setBlock(null);
}
}
return $this;
}
}