src/Entity/Gos/Tmpl/TmplItem.php line 14

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.  * @ORM\Entity()
  8.  * @ORM\Table(name="tmpl_items")
  9.  * @ORM\HasLifecycleCallbacks
  10.  */
  11. class TmplItem
  12. {
  13.     /**
  14.      * @var int
  15.      *
  16.      * @ORM\Column(name="id", type="integer")
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @var integer
  23.      * @ORM\Column(name="position", type="integer")
  24.      */
  25.     private $position;
  26.     /**
  27.      * @var boolean
  28.      * @ORM\Column(name="is_active", type="boolean", nullable=false, options={"default": 1})
  29.      */
  30.     private $isActive;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Tmpl\Template", inversedBy="tmplItems")
  33.      * @ORM\JoinColumn(nullable=false)
  34.      */
  35.     private $template;
  36.     /**
  37.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Tmpl\TmplModule", inversedBy="tmplItems")
  38.      * @ORM\JoinColumn(nullable=false)
  39.      */
  40.     private $tmplModule;
  41.     /**
  42.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Tmpl\TmplModuleContent", mappedBy="tmplItem", cascade={"remove"})
  43.      */
  44.     private $tmplModuleContents;
  45.     public function __construct()
  46.     {
  47.         $this->tmplModuleContents = new ArrayCollection();
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getPosition(): ?int
  54.     {
  55.         return $this->position;
  56.     }
  57.     public function setPosition(int $position): self
  58.     {
  59.         $this->position $position;
  60.         return $this;
  61.     }
  62.     public function getIsActive(): ?bool
  63.     {
  64.         return $this->isActive;
  65.     }
  66.     public function setIsActive(bool $isActive): self
  67.     {
  68.         $this->isActive $isActive;
  69.         return $this;
  70.     }
  71.     public function getTemplate(): ?Template
  72.     {
  73.         return $this->template;
  74.     }
  75.     public function setTemplate(?Template $template): self
  76.     {
  77.         $this->template $template;
  78.         return $this;
  79.     }
  80.     public function getTmplModule(): ?TmplModule
  81.     {
  82.         return $this->tmplModule;
  83.     }
  84.     public function setTmplModule(?TmplModule $tmplModule): self
  85.     {
  86.         $this->tmplModule $tmplModule;
  87.         return $this;
  88.     }
  89.     /**
  90.      * @return Collection|TmplModuleContent[]
  91.      */
  92.     public function getTmplModuleContents(): Collection
  93.     {
  94.         return $this->tmplModuleContents;
  95.     }
  96.     public function addTmplModuleContent(TmplModuleContent $tmplModuleContent): self
  97.     {
  98.         if (!$this->tmplModuleContents->contains($tmplModuleContent))
  99.         {
  100.             $this->tmplModuleContents[] = $tmplModuleContent;
  101.             $tmplModuleContent->setTmplItem($this);
  102.         }
  103.         return $this;
  104.     }
  105.     public function removeTmplModuleContent(TmplModuleContent $tmplModuleContent): self
  106.     {
  107.         if ($this->tmplModuleContents->contains($tmplModuleContent))
  108.         {
  109.             $this->tmplModuleContents->removeElement($tmplModuleContent);
  110.             // set the owning side to null (unless already changed)
  111.             if ($tmplModuleContent->getTmplItem() === $this)
  112.             {
  113.                 $tmplModuleContent->setTmplItem(null);
  114.             }
  115.         }
  116.         return $this;
  117.     }
  118. }