time_start = new DateTime(); $this->time_end = new DateTime(); $this->break_start = new DateTime(); $this->break_end = new DateTime(); } public function getID() { return $this->id; } public function setRider(Rider $rider) { $this->rider = $rider; return $this; } public function getRider() { return $this->rider; } public function setDayOfWeek($day) { $this->day_of_week = $day; return $this; } public function getDayOfWeek() { return $this->day_of_week; } public function setTimeStart($time) { $this->time_start = $this->parseTime($time); return $this; } public function getTimeStart() { return $this->time_start; } public function setTimeEnd($time) { $this->time_end = $this->parseTime($time); return $this; } public function getTimeEnd() { return $this->time_end; } public function setBreakStart($time) { $this->break_start = $this->parseTime($time); return $this; } public function getBreakStart() { return $this->break_start; } public function setBreakEnd($time) { $this->break_end = $this->parseTime($time); return $this; } public function getBreakEnd() { return $this->break_end; } protected function parseTime($string, $format = 'g:i A') { return DateTime::createFromFormat($format, $string) ?? null; } }