TranslationItemDTO.php 392 B

123456789101112131415161718192021
  1. <?php
  2. namespace App\DTO\LLMTranslation;
  3. use App\DTO\BaseDTO;
  4. readonly class TranslationItemDTO extends BaseDTO
  5. {
  6. public function __construct(
  7. public string $id,
  8. public string $content,
  9. ) {}
  10. public static function fromArray(array $data): self
  11. {
  12. return new self(
  13. id: $data['id'],
  14. content: $data['content'],
  15. );
  16. }
  17. }