ogcore/src/Dto/Output/OperativeSystemOutput.php

21 lines
490 B
PHP

<?php
namespace App\Dto\Output;
use ApiPlatform\Metadata\Get;
use App\Entity\OperativeSystem;
use Symfony\Component\Serializer\Annotation\Groups;
#[Get(shortName: 'OperativeSystem')]
final class OperativeSystemOutput extends AbstractOutput
{
#[Groups(['operative-system:read'])]
public string $name;
public function __construct(OperativeSystem $operativeSystem)
{
parent::__construct($operativeSystem);
$this->name = $operativeSystem->getName();
}
}