src/Entity/EmailTemplate.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EmailTemplateRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=EmailTemplateRepository::class)
  9.  */
  10. class EmailTemplate
  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\Column(type="string", length=255)
  24.      */
  25.     private $code;
  26.     /**
  27.      * @ORM\Column(type="string", length=255)
  28.      */
  29.     private $description;
  30.     /**
  31.      * @ORM\Column(type="boolean")
  32.      */
  33.     private $is_active;
  34.     /**
  35.      * @ORM\Column(type="text")
  36.      */
  37.     private $content;
  38.     /**
  39.      * @ORM\ManyToMany(targetEntity=ProjectStructure::class, mappedBy="email_template")
  40.      */
  41.     private $projectStructures;
  42.     public function __construct()
  43.     {
  44.         $this->projectStructures = new ArrayCollection();
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getName(): ?string
  51.     {
  52.         return $this->name;
  53.     }
  54.     public function setName(string $name): self
  55.     {
  56.         $this->name $name;
  57.         return $this;
  58.     }
  59.     public function getCode(): ?string
  60.     {
  61.         return $this->code;
  62.     }
  63.     public function setCode(string $code): self
  64.     {
  65.         $this->code $code;
  66.         return $this;
  67.     }
  68.     public function getDescription(): ?string
  69.     {
  70.         return $this->description;
  71.     }
  72.     public function setDescription(string $description): self
  73.     {
  74.         $this->description $description;
  75.         return $this;
  76.     }
  77.     public function getIsActive(): ?bool
  78.     {
  79.         return $this->is_active;
  80.     }
  81.     public function setIsActive(bool $is_active): self
  82.     {
  83.         $this->is_active $is_active;
  84.         return $this;
  85.     }
  86.     public function getContent(): ?string
  87.     {
  88.         return $this->content;
  89.     }
  90.     public function setContent(string $content): self
  91.     {
  92.         $this->content $content;
  93.         return $this;
  94.     }
  95.     /**
  96.      * @return Collection|ProjectStructure[]
  97.      */
  98.     public function getProjectStructures(): Collection
  99.     {
  100.         return $this->projectStructures;
  101.     }
  102.     public function addProjectStructure(ProjectStructure $projectStructure): self
  103.     {
  104.         if (!$this->projectStructures->contains($projectStructure)) {
  105.             $this->projectStructures[] = $projectStructure;
  106.             $projectStructure->addEmailTemplate($this);
  107.         }
  108.         return $this;
  109.     }
  110.     public function removeProjectStructure(ProjectStructure $projectStructure): self
  111.     {
  112.         if ($this->projectStructures->removeElement($projectStructure)) {
  113.             $projectStructure->removeEmailTemplate($this);
  114.         }
  115.         return $this;
  116.     }
  117.     public function __toString()
  118.     {
  119.         return $this->name;
  120.     }
  121. }