src/Entity/Block.php line 12

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\BlockRepository")
  8.  */
  9. class Block
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom interne"})
  19.      */
  20.     private $name;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"IntitulĂ© du bloc"})
  23.      */
  24.     private $label;
  25.     /**
  26.      * @ORM\Column(type="json", nullable=true)
  27.      */
  28.     private $labelTranslations;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"IcĂ´ne CSS type fontAwesome"})
  31.      */
  32.     private $iconClass;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Classe CSS du champ"})
  35.      */
  36.     private $CSSClass;
  37.     /**
  38.      * @ORM\Column(type="string", length=1024, nullable=true, options={"comment":"Largeur du block (type 1-3 1-2@m 1-1@s)"})
  39.      */
  40.     private $blockWidth;
  41.     /**
  42.      * @ORM\Column(type="datetime", nullable=true)
  43.      */
  44.     private $createdAt;
  45.     /**
  46.      * @ORM\Column(type="datetime", nullable=true)
  47.      */
  48.     private $updatedAt;
  49.     /**
  50.      * @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
  51.      */
  52.     private $state;
  53.     /**
  54.      * @var \Doctrine\Common\Collections\Collection
  55.      *
  56.      * @ORM\OneToMany(targetEntity="App\Entity\BlockField", mappedBy="block", cascade={"persist","remove"}, orphanRemoval=true)
  57.      * @ORM\OrderBy({"ordering" = "ASC"})
  58.      */
  59.     private $fields;
  60.     /**
  61.      * @var \Doctrine\Common\Collections\Collection
  62.      *
  63.      * @ORM\OneToMany(targetEntity="App\Entity\WebListBlock", mappedBy="block", cascade={"persist"})
  64.      */
  65.     private $webLists;
  66.     /**
  67.      * @var \Doctrine\Common\Collections\Collection
  68.      *
  69.      * @ORM\OneToMany(targetEntity="App\Entity\WebPageBlock", mappedBy="block", cascade={"persist"})
  70.      */
  71.     private $webPages;
  72.     /**
  73.      * @var \Doctrine\Common\Collections\Collection
  74.      *
  75.      * @ORM\OneToMany(targetEntity="App\Entity\EditionModeleRubriqueZone", mappedBy="block", cascade={"persist"})
  76.      */
  77.     private $editionRubriqueZones;
  78.     /**
  79.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="blocks")
  80.      * @ORM\JoinColumns({
  81.      *   @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
  82.      * })
  83.      */
  84.     private $owner;
  85.     /**
  86.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="blocks")
  87.      * @ORM\JoinColumns({
  88.      *   @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
  89.      * })
  90.      */
  91.     private $entity;
  92.     /**
  93.      * @ORM\ManyToMany(targetEntity="App\Entity\Tag", inversedBy="blocks")
  94.      */
  95.     private $tags;
  96.     /**
  97.      * @ORM\OneToMany(targetEntity="App\Entity\DiaporamaBlock", mappedBy="block", cascade={"persist"})
  98.      */
  99.     private $diaporamas;
  100.     /**
  101.      * @ORM\OneToMany(targetEntity="App\Entity\WebMapPopupBlock", mappedBy="block", cascade={"persist"})
  102.      */
  103.     private $webMapPopups;
  104.     public function __construct()
  105.     {
  106.         $this->fields = new ArrayCollection();
  107.         $this->webLists = new ArrayCollection();
  108.         $this->webPages = new ArrayCollection();
  109.         $this->editionRubriqueZones = new ArrayCollection();
  110.         $this->tags = new ArrayCollection();
  111.         $this->diaporamas = new ArrayCollection();
  112.         $this->webMapPopups = new ArrayCollection();
  113.     }
  114.     public function getId(): ?int
  115.     {
  116.         return $this->id;
  117.     }
  118.     public function getLabel(): ?string
  119.     {
  120.         return $this->label;
  121.     }
  122.     public function setLabel(?string $label): self
  123.     {
  124.         $this->label $label;
  125.         return $this;
  126.     }
  127.     public function getLabelTranslations(): ?array
  128.     {
  129.         return $this->labelTranslations;
  130.     }
  131.     public function setLabelTranslations(?array $labelTranslations): self
  132.     {
  133.         $this->labelTranslations $labelTranslations;
  134.         return $this;
  135.     }
  136.     public function getIconClass(): ?string
  137.     {
  138.         return $this->iconClass;
  139.     }
  140.     public function setIconClass(?string $iconClass): self
  141.     {
  142.         $this->iconClass $iconClass;
  143.         return $this;
  144.     }
  145.     public function getCSSClass(): ?string
  146.     {
  147.         return $this->CSSClass;
  148.     }
  149.     public function setCSSClass(?string $CSSClass): self
  150.     {
  151.         $this->CSSClass $CSSClass;
  152.         return $this;
  153.     }
  154.     public function getBlockWidth(): ?string
  155.     {
  156.         return $this->blockWidth;
  157.     }
  158.     public function setBlockWidth(?string $blockWidth): self
  159.     {
  160.         $this->blockWidth $blockWidth;
  161.         return $this;
  162.     }
  163.     public function getCreatedAt(): ?\DateTimeInterface
  164.     {
  165.         return $this->createdAt;
  166.     }
  167.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  168.     {
  169.         $this->createdAt $createdAt;
  170.         return $this;
  171.     }
  172.     public function getUpdatedAt(): ?\DateTimeInterface
  173.     {
  174.         return $this->updatedAt;
  175.     }
  176.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  177.     {
  178.         $this->updatedAt $updatedAt;
  179.         return $this;
  180.     }
  181.     public function getState(): ?int
  182.     {
  183.         return $this->state;
  184.     }
  185.     public function setState(?int $state): self
  186.     {
  187.         $this->state $state;
  188.         return $this;
  189.     }
  190.     public function getOwner(): ?User
  191.     {
  192.         return $this->owner;
  193.     }
  194.     public function setOwner(?User $owner): self
  195.     {
  196.         $this->owner $owner;
  197.         return $this;
  198.     }
  199.     public function getEntity(): ?DnsitEntity
  200.     {
  201.         return $this->entity;
  202.     }
  203.     public function setEntity(?DnsitEntity $entity): self
  204.     {
  205.         $this->entity $entity;
  206.         return $this;
  207.     }
  208.     public function getName(): ?string
  209.     {
  210.         return $this->name;
  211.     }
  212.     public function setName(?string $name): self
  213.     {
  214.         $this->name $name;
  215.         return $this;
  216.     }
  217.     /**
  218.      * @return Collection|BlockField[]
  219.      */
  220.     public function getFields(): Collection
  221.     {
  222.         return $this->fields;
  223.     }
  224.     public function addField(BlockField $field): self
  225.     {
  226.         if (!$this->fields->contains($field)) {
  227.             $this->fields[] = $field;
  228.             $field->setBlock($this);
  229.         }
  230.         return $this;
  231.     }
  232.     public function removeField(BlockField $field): self
  233.     {
  234.         if ($this->fields->contains($field)) {
  235.             $this->fields->removeElement($field);
  236.             // set the owning side to null (unless already changed)
  237.             if ($field->getBlock() === $this) {
  238.                 $field->setBlock(null);
  239.             }
  240.         }
  241.         return $this;
  242.     }
  243.     /**
  244.      * @return Collection|WebListBlock[]
  245.      */
  246.     public function getWebLists(): Collection
  247.     {
  248.         return $this->webLists;
  249.     }
  250.     public function addWebList(WebListBlock $webList): self
  251.     {
  252.         if (!$this->webLists->contains($webList)) {
  253.             $this->webLists[] = $webList;
  254.             $webList->setBlock($this);
  255.         }
  256.         return $this;
  257.     }
  258.     public function removeWebList(WebListBlock $webList): self
  259.     {
  260.         if ($this->webLists->contains($webList)) {
  261.             $this->webLists->removeElement($webList);
  262.             // set the owning side to null (unless already changed)
  263.             if ($webList->getBlock() === $this) {
  264.                 $webList->setBlock(null);
  265.             }
  266.         }
  267.         return $this;
  268.     }
  269.     /**
  270.      * @return Collection|WebPageBlock[]
  271.      */
  272.     public function getWebPages(): Collection
  273.     {
  274.         return $this->webPages;
  275.     }
  276.     public function addWebPage(WebPageBlock $webPage): self
  277.     {
  278.         if (!$this->webPages->contains($webPage)) {
  279.             $this->webPages[] = $webPage;
  280.             $webPage->setBlock($this);
  281.         }
  282.         return $this;
  283.     }
  284.     public function removeWebPage(WebPageBlock $webPage): self
  285.     {
  286.         if ($this->webPages->contains($webPage)) {
  287.             $this->webPages->removeElement($webPage);
  288.             // set the owning side to null (unless already changed)
  289.             if ($webPage->getBlock() === $this) {
  290.                 $webPage->setBlock(null);
  291.             }
  292.         }
  293.         return $this;
  294.     }
  295.     /**
  296.      * @return Collection|EditionModeleRubriqueZone[]
  297.      */
  298.     public function getEditionRubriqueZones(): Collection
  299.     {
  300.         return $this->editionRubriqueZones;
  301.     }
  302.     public function addEditionRubriqueZone(EditionModeleRubriqueZone $editionRubriqueZone): self
  303.     {
  304.         if (!$this->editionRubriqueZones->contains($editionRubriqueZone)) {
  305.             $this->editionRubriqueZones[] = $editionRubriqueZone;
  306.             $editionRubriqueZone->setBlock($this);
  307.         }
  308.         return $this;
  309.     }
  310.     public function removeEditionRubriqueZone(EditionModeleRubriqueZone $editionRubriqueZone): self
  311.     {
  312.         if ($this->editionRubriqueZones->contains($editionRubriqueZone)) {
  313.             $this->editionRubriqueZones->removeElement($editionRubriqueZone);
  314.             // set the owning side to null (unless already changed)
  315.             if ($editionRubriqueZone->getBlock() === $this) {
  316.                 $editionRubriqueZone->setBlock(null);
  317.             }
  318.         }
  319.         return $this;
  320.     }
  321.     /**
  322.      * @return Collection|Tag[]
  323.      */
  324.     public function getTags(): Collection
  325.     {
  326.         return $this->tags;
  327.     }
  328.     public function addTag(Tag $tag): self
  329.     {
  330.         if (!$this->tags->contains($tag)) {
  331.             $this->tags[] = $tag;
  332.         }
  333.         return $this;
  334.     }
  335.     public function removeTag(Tag $tag): self
  336.     {
  337.         if ($this->tags->contains($tag)) {
  338.             $this->tags->removeElement($tag);
  339.         }
  340.         return $this;
  341.     }
  342.     /**
  343.      * @return Collection|DiaporamaBlock[]
  344.      */
  345.     public function getDiaporamas(): Collection
  346.     {
  347.         return $this->diaporamas;
  348.     }
  349.     public function addDiaporama(DiaporamaBlock $diaporama): self
  350.     {
  351.         if (!$this->diaporamas->contains($diaporama)) {
  352.             $this->diaporamas[] = $diaporama;
  353.             $diaporama->setBlock($this);
  354.         }
  355.         return $this;
  356.     }
  357.     public function removeDiaporama(DiaporamaBlock $diaporama): self
  358.     {
  359.         if ($this->diaporamas->contains($diaporama)) {
  360.             $this->diaporamas->removeElement($diaporama);
  361.             // set the owning side to null (unless already changed)
  362.             if ($diaporama->getBlock() === $this) {
  363.                 $diaporama->setBlock(null);
  364.             }
  365.         }
  366.         return $this;
  367.     }
  368.      /**
  369.      * @return Collection|WebMapPopupBlock[]
  370.      */
  371.     public function getWebMapPopups(): Collection
  372.     {
  373.         return $this->webMapPopups;
  374.     }
  375.     public function addWebMapPopup(WebMapPopupBlock $webMapPopup): self
  376.     {
  377.         if (!$this->webMapPopups->contains($webMapPopup)) {
  378.             $this->webMapPopups[] = $webMapPopup;
  379.             $webMapPopup->setBlock($this);
  380.         }
  381.         return $this;
  382.     }
  383.     public function removeWebMapPopup(WebMapPopupBlock $webMapPopup): self
  384.     {
  385.         if ($this->webMapPopups->contains($webMapPopup)) {
  386.             $this->webMapPopups->removeElement($webMapPopup);
  387.             // set the owning side to null (unless already changed)
  388.             if ($webMapPopup->getBlock() === $this) {
  389.                 $webMapPopup->setBlock(null);
  390.             }
  391.         }
  392.         return $this;
  393.     }
  394. }