startDate = $startDate ?? new DateTimeImmutable('now'); $this->accompanyingPeriod = $accompanyingPeriod; $this->user = $user; } public function getAccompanyingPeriod(): AccompanyingPeriod { return $this->accompanyingPeriod; } public function getEndDate(): ?DateTimeImmutable { return $this->endDate; } public function getId(): ?int { return $this->id; } public function getStartDate(): DateTimeImmutable { return $this->startDate; } public function getUser(): User { return $this->user; } public function setEndDate(?DateTimeImmutable $endDate): UserHistory { $this->endDate = $endDate; return $this; } }