src/Entity/WebPageBlockGroup.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. /**
  7.  * @ORM\Entity (repositoryClass="App\Repository\WebPageBlockGroupRepository")
  8.  */
  9. #[ApiResource(order: ['ordering'])]
  10. class WebPageBlockGroup
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255, nullable=true)
  20.      */
  21.     private $label;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, nullable=true)
  24.      */
  25.     private $CSSClass;
  26.     /**
  27.      * @ORM\Column(type="json", nullable=true, options={"comment":"Largeur du groupe (type 1-3 1-2@m 1-1@s)"})
  28.      */
  29.     private $width;
  30.     /**
  31.      * @ORM\Column(type="json", nullable=true)
  32.      */
  33.     private $labelTranslations;
  34.     /**
  35.      * @ORM\Column(type="string", length=100, nullable=true)
  36.      */
  37.     private $groupIcon;
  38.     /**
  39.      * @var \Doctrine\Common\Collections\Collection
  40.      *
  41.      * @ORM\OneToMany(targetEntity="App\Entity\WebPageBlock", mappedBy="wpGroup", cascade={"persist"}, orphanRemoval=true)
  42.      * @ORM\OrderBy({"ordering" = "ASC"})
  43.      */
  44.     private $blocks;
  45.     /**
  46.      * @ORM\Column(type="json", nullable=true, options={"comment":"Options de visibilité"})
  47.      */
  48.     private $visibilityOptions;
  49.     public function __construct()
  50.     {
  51.         $this->blocks = new ArrayCollection();
  52.     }
  53.     public function getId() : ?int
  54.     {
  55.         return $this->id;
  56.     }
  57.     public function getWidth() : ?array
  58.     {
  59.         return $this->width;
  60.     }
  61.     public function setWidth(?array $width) : self
  62.     {
  63.         $this->width $width;
  64.         return $this;
  65.     }
  66.     public function getCSSClass() : ?string
  67.     {
  68.         return $this->CSSClass;
  69.     }
  70.     public function setCSSClass(?string $CSSClass) : self
  71.     {
  72.         $this->CSSClass $CSSClass;
  73.         return $this;
  74.     }
  75.     public function getLabel() : ?string
  76.     {
  77.         return $this->label;
  78.     }
  79.     public function setLabel(?string $label) : self
  80.     {
  81.         $this->label $label;
  82.         return $this;
  83.     }
  84.     public function getLabelTranslations() : ?array
  85.     {
  86.         return $this->labelTranslations;
  87.     }
  88.     public function setLabelTranslations(?array $labelTranslations) : self
  89.     {
  90.         $this->labelTranslations $labelTranslations;
  91.         return $this;
  92.     }
  93.     public function getGroupIcon() : ?string
  94.     {
  95.         return $this->groupIcon;
  96.     }
  97.     public function setGroupIcon(?string $groupIcon) : self
  98.     {
  99.         $this->groupIcon $groupIcon;
  100.         return $this;
  101.     }
  102.     /**
  103.      * @return Collection|WebPageBlock[]
  104.      */
  105.     public function getBlocks() : Collection
  106.     {
  107.         return $this->blocks;
  108.     }
  109.     public function addBlock(WebPageBlock $block) : self
  110.     {
  111.         if (!$this->blocks->contains($block)) {
  112.             $this->blocks[] = $block;
  113.             $block->setBlockField($this);
  114.         }
  115.         return $this;
  116.     }
  117.     public function removeBlock(WebPageBlock $block) : self
  118.     {
  119.         if ($this->blocks->contains($block)) {
  120.             $this->blocks->removeElement($block);
  121.             if ($block->getBlockField() === $this) {
  122.                 $block->setBlockField(null);
  123.             }
  124.         }
  125.         return $this;
  126.     }
  127.     public function getVisibilityOptions() : ?array
  128.     {
  129.         return $this->visibilityOptions;
  130.     }
  131.     public function setVisibilityOptions(?array $visibilityOptions) : self
  132.     {
  133.         $this->visibilityOptions $visibilityOptions;
  134.         return $this;
  135.     }
  136. }