src/Entity/TemplateType.php line 11

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity]
  6. #[ORM\Table(name'template_types')]
  7. class TemplateType
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type'integer')]
  12.     private $id;
  13.     #[ORM\Column(type'string'length50)]
  14.     private $name;
  15.     #[ORM\Column(type'string'length50)]
  16.     private $icon;
  17.     #[ORM\Column(type'string'length150)]
  18.     private $service;
  19.     #[ORM\OneToMany(mappedBy'templateType'targetEntity'Template')]
  20.     private $templates;
  21.     #[ORM\Column(type'string'length50nullabletrue)]
  22.     private $editorTemplate;
  23.     #[ORM\Column(nullabletrue)]
  24.     private ?bool $status null;
  25.     /**
  26.      * Constructor.
  27.      */
  28.     public function __construct()
  29.     {
  30.         $this->templates = new \Doctrine\Common\Collections\ArrayCollection();
  31.     }
  32.     /**
  33.      * Get id.
  34.      *
  35.      * @return int
  36.      */
  37.     public function getId()
  38.     {
  39.         return $this->id;
  40.     }
  41.     /**
  42.      * Set name.
  43.      *
  44.      * @param string $name
  45.      *
  46.      * @return TemplateType
  47.      */
  48.     public function setName($name)
  49.     {
  50.         $this->name $name;
  51.         return $this;
  52.     }
  53.     /**
  54.      * Get name.
  55.      *
  56.      * @return string
  57.      */
  58.     public function getName()
  59.     {
  60.         return $this->name;
  61.     }
  62.     /**
  63.      * Set icon.
  64.      *
  65.      * @param string $icon
  66.      *
  67.      * @return TemplateType
  68.      */
  69.     public function setIcon($icon)
  70.     {
  71.         $this->icon $icon;
  72.         return $this;
  73.     }
  74.     /**
  75.      * Get icon.
  76.      *
  77.      * @return string
  78.      */
  79.     public function getIcon()
  80.     {
  81.         return $this->icon;
  82.     }
  83.     /**
  84.      * Set service.
  85.      *
  86.      * @param string $service
  87.      *
  88.      * @return TemplateType
  89.      */
  90.     public function setService($service)
  91.     {
  92.         $this->service $service;
  93.         return $this;
  94.     }
  95.     /**
  96.      * Get service.
  97.      *
  98.      * @return string
  99.      */
  100.     public function getService()
  101.     {
  102.         return $this->service;
  103.     }
  104.     /**
  105.      * Add template.
  106.      *
  107.      * @param \App\Entity\Template $template
  108.      *
  109.      * @return TemplateType
  110.      */
  111.     public function addTemplate(Template $template)
  112.     {
  113.         $this->templates[] = $template;
  114.         return $this;
  115.     }
  116.     /**
  117.      * Remove template.
  118.      *
  119.      * @param \App\Entity\Template $template
  120.      */
  121.     public function removeTemplate(Template $template): void
  122.     {
  123.         $this->templates->removeElement($template);
  124.     }
  125.     /**
  126.      * Get templates.
  127.      *
  128.      * @return \Doctrine\Common\Collections\Collection
  129.      */
  130.     public function getTemplates()
  131.     {
  132.         return $this->templates;
  133.     }
  134.     public function getEditorTemplate(): ?string
  135.     {
  136.         return $this->editorTemplate;
  137.     }
  138.     public function setEditorTemplate(?string $editorTemplate): self
  139.     {
  140.         $this->editorTemplate $editorTemplate;
  141.         return $this;
  142.     }
  143.     public function isStatus(): ?bool
  144.     {
  145.         return $this->status;
  146.     }
  147.     public function setStatus(?bool $status): static
  148.     {
  149.         $this->status $status;
  150.         return $this;
  151.     }
  152. }