<?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\WebEngineSubSectionRepository")
*/
class WebEngineSubSection
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\WebEngineSection", inversedBy="subSections")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="section_id", referencedColumnName="id", onDelete="CASCADE")
* })
*/
private $section;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Intitulé de sous-section - facultatif"})
*/
private $label;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $labelTranslations;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Classe CSS du champ"})
*/
private $CSSClass;
/**
* @ORM\Column(type="json", length=255, nullable=true, options={"comment":"Largeur de la sous-section (type 1-3 1-2@m 1-1@s)"})
*/
private $subSectionWidth;
/**
* @ORM\Column(type="json", length=255, nullable=true, options={"comment":"Nombre de colonnes des sous-sections (type 4@xl 2@m 1@s)"})
*/
private $subSectionColumns;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\WebSubSectionFilter", mappedBy="subSection", cascade={"persist","remove"})
* @ORM\OrderBy({"ordering" = "ASC"})
*/
private $filters;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default":true})
*/
private $published;
/**
* @ORM\Column(type="integer", nullable=true, options={"default":0})
*/
private $ordering;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="webEngineSubSections")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
* })
*/
private $owner;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="webEngineSubSections")
* @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->filters = 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 getCSSClass() : ?string
{
return $this->CSSClass;
}
public function setCSSClass(?string $CSSClass) : self
{
$this->CSSClass = $CSSClass;
return $this;
}
public function getSubSectionWidth() : ?array
{
return $this->subSectionWidth;
}
public function setSubSectionWidth(?array $subSectionWidth) : self
{
$this->subSectionWidth = $subSectionWidth;
return $this;
}
public function getSubSectionColumns() : ?array
{
return $this->subSectionColumns;
}
public function setSubSectionColumns(?array $subSectionColumns) : self
{
$this->subSectionColumns = $subSectionColumns;
return $this;
}
public function getPublished() : ?bool
{
return $this->published;
}
public function setPublished(bool $published) : self
{
$this->published = $published;
return $this;
}
public function getOrdering() : ?int
{
return $this->ordering;
}
public function setOrdering(?int $ordering) : self
{
$this->ordering = $ordering;
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 getSection() : ?WebEngineSection
{
return $this->section;
}
public function setSection(?WebEngineSection $section) : self
{
$this->section = $section;
return $this;
}
/**
* @return Collection|WebSubSectionFilter[]
*/
public function getFilters() : Collection
{
return $this->filters;
}
public function addFilter(WebSubSectionFilter $filter) : self
{
if (!$this->filters->contains($filter)) {
$this->filters[] = $filter;
$filter->setSubSection($this);
}
return $this;
}
public function removeFilter(WebSubSectionFilter $filter) : self
{
if ($this->filters->contains($filter)) {
$this->filters->removeElement($filter);
// set the owning side to null (unless already changed)
if ($filter->getSubSection() === $this) {
$filter->setSubSection(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;
}
}