/** * @return TicketTimeline|null|object */ protected function getCurrentDayRecord() { if ($this->currentDayRecord) { return $this->currentDayRecord; } $date = new \DateTime('now', new \DateTimeZone('UTC')); $date->setTime(0, 0, 0); $this->currentDayRecord = $this->timelineRepository->findOneBy(['date' => $date]); if (!$this->currentDayRecord) { $this->currentDayRecord = new TicketTimeline($date); } return $this->currentDayRecord; }