/** * Post the workout end data. * * TODO Implement. * * @param Track $track The track. * @param float $speed The speed for the last point. * @return string The workout ID. */ private function flattenEndWorkoutTrackPoint(Track $track, $speed) { $endDateTime = clone $track->getEndDateTime(); $endDateTime->setTimezone(new \DateTimeZone('UTC')); $distance = $track->getLength(); $lastTrackPoint = $track->getLastTrackPoint(); $totalAscent = $lastTrackPoint->getElevation(); // TODO Compute it from the track, this is not correct. return $this->formatEndomondoTrackPoint($endDateTime, self::INSTRUCTION_STOP, $lastTrackPoint->getLatitude(), $lastTrackPoint->getLongitude(), $distance, $speed, $totalAscent, $lastTrackPoint->hasExtension(HR::ID) ? $lastTrackPoint->getExtension(HR::ID)->getValue() : ''); }