60 lines
1.1 KiB
PHP
60 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Schedule;
|
|
|
|
use App\User\User;
|
|
use DateTimeImmutable;
|
|
|
|
final readonly class Schedule
|
|
{
|
|
/**
|
|
* @param list<ScheduleAssignment> $assignments
|
|
*/
|
|
public function __construct(
|
|
private int $id,
|
|
private User $user,
|
|
private string $setName,
|
|
private string $elementKind,
|
|
private DateTimeImmutable $startDate,
|
|
private DateTimeImmutable $targetDate,
|
|
private array $assignments,
|
|
) {}
|
|
|
|
public function getId(): int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getUser(): User
|
|
{
|
|
return $this->user;
|
|
}
|
|
|
|
public function getSetName(): string
|
|
{
|
|
return $this->setName;
|
|
}
|
|
|
|
public function getElementKind(): string
|
|
{
|
|
return $this->elementKind;
|
|
}
|
|
|
|
public function getStartDate(): DateTimeImmutable
|
|
{
|
|
return $this->startDate;
|
|
}
|
|
|
|
public function getTargetDate(): DateTimeImmutable
|
|
{
|
|
return $this->targetDate;
|
|
}
|
|
|
|
/**
|
|
* @return list<ScheduleAssignment>
|
|
*/
|
|
public function getAssignments(): array
|
|
{
|
|
return $this->assignments;
|
|
}
|
|
}
|