Resolve "Transition branch for CMB and Resq merging" #1181

Merged
korina.cordero merged 258 commits from 329-transition-branch-for-cmb-and-resq-merging into master 2020-04-03 02:49:26 +00:00
Showing only changes of commit 2f3e8df6d4 - Show all commits

View file

@ -38,15 +38,18 @@ class RiderTracker
$long = $this->redis->hget($key, 'longitude');
$lat = $this->redis->hget($key, 'latitude');
$coordinates = new Point($long, $lat);
}
else
{
$rider = $this->em->getRepository(Rider::class)->find($rider_id);
$coordinates = $rider->getHub()->getCoordinates();
return new Point($long, $lat);
}
return $coordinates;
// not in cache, get hub
$rider = $this->em->getRepository(Rider::class)->find($rider_id);
$hub = $rider->getHub();
// no hub
// TODO: return valid coordinate
if ($hub == null)
return new Point(0, 0);
return $hub->getCoordinates();
}
}