From b7e8844175ccee22b44f2a7f57e5526b9bbb105c Mon Sep 17 00:00:00 2001 From: Bartek Fabiszewski Date: Fri, 25 Aug 2017 12:45:50 +0200 Subject: [PATCH] Add method to add position to track object --- helpers/track.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/helpers/track.php b/helpers/track.php index a6b3b78..d48b35a 100644 --- a/helpers/track.php +++ b/helpers/track.php @@ -89,6 +89,29 @@ return $trackId; } + /** + * Add new position to track + * + * @param int $userId + * @param int $time Unix time stamp + * @param double $lat + * @param double $lon + * @param double $altitude Optional + * @param double $speed Optional + * @param double $bearing Optional + * @param int $accuracy Optional + * @param string $provider Optional + * @param string $comment Optional + * @param int $imageId Optional + * @return int|bool New position id in database, false on error + */ + public function addPosition($userId, $timestamp, $lat, $lon, + $altitude = NULL, $speed = NULL, $bearing = NULL, $accuracy = NULL, + $provider = NULL, $comment = NULL, $imageId = NULL) { + return $ret = uPosition::add($userId, $this->id, $timestamp, $lat, $lon, + $altitude, $speed, $bearing, $accuracy, $provider, $comment, $imageId); + } + /** * Delete track with all positions *