src/Entity/WebEngineSubSection.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\WebEngineSubSectionRepository")
  8.  */
  9. class WebEngineSubSection
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity="App\Entity\WebEngineSection", inversedBy="subSections")
  19.      * @ORM\JoinColumns({
  20.      *   @ORM\JoinColumn(name="section_id", referencedColumnName="id", onDelete="CASCADE")
  21.      * })
  22.      */
  23.     private $section;
  24.     /**
  25.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Intitulé de sous-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 sous-section (type 1-3 1-2@m 1-1@s)"})
  38.      */
  39.     private $subSectionWidth;
  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 $subSectionColumns;
  44.     /**
  45.      * @var \Doctrine\Common\Collections\Collection
  46.      *
  47.      * @ORM\OneToMany(targetEntity="App\Entity\WebSubSectionFilter", mappedBy="subSection", cascade={"persist","remove"})
  48.      * @ORM\OrderBy({"ordering" = "ASC"})
  49.      */
  50.     private $filters;
  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="webEngineSubSections")
  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="webEngineSubSections")
  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.     public function __construct()
  86.     {
  87.         $this->filters = new ArrayCollection();
  88.     }
  89.     public function getId() : ?int
  90.     {
  91.         return $this->id;
  92.     }
  93.     public function getLabel() : ?string
  94.     {
  95.         return $this->label;
  96.     }
  97.     public function setLabel(?string $label) : self
  98.     {
  99.         $this->label $label;
  100.         return $this;
  101.     }
  102.     public function getLabelTranslations() : ?array
  103.     {
  104.         return $this->labelTranslations;
  105.     }
  106.     public function setLabelTranslations(?array $labelTranslations) : self
  107.     {
  108.         $this->labelTranslations $labelTranslations;
  109.         return $this;
  110.     }
  111.     public function getCSSClass() : ?string
  112.     {
  113.         return $this->CSSClass;
  114.     }
  115.     public function setCSSClass(?string $CSSClass) : self
  116.     {
  117.         $this->CSSClass $CSSClass;
  118.         return $this;
  119.     }
  120.     public function getSubSectionWidth() : ?array
  121.     {
  122.         return $this->subSectionWidth;
  123.     }
  124.     public function setSubSectionWidth(?array $subSectionWidth) : self
  125.     {
  126.         $this->subSectionWidth $subSectionWidth;
  127.         return $this;
  128.     }
  129.     public function getSubSectionColumns() : ?array
  130.     {
  131.         return $this->subSectionColumns;
  132.     }
  133.     public function setSubSectionColumns(?array $subSectionColumns) : self
  134.     {
  135.         $this->subSectionColumns $subSectionColumns;
  136.         return $this;
  137.     }
  138.     public function getPublished() : ?bool
  139.     {
  140.         return $this->published;
  141.     }
  142.     public function setPublished(bool $published) : self
  143.     {
  144.         $this->published $published;
  145.         return $this;
  146.     }
  147.     public function getOrdering() : ?int
  148.     {
  149.         return $this->ordering;
  150.     }
  151.     public function setOrdering(?int $ordering) : self
  152.     {
  153.         $this->ordering $ordering;
  154.         return $this;
  155.     }
  156.     public function getCreatedAt() : ?\DateTimeInterface
  157.     {
  158.         return $this->createdAt;
  159.     }
  160.     public function setCreatedAt(?\DateTimeInterface $createdAt) : self
  161.     {
  162.         $this->createdAt $createdAt;
  163.         return $this;
  164.     }
  165.     public function getUpdatedAt() : ?\DateTimeInterface
  166.     {
  167.         return $this->updatedAt;
  168.     }
  169.     public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
  170.     {
  171.         $this->updatedAt $updatedAt;
  172.         return $this;
  173.     }
  174.     public function getState() : ?int
  175.     {
  176.         return $this->state;
  177.     }
  178.     public function setState(?int $state) : self
  179.     {
  180.         $this->state $state;
  181.         return $this;
  182.     }
  183.     public function getSection() : ?WebEngineSection
  184.     {
  185.         return $this->section;
  186.     }
  187.     public function setSection(?WebEngineSection $section) : self
  188.     {
  189.         $this->section $section;
  190.         return $this;
  191.     }
  192.     /**
  193.      * @return Collection|WebSubSectionFilter[]
  194.      */
  195.     public function getFilters() : Collection
  196.     {
  197.         return $this->filters;
  198.     }
  199.     public function addFilter(WebSubSectionFilter $filter) : self
  200.     {
  201.         if (!$this->filters->contains($filter)) {
  202.             $this->filters[] = $filter;
  203.             $filter->setSubSection($this);
  204.         }
  205.         return $this;
  206.     }
  207.     public function removeFilter(WebSubSectionFilter $filter) : self
  208.     {
  209.         if ($this->filters->contains($filter)) {
  210.             $this->filters->removeElement($filter);
  211.             // set the owning side to null (unless already changed)
  212.             if ($filter->getSubSection() === $this) {
  213.                 $filter->setSubSection(null);
  214.             }
  215.         }
  216.         return $this;
  217.     }
  218.     public function getOwner() : ?User
  219.     {
  220.         return $this->owner;
  221.     }
  222.     public function setOwner(?User $owner) : self
  223.     {
  224.         $this->owner $owner;
  225.         return $this;
  226.     }
  227.     public function getEntity() : ?DnsitEntity
  228.     {
  229.         return $this->entity;
  230.     }
  231.     public function setEntity(?DnsitEntity $entity) : self
  232.     {
  233.         $this->entity $entity;
  234.         return $this;
  235.     }
  236. }