new Link( fromClass: self::class, identifiers: ['date'], ), ], provider: ResolvedScheduleWeekProvider::class, name: 'get_resolved_schedule_week', ), ], )] final class ResolvedScheduleSlotResource { #[ApiProperty(identifier: true)] public ?string $id = null; public ?string $slotId = null; public ?string $classId = null; public ?string $subjectId = null; public ?string $teacherId = null; public ?int $dayOfWeek = null; public ?string $startTime = null; public ?string $endTime = null; public ?string $room = null; public ?string $date = null; public ?bool $isModified = null; public ?string $exceptionId = null; public static function fromDomain(ResolvedScheduleSlot $resolved): self { $resource = new self(); $resource->id = (string) $resolved->slotId . '_' . $resolved->date->format('Y-m-d'); $resource->slotId = (string) $resolved->slotId; $resource->classId = (string) $resolved->classId; $resource->subjectId = (string) $resolved->subjectId; $resource->teacherId = (string) $resolved->teacherId; $resource->dayOfWeek = $resolved->dayOfWeek->value; $resource->startTime = $resolved->timeSlot->startTime; $resource->endTime = $resolved->timeSlot->endTime; $resource->room = $resolved->room; $resource->date = $resolved->date->format('Y-m-d'); $resource->isModified = $resolved->isModified; $resource->exceptionId = $resolved->exceptionId !== null ? (string) $resolved->exceptionId : null; return $resource; } }