ogcore/src/Dto/Output/PxeTemplateOutput.php

34 lines
906 B
PHP

<?php
namespace App\Dto\Output;
use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\Get;
use App\Entity\PxeTemplate;
use Symfony\Component\Serializer\Annotation\Groups;
#[Get(shortName: 'PxeTemplate')]
final class PxeTemplateOutput extends AbstractOutput
{
#[Groups(['pxe-template:read'])]
public string $name;
#[Groups(['pxe-template:read'])]
public ?string $templateContent = '';
#[Groups(['pxe-template:read'])]
public \DateTime $createdAt;
#[Groups(['pxe-template:read'])]
public ?string $createdBy = null;
public function __construct(PxeTemplate $pxeTemplate)
{
parent::__construct($pxeTemplate);
$this->name = $pxeTemplate->getName();
$this->templateContent = $pxeTemplate->getTemplateContent();
$this->createdAt = $pxeTemplate->getCreatedAt();
$this->createdBy = $pxeTemplate->getCreatedBy();
}
}