Erweitere die Klassen
This commit is contained in:
@@ -10,8 +10,9 @@ use JetBrains\PhpStorm\ArrayShape;
|
||||
|
||||
class WorkingHours implements ModelInterface
|
||||
{
|
||||
protected ?DateTime $workingDay = null;
|
||||
protected ?DateTime $workingDay = null;
|
||||
protected ?DateInterval $workingTime = null;
|
||||
protected bool $isHomeOffice = false;
|
||||
|
||||
public function getWorkingDay(): ?DateTime
|
||||
{
|
||||
@@ -35,15 +36,27 @@ class WorkingHours implements ModelInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isHomeOffice(): bool
|
||||
{
|
||||
return $this->isHomeOffice;
|
||||
}
|
||||
|
||||
public function setIsHomeOffice(bool $isHomeOffice): WorkingHours
|
||||
{
|
||||
$this->isHomeOffice = $isHomeOffice;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
#[ArrayShape(['workingDay' => "string", 'workingTime' => "string"])]
|
||||
#[ArrayShape(['workingDay' => "string", 'workingTime' => "string", 'isHomeOffice' => "boolean"])]
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return [
|
||||
'workingDay' => $this->getWorkingDay()->format('Y-m-d'),
|
||||
'workingTime' => $this->getWorkingTime()->format('%H:%I:%S')
|
||||
'workingDay' => $this->getWorkingDay()->format('Y-m-d'),
|
||||
'workingTime' => $this->getWorkingTime()->format('%H:%I:%S'),
|
||||
'isHomeOffice' => $this->isHomeOffice(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user