Make some parameters optional in add position

This commit is contained in:
Bartek Fabiszewski 2017-08-17 17:19:14 +02:00
parent 4ddbbb9807
commit ca5e985fb4

View File

@ -83,16 +83,18 @@
* @param int $time Unix time stamp * @param int $time Unix time stamp
* @param double $lat * @param double $lat
* @param double $lon * @param double $lon
* @param double $altitude * @param double $altitude Optional
* @param double $speed * @param double $speed Optional
* @param double $bearing * @param double $bearing Optional
* @param int $accuracy * @param int $accuracy Optional
* @param string $provider * @param string $provider Optional
* @param string $comment * @param string $comment Optional
* @param int $imageId * @param int $imageId Optional
* @return int|bool New position id in database, false on error * @return int|bool New position id in database, false on error
*/ */
public static function add($userId, $trackId, $timestamp, $lat, $lon, $altitude, $speed, $bearing, $accuracy, $provider, $comment, $imageId) { public static function add($userId, $trackId, $timestamp, $lat, $lon,
$altitude = NULL, $speed = NULL, $bearing = NULL, $accuracy = NULL,
$provider = NULL, $comment = NULL, $imageId = NULL) {
$positionId = false; $positionId = false;
if (!is_null($lat) && !is_null($lon) && !is_null($timestamp) && !empty($userId) && !empty($trackId)) { if (!is_null($lat) && !is_null($lon) && !is_null($timestamp) && !empty($userId) && !empty($trackId)) {
$track = new uTrack($trackId); $track = new uTrack($trackId);