src/Admin/Entity/StdTemplates.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Admin\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * StdPages
  6.  */
  7. #[ORM\Table(name'std_templates')]
  8. #[ORM\Index(name'fk_std_templates_std_users'columns: ['created_by'])]
  9. #[ORM\Index(name'fk_std_templates_std_users_0'columns: ['updated_by'])]
  10. #[ORM\Index(name'fk_std_templates_std_content_types'columns: ['content_type'])]
  11. #[ORM\Entity]
  12. class StdTemplates
  13. {
  14.     /**
  15.      * @var int
  16.      */
  17.     #[ORM\Column(name'id'type'integer'nullablefalseoptions: ['unsigned' => true'comment' => 'Unique identifier'])]
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue(strategy'IDENTITY')]
  20.     private $id;
  21.     /**
  22.      * @var string
  23.      */
  24.     #[ORM\Column(name'name'type'string'length100nullabletrueoptions: ['comment' => 'Template name'])]
  25.     private $name;
  26.     /**
  27.      * @var string
  28.      */
  29.     #[ORM\Column(name'machine_name'type'string'length50nullabletrueoptions: ['comment' => 'Machine name of the template'])]
  30.     private $machineName;
  31.     /**
  32.      * @var \StdContentTypes
  33.      */
  34.     #[ORM\JoinColumn(name'content_type'referencedColumnName'id')]
  35.     #[ORM\ManyToOne(targetEntity'StdContentTypes')]
  36.     private $contentType;
  37.     /**
  38.      * @var bool
  39.      */
  40.     #[ORM\Column(name'is_active'type'boolean'nullabletrueoptions: ['default' => 1'comment' => 'Flag that indicates if the template is active'])]
  41.     private $isActive '1';
  42.     /**
  43.      * @var \StdUsers
  44.      */
  45.     #[ORM\JoinColumn(name'created_by'referencedColumnName'id')]
  46.     #[ORM\ManyToOne(targetEntity'StdUsers')]
  47.     private $createdBy;
  48.     /**
  49.      * @var \DateTime
  50.      */
  51.     #[ORM\Column(name'created_date'type'datetime'nullablefalseoptions: ['comment' => 'Date and time of the record creation'])]
  52.     private $createdDate;
  53.     /**
  54.      * @var \StdUsers
  55.      */
  56.     #[ORM\JoinColumn(name'updated_by'referencedColumnName'id')]
  57.     #[ORM\ManyToOne(targetEntity'StdUsers')]
  58.     private $updatedBy;
  59.     /**
  60.      * @var \DateTime
  61.      */
  62.     #[ORM\Column(name'updated_date'type'datetime'nullablefalseoptions: ['comment' => 'Date and time the record was last updated'])]
  63.     private $updatedDate;
  64.     /**
  65.      * @var string
  66.      */
  67.     #[ORM\Column(name'layout'type'string'length100nullabletrueoptions: ['comment' => 'Page layout'])]
  68.     private $layout;
  69.     public function getId(): ?int
  70.     {
  71.         return $this->id;
  72.     }
  73.     public function getName(): ?string
  74.     {
  75.         return $this->name;
  76.     }
  77.     public function setName(string $name): self
  78.     {
  79.         $this->name $name;
  80.         return $this;
  81.     }
  82.     public function getMachineName(): ?string
  83.     {
  84.         return $this->machineName;
  85.     }
  86.     public function setMachineName(string $machineName): self
  87.     {
  88.         $this->machineName $machineName;
  89.         return $this;
  90.     }
  91.     public function getContentType(): ?StdContentTypes
  92.     {
  93.         return $this->contentType;
  94.     }
  95.     public function setContentType(?StdContentTypes $contentType): self
  96.     {
  97.         $this->contentType $contentType;
  98.         return $this;
  99.     }
  100.     public function getIsActive(): ?bool
  101.     {
  102.         return $this->isActive;
  103.     }
  104.     public function setIsActive(bool $isActive): self
  105.     {
  106.         $this->isActive $isActive;
  107.         return $this;
  108.     }
  109.     public function getCreatedDate(): ?\DateTimeInterface
  110.     {
  111.         return $this->createdDate;
  112.     }
  113.     public function setCreatedDate(\DateTimeInterface $createdDate): self
  114.     {
  115.         $this->createdDate $createdDate;
  116.         return $this;
  117.     }
  118.     public function getUpdatedDate(): ?\DateTimeInterface
  119.     {
  120.         return $this->updatedDate;
  121.     }
  122.     public function setUpdatedDate(\DateTimeInterface $updatedDate): self
  123.     {
  124.         $this->updatedDate $updatedDate;
  125.         return $this;
  126.     }
  127.     public function getCreatedBy(): ?StdUsers
  128.     {
  129.         return $this->createdBy;
  130.     }
  131.     public function setCreatedBy(?StdUsers $createdBy): self
  132.     {
  133.         $this->createdBy $createdBy;
  134.         return $this;
  135.     }
  136.     public function getUpdatedBy(): ?StdUsers
  137.     {
  138.         return $this->updatedBy;
  139.     }
  140.     public function setUpdatedBy(?StdUsers $updatedBy): self
  141.     {
  142.         $this->updatedBy $updatedBy;
  143.         return $this;
  144.     }
  145.     
  146.     public function getLayout(): ?string
  147.     {
  148.         return $this->layout;
  149.     }
  150.     public function setLayout(?string $layout): self
  151.     {
  152.         $this->layout $layout;
  153.         return $this;
  154.     }
  155.      #[ORM\PreUpdate]
  156.     public function setUpdated()
  157.     {
  158.         $this->setUpdatedDate(new \DateTime());
  159.     }
  160.     
  161.     #[ORM\PrePersist]
  162.     public function setCreated()
  163.     {
  164.         $this->setUpdatedDate(new \DateTime());
  165.         $this->setCreatedDate(new \DateTime());
  166.     }
  167.     public function __toString() {
  168.         return $this->name;
  169.     }
  170. }