66 lines
1.3 KiB
PHP
66 lines
1.3 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace App\Domain\AI;
|
||
|
|
|
||
|
|
use Doctrine\ORM\Mapping as ORM;
|
||
|
|
use Symfony\Component\Uid\Uuid;
|
||
|
|
|
||
|
|
#[ORM\Entity]
|
||
|
|
#[ORM\Table(name: 'prompt_templates', schema: 'app')]
|
||
|
|
class PromptTemplate
|
||
|
|
{
|
||
|
|
#[ORM\Id]
|
||
|
|
#[ORM\Column(type: 'uuid')]
|
||
|
|
private Uuid $id;
|
||
|
|
|
||
|
|
#[ORM\Column(type: 'string', length: 100, unique: true)]
|
||
|
|
private string $key;
|
||
|
|
|
||
|
|
#[ORM\Column(type: 'text')]
|
||
|
|
private string $body;
|
||
|
|
|
||
|
|
#[ORM\Column(type: 'datetime_immutable')]
|
||
|
|
private \DateTimeImmutable $updatedAt;
|
||
|
|
|
||
|
|
public function __construct(string $key, string $body)
|
||
|
|
{
|
||
|
|
$this->id = Uuid::v7();
|
||
|
|
$this->key = $key;
|
||
|
|
$this->body = $body;
|
||
|
|
$this->updatedAt = new \DateTimeImmutable();
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getId(): Uuid
|
||
|
|
{
|
||
|
|
return $this->id;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getKey(): string
|
||
|
|
{
|
||
|
|
return $this->key;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getBody(): string
|
||
|
|
{
|
||
|
|
return $this->body;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getUpdatedAt(): \DateTimeImmutable
|
||
|
|
{
|
||
|
|
return $this->updatedAt;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function setKey(string $key): void
|
||
|
|
{
|
||
|
|
$this->key = $key;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function setBody(string $body): void
|
||
|
|
{
|
||
|
|
$this->body = $body;
|
||
|
|
$this->updatedAt = new \DateTimeImmutable();
|
||
|
|
}
|
||
|
|
}
|