src/Entity/Template.php line 15

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use App\Traits\TimeStampTrait;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClass'App\Repository\TemplateRepository')]
  9. #[ORM\Table(name'templates')]
  10. #[ORM\HasLifecycleCallbacks]
  11. class Template
  12. {
  13.     use TimeStampTrait;
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column(type'integer')]
  17.     private $id;
  18.     #[ORM\Column(type'string'length100)]
  19.     private $name;
  20.     #[ORM\Column(type'text')]
  21.     private $text;
  22.     #[ORM\Column(type'string'length255nullabletrue)]
  23.     private $params;
  24.     #[ORM\Column(type'boolean'nullablefalse)]
  25.     private $isDefault;
  26.     #[ORM\ManyToOne(targetEntity'TemplateType'inversedBy'templates')]
  27.     private $templateType;
  28.     #[ORM\ManyToOne(inversedBy'templates')]
  29.     private ?Entreprise $marchand null;
  30.     #[ORM\ManyToOne(inversedBy'templates')]
  31.     private ?User $createdBy null;
  32.     /**
  33.      * Constructor.
  34.      */
  35.     public function __construct()
  36.     {
  37.         $this->isDefault false;
  38.     }
  39.     /**
  40.      * Set id.
  41.      *
  42.      * @param int $id
  43.      *
  44.      * @return Template
  45.      */
  46.     public function setId($id): static
  47.     {
  48.         $this->id $id;
  49.         return $this;
  50.     }
  51.     /**
  52.      * Get id.
  53.      */
  54.     public function getId()
  55.     {
  56.         return $this->id;
  57.     }
  58.     /**
  59.      * Set name.
  60.      *
  61.      * @return Template
  62.      */
  63.     public function setName(string $name): static
  64.     {
  65.         $this->name $name;
  66.         return $this;
  67.     }
  68.     /**
  69.      * Get name.
  70.      */
  71.     public function getName(): ?string
  72.     {
  73.         return $this->name;
  74.     }
  75.     /**
  76.      * Set text.
  77.      *
  78.      * @return Template
  79.      */
  80.     public function setText(string $text): static
  81.     {
  82.         $this->text $text;
  83.         return $this;
  84.     }
  85.     /**
  86.      * Get text.
  87.      */
  88.     public function getText(): ?string
  89.     {
  90.         return $this->text;
  91.     }
  92.     /**
  93.      * Set templateType.
  94.      *
  95.      * @return Template
  96.      */
  97.     public function setTemplateType(TemplateType $templateType null): static
  98.     {
  99.         $this->templateType $templateType;
  100.         return $this;
  101.     }
  102.     /**
  103.      * Get templateType.
  104.      */
  105.     public function getTemplateType(): ?TemplateType
  106.     {
  107.         return $this->templateType;
  108.     }
  109.     /**
  110.      * Set params.
  111.      *
  112.      * @return Template
  113.      */
  114.     public function setParams(string $params): static
  115.     {
  116.         $this->params $params;
  117.         return $this;
  118.     }
  119.     /**
  120.      * Get params.
  121.      */
  122.     public function getParams(): ?string
  123.     {
  124.         return $this->params;
  125.     }
  126.     /**
  127.      * Set isDefault.
  128.      *
  129.      * @param bool $isDefault
  130.      *
  131.      * @return Template
  132.      */
  133.     public function setIsDefault($isDefault): static
  134.     {
  135.         $this->isDefault $isDefault;
  136.         return $this;
  137.     }
  138.     /**
  139.      * Get isDefault.
  140.      */
  141.     public function getIsDefault(): bool
  142.     {
  143.         return $this->isDefault;
  144.     }
  145.     public function getMarchand(): ?Entreprise
  146.     {
  147.         return $this->marchand;
  148.     }
  149.     public function setMarchand(?Entreprise $marchand): static
  150.     {
  151.         $this->marchand $marchand;
  152.         return $this;
  153.     }
  154.     public function getCreatedBy(): ?User
  155.     {
  156.         return $this->createdBy;
  157.     }
  158.     public function setCreatedBy(?User $createdBy): static
  159.     {
  160.         $this->createdBy $createdBy;
  161.         return $this;
  162.     }
  163. }