<?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\WebEngineSectionRepository")
*/
class WebEngineSection
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\WebEngine", inversedBy="sections")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="engine_id", referencedColumnName="id", onDelete="CASCADE")
* })
*/
private $engine;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Intitulé de 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 section (type 1-3 1-2@m 1-1@s)"})
*/
private $sectionWidth;
/**
* @ORM\Column(type="json", length=255, nullable=true, options={"comment":"Nombre de colonnes des sous-sections (type 4@xl 2@m 1@s)"})
*/
private $sectionColumns;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\WebEngineSubSection", mappedBy="section", cascade={"persist","remove"})
* @ORM\OrderBy({"ordering" = "ASC"})
*/
private $subSections;
/**
* @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="webEngineSections")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
* })
*/
private $owner;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="webEngineSections")
* @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;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $displayConditions;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $hiddenByDefault = false;
public function __construct()
{
$this->subSections = 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 getDisplayConditions() : ?array
{
return $this->displayConditions;
}
public function setDisplayConditions(?array $displayConditions) : self
{
$this->displayConditions = $displayConditions;
return $this;
}
public function getCSSClass() : ?string
{
return $this->CSSClass;
}
public function setCSSClass(?string $CSSClass) : self
{
$this->CSSClass = $CSSClass;
return $this;
}
public function getSectionWidth() : ?array
{
return $this->sectionWidth;
}
public function setSectionWidth(?array $sectionWidth) : self
{
$this->sectionWidth = $sectionWidth;
return $this;
}
public function getSectionColumns() : ?array
{
return $this->sectionColumns;
}
public function setSectionColumns(?array $sectionColumns) : self
{
$this->sectionColumns = $sectionColumns;
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 getEngine() : ?WebEngine
{
return $this->engine;
}
public function setEngine(?WebEngine $engine) : self
{
$this->engine = $engine;
return $this;
}
/**
* @return Collection|WebEngineSubSection[]
*/
public function getSubSections() : Collection
{
return $this->subSections;
}
public function addSubSection(WebEngineSubSection $subSection) : self
{
if (!$this->subSections->contains($subSection)) {
$this->subSections[] = $subSection;
$subSection->setSection($this);
}
return $this;
}
public function removeSubSection(WebEngineSubSection $subSection) : self
{
if ($this->subSections->contains($subSection)) {
$this->subSections->removeElement($subSection);
// set the owning side to null (unless already changed)
if ($subSection->getSection() === $this) {
$subSection->setSection(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 getHiddenByDefault(): ?bool
{
return $this->hiddenByDefault;
}
public function setHiddenByDefault(?bool $hidden): self
{
$this->hiddenByDefault = $hidden;
return $this;
}
}