<?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\BlockFieldRepository")
*/
class BlockField
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $ordering;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Block", inversedBy="fields")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="block_id", referencedColumnName="id", onDelete="CASCADE")
* })
*/
private $block;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Intitulé ou préfixe"})
*/
private $label;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $labelTranslations;
/**
* @ORM\Column(type="json", 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="json", nullable=true, options={"comment":"Largeur du champ (type 1-3 1-2@m 1-1@s)"})
*/
private $fieldWidth;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"COLUMNS ou ARRAY ou INLINE"})
*/
private $itemsDisplayType;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Texte de séparation entre enfants en mode INLINE"})
*/
private $itemsSeparator;
/**
* @ORM\Column(type="json", nullable=true, options={"comment":"Clase CSS d'icône pour les enfants (type FontAwesome)"})
*/
private $itemsIconClass;
/**
* @ORM\Column(type="json", nullable=true, options={"comment":"Nombre de colonnes des items (type 4@xl 2@m 1@s)"})
*/
private $itemsColumns;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\BlockFieldItem", mappedBy="blockField", cascade={"persist","remove"}, orphanRemoval=true)
* @ORM\OrderBy({"ordering" = "ASC"})
*/
private $items;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="blockFields")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
* })
*/
private $owner;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="blockFields")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
* })
*/
private $entity;
/**
* @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;
public function __construct()
{
$this->items = new ArrayCollection();
}
public function getId() : ?int
{
return $this->id;
}
public function getName() : ?string
{
return $this->name;
}
public function setName(?string $name) : self
{
$this->name = $name;
return $this;
}
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() : ?array
{
return $this->iconClass;
}
public function setIconClass(?array $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 getFieldWidth() : ?array
{
return $this->fieldWidth;
}
public function setFieldWidth(?array $fieldWidth) : self
{
$this->fieldWidth = $fieldWidth;
return $this;
}
public function getItemsDisplayType() : ?string
{
return $this->itemsDisplayType;
}
public function setItemsDisplayType(?string $itemsDisplayType) : self
{
$this->itemsDisplayType = $itemsDisplayType;
return $this;
}
public function getItemsSeparator() : ?string
{
return $this->itemsSeparator;
}
public function setItemsSeparator(?string $itemsSeparator) : self
{
$this->itemsSeparator = $itemsSeparator;
return $this;
}
public function getItemsIconClass() : ?array
{
return $this->itemsIconClass;
}
public function setItemsIconClass(?array $itemsIconClass) : self
{
$this->itemsIconClass = $itemsIconClass;
return $this;
}
public function getItemsColumns() : ?array
{
return $this->itemsColumns;
}
public function setItemsColumns(?array $itemsColumns) : self
{
$this->itemsColumns = $itemsColumns;
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 getBlock() : ?Block
{
return $this->block;
}
public function setBlock(?Block $block) : self
{
$this->block = $block;
return $this;
}
/**
* @return Collection|BlockFieldItem[]
*/
public function getItems() : Collection
{
return $this->items;
}
public function addItem(BlockFieldItem $item) : self
{
if (!$this->items->contains($item)) {
$this->items[] = $item;
$item->setBlockField($this);
}
return $this;
}
public function removeItem(BlockFieldItem $item) : self
{
if ($this->items->contains($item)) {
$this->items->removeElement($item);
// set the owning side to null (unless already changed)
if ($item->getBlockField() === $this) {
$item->setBlockField(null);
}
}
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 getOrdering() : ?int
{
return $this->ordering;
}
public function setOrdering(int $ordering) : self
{
$this->ordering = $ordering;
return $this;
}
}