dateFrom) { return $this->_period->first()->toDateTimeImmutable(); } return $this->dateFrom; } public function getDateTo(): ?\DateTimeImmutable { if (null === $this->dateTo) { return $this->_period->last()->toDateTimeImmutable(); } return $this->dateTo; } public function getPeriod(): ?CarbonPeriod { return $this->_period; } public function setPeriod(?CarbonPeriod $_period): static { $this->_period = $_period; return $this; } }