ogcore/src/Dto/Output/RemoteCalendarRuleOutput.php

45 lines
1.7 KiB
PHP

<?php
namespace App\Dto\Output;
use ApiPlatform\Metadata\Get;
use App\Entity\RemoteCalendarRule;
use Symfony\Component\Serializer\Annotation\Groups;
#[Get(shortName: 'RemoteCalendarRule')]
final class RemoteCalendarRuleOutput extends AbstractOutput
{
#[Groups(['remote-calendar-rule:read', 'remote-calendar:read'])]
public ?array $busyWeekDays = null;
#[Groups(['remote-calendar-rule:read', 'remote-calendar:read'])]
public ?string $busyFromHour = null;
#[Groups(['remote-calendar-rule:read', 'remote-calendar:read'])]
public ?string $busyToHour = null;
#[Groups(['remote-calendar-rule:read', 'remote-calendar:read'])]
public ?bool $isRemoteAvailable = false;
#[Groups(['remote-calendar-rule:read', 'remote-calendar:read'])]
public ?\DateTimeInterface $availableFromDate = null;
#[Groups(['remote-calendar-rule:read', 'remote-calendar:read'])]
public ?\DateTimeInterface $availableToDate = null;
#[Groups(['remote-calendar-rule:read', 'remote-calendar:read'])]
public ?string $availableReason = null;
public function __construct(RemoteCalendarRule $remoteCalendarRule)
{
parent::__construct($remoteCalendarRule);
$this->busyWeekDays = $remoteCalendarRule->getBusyWeekDays();
$this->busyFromHour = $remoteCalendarRule->getBusyFromHour();
$this->busyToHour = $remoteCalendarRule->getBusyToHour();
$this->isRemoteAvailable = $remoteCalendarRule->isRemoteAvailable();
$this->availableFromDate = $remoteCalendarRule->getAvailableFromDate();
$this->availableToDate = $remoteCalendarRule->getAvailableToDate();
$this->availableReason = $remoteCalendarRule->getAvailableReason();
}
}