<?php
namespace App\Admin\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* StdPages
*/
#[ORM\Table(name: 'std_templates')]
#[ORM\Index(name: 'fk_std_templates_std_users', columns: ['created_by'])]
#[ORM\Index(name: 'fk_std_templates_std_users_0', columns: ['updated_by'])]
#[ORM\Index(name: 'fk_std_templates_std_content_types', columns: ['content_type'])]
#[ORM\Entity]
class StdTemplates
{
/**
* @var int
*/
#[ORM\Column(name: 'id', type: 'integer', nullable: false, options: ['unsigned' => true, 'comment' => 'Unique identifier'])]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private $id;
/**
* @var string
*/
#[ORM\Column(name: 'name', type: 'string', length: 100, nullable: true, options: ['comment' => 'Template name'])]
private $name;
/**
* @var string
*/
#[ORM\Column(name: 'machine_name', type: 'string', length: 50, nullable: true, options: ['comment' => 'Machine name of the template'])]
private $machineName;
/**
* @var \StdContentTypes
*/
#[ORM\JoinColumn(name: 'content_type', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: 'StdContentTypes')]
private $contentType;
/**
* @var bool
*/
#[ORM\Column(name: 'is_active', type: 'boolean', nullable: true, options: ['default' => 1, 'comment' => 'Flag that indicates if the template is active'])]
private $isActive = '1';
/**
* @var \StdUsers
*/
#[ORM\JoinColumn(name: 'created_by', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: 'StdUsers')]
private $createdBy;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'created_date', type: 'datetime', nullable: false, options: ['comment' => 'Date and time of the record creation'])]
private $createdDate;
/**
* @var \StdUsers
*/
#[ORM\JoinColumn(name: 'updated_by', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: 'StdUsers')]
private $updatedBy;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'updated_date', type: 'datetime', nullable: false, options: ['comment' => 'Date and time the record was last updated'])]
private $updatedDate;
/**
* @var string
*/
#[ORM\Column(name: 'layout', type: 'string', length: 100, nullable: true, options: ['comment' => 'Page layout'])]
private $layout;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getMachineName(): ?string
{
return $this->machineName;
}
public function setMachineName(string $machineName): self
{
$this->machineName = $machineName;
return $this;
}
public function getContentType(): ?StdContentTypes
{
return $this->contentType;
}
public function setContentType(?StdContentTypes $contentType): self
{
$this->contentType = $contentType;
return $this;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getCreatedDate(): ?\DateTimeInterface
{
return $this->createdDate;
}
public function setCreatedDate(\DateTimeInterface $createdDate): self
{
$this->createdDate = $createdDate;
return $this;
}
public function getUpdatedDate(): ?\DateTimeInterface
{
return $this->updatedDate;
}
public function setUpdatedDate(\DateTimeInterface $updatedDate): self
{
$this->updatedDate = $updatedDate;
return $this;
}
public function getCreatedBy(): ?StdUsers
{
return $this->createdBy;
}
public function setCreatedBy(?StdUsers $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
public function getUpdatedBy(): ?StdUsers
{
return $this->updatedBy;
}
public function setUpdatedBy(?StdUsers $updatedBy): self
{
$this->updatedBy = $updatedBy;
return $this;
}
public function getLayout(): ?string
{
return $this->layout;
}
public function setLayout(?string $layout): self
{
$this->layout = $layout;
return $this;
}
#[ORM\PreUpdate]
public function setUpdated()
{
$this->setUpdatedDate(new \DateTime());
}
#[ORM\PrePersist]
public function setCreated()
{
$this->setUpdatedDate(new \DateTime());
$this->setCreatedDate(new \DateTime());
}
public function __toString() {
return $this->name;
}
}