src/Entity/CRM/PromptTemplateVersion.php line 12
<?phpnamespace App\Entity\CRM;use App\Repository\CRM\PromptTemplateVersionRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: PromptTemplateVersionRepository::class)]#[ORM\Table(name: 'prompt_template_version')]#[ORM\UniqueConstraint(name: 'uniq_prompt_template_version', columns: ['template_id', 'version'])]class PromptTemplateVersion{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\ManyToOne(inversedBy: 'versions')]#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]private ?PromptTemplate $template = null;#[ORM\Column]private int $version = 1;#[ORM\Column(type: Types::TEXT)]private string $content = '';#[ORM\Column(length: 64, nullable: true)]private ?string $model = null;/*** @var array<string, mixed>|null*/#[ORM\Column(type: Types::JSON, nullable: true)]private ?array $parameters = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $note = null;#[ORM\ManyToOne]#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]private ?Admin $createdBy = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private \DateTimeInterface $createdAt;#[ORM\Column]private bool $active = false;public function __construct(){$this->createdAt = new \DateTimeImmutable();}public function __toString(): string{$tplName = $this->template !== null ? $this->template->getName() : 'prompt';return sprintf('%s v%d', $tplName, $this->version);}public function getId(): ?int{return $this->id;}public function getTemplate(): ?PromptTemplate{return $this->template;}public function setTemplate(?PromptTemplate $template): static{$this->template = $template;return $this;}public function getVersion(): int{return $this->version;}public function setVersion(int $version): static{$this->version = $version;return $this;}public function getContent(): string{return $this->content;}public function setContent(string $content): static{$this->content = $content;return $this;}public function getModel(): ?string{return $this->model;}public function setModel(?string $model): static{$this->model = $model;return $this;}/*** @return array<string, mixed>|null*/public function getParameters(): ?array{return $this->parameters;}/*** @param array<string, mixed>|null $parameters*/public function setParameters(?array $parameters): static{$this->parameters = $parameters;return $this;}public function getNote(): ?string{return $this->note;}public function setNote(?string $note): static{$this->note = $note;return $this;}public function getCreatedBy(): ?Admin{return $this->createdBy;}public function setCreatedBy(?Admin $createdBy): static{$this->createdBy = $createdBy;return $this;}public function getCreatedAt(): \DateTimeInterface{return $this->createdAt;}public function setCreatedAt(\DateTimeInterface $createdAt): static{$this->createdAt = $createdAt;return $this;}public function isActive(): bool{return $this->active;}public function setActive(bool $active): static{$this->active = $active;return $this;}}