src/Entity/Gos/Tmpl/TmplModule.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos\Tmpl;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  *
  8.  * @ORM\Entity()
  9.  * @ORM\Table(name="tmpl_modules")
  10.  * @ORM\HasLifecycleCallbacks
  11.  */
  12. class TmplModule
  13. {
  14.     /**
  15.      * @var integer
  16.      *
  17.      * @ORM\Column(name="id", type="integer")
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="AUTO")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @var string
  24.      *
  25.      * @ORM\Column(type="text", length=255)
  26.      */
  27.     private $name;
  28.     /**
  29.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Tmpl\TmplItem", mappedBy="tmplModule")
  30.      */
  31.     private $tmplItems;
  32.     /**
  33.      * @var boolean
  34.      * @ORM\Column(type="boolean", nullable=false, options={"default": 1})
  35.      */
  36.     private $hasSidebar;
  37.     /**
  38.      * @ORM\Column(type="boolean")
  39.      */
  40.     private $enabledInStaticPage;
  41.     public function __toString()
  42.     {
  43.         return $this->getName();
  44.     }
  45.     public function __construct()
  46.     {
  47.         $this->tmplItems = new ArrayCollection();
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getName(): ?string
  54.     {
  55.         return $this->name;
  56.     }
  57.     public function setName(string $name): self
  58.     {
  59.         $this->name $name;
  60.         return $this;
  61.     }
  62.     /**
  63.      * @return Collection|TmplItem[]
  64.      */
  65.     public function getTmplItems(): Collection
  66.     {
  67.         return $this->tmplItems;
  68.     }
  69.     public function addTmplItem(TmplItem $tmplItem): self
  70.     {
  71.         if (!$this->tmplItems->contains($tmplItem))
  72.         {
  73.             $this->tmplItems[] = $tmplItem;
  74.             $tmplItem->setTmplModule($this);
  75.         }
  76.         return $this;
  77.     }
  78.     public function removeTmplItem(TmplItem $tmplItem): self
  79.     {
  80.         if ($this->tmplItems->contains($tmplItem))
  81.         {
  82.             $this->tmplItems->removeElement($tmplItem);
  83.             // set the owning side to null (unless already changed)
  84.             if ($tmplItem->getTmplModule() === $this)
  85.             {
  86.                 $tmplItem->setTmplModule(null);
  87.             }
  88.         }
  89.         return $this;
  90.     }
  91.     public function getHasSidebar(): ?bool
  92.     {
  93.         return $this->hasSidebar;
  94.     }
  95.     public function setHasSidebar(bool $hasSidebar): self
  96.     {
  97.         $this->hasSidebar $hasSidebar;
  98.         return $this;
  99.     }
  100.     public function getEnabledInStaticPage(): ?bool
  101.     {
  102.         return $this->enabledInStaticPage;
  103.     }
  104.     public function setEnabledInStaticPage(bool $enabledInStaticPage): self
  105.     {
  106.         $this->enabledInStaticPage $enabledInStaticPage;
  107.         return $this;
  108.     }
  109. }