ogcore/src/Dto/Output/OgLiveOutput.php

74 lines
2.0 KiB
PHP

<?php
namespace App\Dto\Output;
use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\Get;
use App\Entity\OgLive;
use Symfony\Component\Serializer\Annotation\Groups;
#[Get(shortName: 'OgLive')]
final class OgLiveOutput extends AbstractOutput
{
#[Groups(['og-live:read', 'client:read', "organizational-unit:read"])]
public string $name;
#[Groups(['og-live:read'])]
public ?bool $synchronized = false;
#[Groups(['og-live:read'])]
public ?bool $installed = false;
#[Groups(['og-live:read'])]
public ?bool $isDefault = false;
#[Groups(['og-live:read'])]
public ?string $downloadUrl = '';
#[Groups(['og-live:read'])]
public ?string $status = '';
#[Groups(['og-live:read'])]
public ?string $checksum = '';
#[Groups(['og-live:read'])]
public ?string $distribution = '';
#[Groups(['og-live:read'])]
public ?string $revision = '';
#[Groups(['og-live:read'])]
public ?string $filename = '';
#[Groups(['og-live:read'])]
public ?string $kernel = '';
#[Groups(['og-live:read'])]
public ?string $architecture = '';
#[Groups(['og-live:read'])]
public \DateTime $createdAt;
#[Groups(['og-live:read'])]
public ?string $createdBy = null;
public function __construct(OgLive $ogLive)
{
parent::__construct($ogLive);
$this->name = $ogLive->getName();
$this->synchronized = $ogLive->isSynchronized();
$this->installed = $ogLive->isInstalled();
$this->isDefault = $ogLive->getIsDefault();
$this->downloadUrl = $ogLive->getDownloadUrl();
$this->distribution = $ogLive->getDistribution();
$this->revision = $ogLive->getRevision();
$this->filename = $ogLive->getFilename();
$this->checksum = $ogLive->getChecksum();
$this->kernel = $ogLive->getKernel();
$this->architecture = $ogLive->getArchitecture();
$this->status = $ogLive->getStatus();
$this->createdAt = $ogLive->getCreatedAt();
$this->createdBy = $ogLive->getCreatedBy();
}
}