src/Entity/Gos/Tmpl/TemplateType.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos\Tmpl;
  3. use App\Entity\Gos\MetaTags;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\TemplateTypeRepository")
  9.  */
  10. class TemplateType
  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)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\Tmpl\Template", mappedBy="templateType")
  24.      */
  25.     private $templates;
  26.     /**
  27.      * @ORM\OneToOne(targetEntity="App\Entity\Gos\MetaTags", mappedBy="templateType")
  28.      */
  29.     private $metaTags;
  30.     /**
  31.      * @var boolean
  32.      * @ORM\Column(type="boolean", nullable=false, options={"default": 1})
  33.      */
  34.     private $isDefault 1;
  35.     /**
  36.      * @ORM\Column(type="boolean", nullable=false, options={"default": 1})
  37.      */
  38.     private $enabledToLink 1;
  39.     public function __construct()
  40.     {
  41.         $this->templates = new ArrayCollection();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getName(): ?string
  48.     {
  49.         return $this->name;
  50.     }
  51.     public function setName(string $name): self
  52.     {
  53.         $this->name $name;
  54.         return $this;
  55.     }
  56.     /**
  57.      * @return Collection|Template[]
  58.      */
  59.     public function getTemplates(): Collection
  60.     {
  61.         return $this->templates;
  62.     }
  63.     public function addTemplate(Template $template): self
  64.     {
  65.         if (!$this->templates->contains($template)) {
  66.             $this->templates[] = $template;
  67.             $template->setTemplateType($this);
  68.         }
  69.         return $this;
  70.     }
  71.     public function removeTemplate(Template $template): self
  72.     {
  73.         if ($this->templates->contains($template)) {
  74.             $this->templates->removeElement($template);
  75.             // set the owning side to null (unless already changed)
  76.             if ($template->getTemplateType() === $this) {
  77.                 $template->setTemplateType(null);
  78.             }
  79.         }
  80.         return $this;
  81.     }
  82.     public function getIsDefault(): ?bool
  83.     {
  84.         return $this->isDefault;
  85.     }
  86.     public function setIsDefault(bool $isDefault): self
  87.     {
  88.         $this->isDefault $isDefault;
  89.         return $this;
  90.     }
  91.     public function getEnabledToLink(): ?bool
  92.     {
  93.         return $this->enabledToLink;
  94.     }
  95.     public function setEnabledToLink(bool $enabledToLink): self
  96.     {
  97.         $this->enabledToLink $enabledToLink;
  98.         return $this;
  99.     }
  100.     public function getMetaTags(): ?MetaTags
  101.     {
  102.         return $this->metaTags;
  103.     }
  104.     public function setMetaTags(?MetaTags $metaTags): self
  105.     {
  106.         $this->metaTags $metaTags;
  107.         // set (or unset) the owning side of the relation if necessary
  108.         $newTemplateType $metaTags === null null $this;
  109.         if ($newTemplateType !== $metaTags->getTemplateType()) {
  110.             $metaTags->setTemplateType($newTemplateType);
  111.         }
  112.         return $this;
  113.     }
  114. }