location_id = $location_id; $this->start_date_time = $start_date_time; $this->end_date_time = $end_date_time; } /** * @return int */ public function getLocationId() { return $this->location_id; } /** * @return DateTime */ public function getStartDateTime() { return $this->start_date_time; } /** * @return DateTime */ public function getEndDateTime() { return $this->end_date_time; } /** * @return int */ public function getTotalMinutes(){ $interval = $this->end_date_time->diff($this->start_date_time); $total_minutes = $interval->days * 24 * 60; $total_minutes += $interval->h * 60; $total_minutes += $interval->i; return intval($total_minutes); } }