<?phpnamespace App\Entity\Gos\Tmpl;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity() * @ORM\Table(name="tmpl_items") * @ORM\HasLifecycleCallbacks */class TmplItem{ /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var integer * @ORM\Column(name="position", type="integer") */ private $position; /** * @var boolean * @ORM\Column(name="is_active", type="boolean", nullable=false, options={"default": 1}) */ private $isActive; /** * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Tmpl\Template", inversedBy="tmplItems") * @ORM\JoinColumn(nullable=false) */ private $template; /** * @ORM\ManyToOne(targetEntity="App\Entity\Gos\Tmpl\TmplModule", inversedBy="tmplItems") * @ORM\JoinColumn(nullable=false) */ private $tmplModule; /** * @ORM\OneToMany(targetEntity="App\Entity\Gos\Tmpl\TmplModuleContent", mappedBy="tmplItem", cascade={"remove"}) */ private $tmplModuleContents; public function __construct() { $this->tmplModuleContents = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getPosition(): ?int { return $this->position; } public function setPosition(int $position): self { $this->position = $position; return $this; } public function getIsActive(): ?bool { return $this->isActive; } public function setIsActive(bool $isActive): self { $this->isActive = $isActive; return $this; } public function getTemplate(): ?Template { return $this->template; } public function setTemplate(?Template $template): self { $this->template = $template; return $this; } public function getTmplModule(): ?TmplModule { return $this->tmplModule; } public function setTmplModule(?TmplModule $tmplModule): self { $this->tmplModule = $tmplModule; return $this; } /** * @return Collection|TmplModuleContent[] */ public function getTmplModuleContents(): Collection { return $this->tmplModuleContents; } public function addTmplModuleContent(TmplModuleContent $tmplModuleContent): self { if (!$this->tmplModuleContents->contains($tmplModuleContent)) { $this->tmplModuleContents[] = $tmplModuleContent; $tmplModuleContent->setTmplItem($this); } return $this; } public function removeTmplModuleContent(TmplModuleContent $tmplModuleContent): self { if ($this->tmplModuleContents->contains($tmplModuleContent)) { $this->tmplModuleContents->removeElement($tmplModuleContent); // set the owning side to null (unless already changed) if ($tmplModuleContent->getTmplItem() === $this) { $tmplModuleContent->setTmplItem(null); } } return $this; }}