Files
exchange-2.0/app/Classes/Modules/KeyValuePairs/DataTransferObjects/UpdateChatGPTPromptDTO.php
T
2025-12-27 14:44:01 +08:00

45 lines
902 B
PHP

<?php
namespace App\Classes\Modules\KeyValuePairs\DataTransferObjects;
use App\Classes\General\Interfaces\DataTransferObject;
class UpdateChatGPTPromptDTO implements DataTransferObject
{
public int $id;
public string $title;
public string $prompt;
public function __construct(array $data)
{
$this->id = (int) ($data['id'] ?? 0);
$this->title = (string) ($data['key'] ?? '');
$this->prompt = (string) ($data['value'] ?? '');
}
public function toArray(): array
{
return [
'id' => $this->id,
'title' => $this->title,
'prompt' => $this->prompt,
];
}
public function getId(): int
{
return $this->id;
}
public function getTitle(): string
{
return $this->title;
}
public function getPrompt(): string
{
return $this->prompt;
}
}