src/Entity/WebEngineSection.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity (repositoryClass="App\Repository\WebEngineSectionRepository")
  8.  */
  9. class WebEngineSection
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity="App\Entity\WebEngine", inversedBy="sections")
  19.      * @ORM\JoinColumns({
  20.      *   @ORM\JoinColumn(name="engine_id", referencedColumnName="id", onDelete="CASCADE")
  21.      * })
  22.      */
  23.     private $engine;
  24.     /**
  25.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Intitulé de section - facultatif"})
  26.      */
  27.     private $label;
  28.     /**
  29.      * @ORM\Column(type="json", nullable=true)
  30.      */
  31.     private $labelTranslations;
  32.     /**
  33.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Classe CSS du champ"})
  34.      */
  35.     private $CSSClass;
  36.     /**
  37.      * @ORM\Column(type="json", length=255, nullable=true, options={"comment":"Largeur de la section (type 1-3 1-2@m 1-1@s)"})
  38.      */
  39.     private $sectionWidth;
  40.     /**
  41.      * @ORM\Column(type="json", length=255, nullable=true, options={"comment":"Nombre de colonnes des sous-sections (type 4@xl 2@m 1@s)"})
  42.      */
  43.     private $sectionColumns;
  44.     /**
  45.      * @var \Doctrine\Common\Collections\Collection
  46.      *
  47.      * @ORM\OneToMany(targetEntity="App\Entity\WebEngineSubSection", mappedBy="section", cascade={"persist","remove"})
  48.      * @ORM\OrderBy({"ordering" = "ASC"})
  49.      */
  50.     private $subSections;
  51.     /**
  52.      * @ORM\Column(type="boolean", nullable=false, options={"default":true})
  53.      */
  54.     private $published;
  55.     /**
  56.      * @ORM\Column(type="integer", nullable=true, options={"default":0})
  57.      */
  58.     private $ordering;
  59.     /**
  60.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="webEngineSections")
  61.      * @ORM\JoinColumns({
  62.      *   @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
  63.      * })
  64.      */
  65.     private $owner;
  66.     /**
  67.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="webEngineSections")
  68.      * @ORM\JoinColumns({
  69.      *   @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
  70.      * })
  71.      */
  72.     private $entity;
  73.     /**
  74.      * @ORM\Column(type="datetime", nullable=true)
  75.      */
  76.     private $createdAt;
  77.     /**
  78.      * @ORM\Column(type="datetime", nullable=true)
  79.      */
  80.     private $updatedAt;
  81.     /**
  82.      * @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
  83.      */
  84.     private $state;
  85.     /**
  86.      * @ORM\Column(type="json", nullable=true)
  87.      */
  88.     private $displayConditions;
  89.     /**
  90.      * @ORM\Column(type="boolean", options={"default": false})
  91.      */
  92.     private $hiddenByDefault false;
  93.     public function __construct()
  94.     {
  95.         $this->subSections = new ArrayCollection();
  96.     }
  97.     public function getId() : ?int
  98.     {
  99.         return $this->id;
  100.     }
  101.     public function getLabel() : ?string
  102.     {
  103.         return $this->label;
  104.     }
  105.     public function setLabel(?string $label) : self
  106.     {
  107.         $this->label $label;
  108.         return $this;
  109.     }
  110.     public function getLabelTranslations() : ?array
  111.     {
  112.         return $this->labelTranslations;
  113.     }
  114.     public function setLabelTranslations(?array $labelTranslations) : self
  115.     {
  116.         $this->labelTranslations $labelTranslations;
  117.         return $this;
  118.     }
  119.     public function getDisplayConditions() : ?array
  120.     {
  121.         return $this->displayConditions;
  122.     }
  123.     public function setDisplayConditions(?array $displayConditions) : self
  124.     {
  125.         $this->displayConditions $displayConditions;
  126.         return $this;
  127.     }
  128.     public function getCSSClass() : ?string
  129.     {
  130.         return $this->CSSClass;
  131.     }
  132.     public function setCSSClass(?string $CSSClass) : self
  133.     {
  134.         $this->CSSClass $CSSClass;
  135.         return $this;
  136.     }
  137.     public function getSectionWidth() : ?array
  138.     {
  139.         return $this->sectionWidth;
  140.     }
  141.     public function setSectionWidth(?array $sectionWidth) : self
  142.     {
  143.         $this->sectionWidth $sectionWidth;
  144.         return $this;
  145.     }
  146.     public function getSectionColumns() : ?array
  147.     {
  148.         return $this->sectionColumns;
  149.     }
  150.     public function setSectionColumns(?array $sectionColumns) : self
  151.     {
  152.         $this->sectionColumns $sectionColumns;
  153.         return $this;
  154.     }
  155.     public function getPublished() : ?bool
  156.     {
  157.         return $this->published;
  158.     }
  159.     public function setPublished(bool $published) : self
  160.     {
  161.         $this->published $published;
  162.         return $this;
  163.     }
  164.     public function getOrdering() : ?int
  165.     {
  166.         return $this->ordering;
  167.     }
  168.     public function setOrdering(?int $ordering) : self
  169.     {
  170.         $this->ordering $ordering;
  171.         return $this;
  172.     }
  173.     public function getCreatedAt() : ?\DateTimeInterface
  174.     {
  175.         return $this->createdAt;
  176.     }
  177.     public function setCreatedAt(?\DateTimeInterface $createdAt) : self
  178.     {
  179.         $this->createdAt $createdAt;
  180.         return $this;
  181.     }
  182.     public function getUpdatedAt() : ?\DateTimeInterface
  183.     {
  184.         return $this->updatedAt;
  185.     }
  186.     public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
  187.     {
  188.         $this->updatedAt $updatedAt;
  189.         return $this;
  190.     }
  191.     public function getState() : ?int
  192.     {
  193.         return $this->state;
  194.     }
  195.     public function setState(?int $state) : self
  196.     {
  197.         $this->state $state;
  198.         return $this;
  199.     }
  200.     public function getEngine() : ?WebEngine
  201.     {
  202.         return $this->engine;
  203.     }
  204.     public function setEngine(?WebEngine $engine) : self
  205.     {
  206.         $this->engine $engine;
  207.         return $this;
  208.     }
  209.     /**
  210.      * @return Collection|WebEngineSubSection[]
  211.      */
  212.     public function getSubSections() : Collection
  213.     {
  214.         return $this->subSections;
  215.     }
  216.     public function addSubSection(WebEngineSubSection $subSection) : self
  217.     {
  218.         if (!$this->subSections->contains($subSection)) {
  219.             $this->subSections[] = $subSection;
  220.             $subSection->setSection($this);
  221.         }
  222.         return $this;
  223.     }
  224.     public function removeSubSection(WebEngineSubSection $subSection) : self
  225.     {
  226.         if ($this->subSections->contains($subSection)) {
  227.             $this->subSections->removeElement($subSection);
  228.             // set the owning side to null (unless already changed)
  229.             if ($subSection->getSection() === $this) {
  230.                 $subSection->setSection(null);
  231.             }
  232.         }
  233.         return $this;
  234.     }
  235.     public function getOwner() : ?User
  236.     {
  237.         return $this->owner;
  238.     }
  239.     public function setOwner(?User $owner) : self
  240.     {
  241.         $this->owner $owner;
  242.         return $this;
  243.     }
  244.     public function getEntity() : ?DnsitEntity
  245.     {
  246.         return $this->entity;
  247.     }
  248.     public function setEntity(?DnsitEntity $entity) : self
  249.     {
  250.         $this->entity $entity;
  251.         return $this;
  252.     }
  253.     public function getHiddenByDefault(): ?bool
  254.     {
  255.         return $this->hiddenByDefault;
  256.     }
  257.     public function setHiddenByDefault(?bool $hidden): self
  258.     {
  259.         $this->hiddenByDefault $hidden;
  260.         return $this;
  261.     }
  262. }