Resolve "Make command to test getClosestOpenHubs" #1575

Merged
korina.cordero merged 2 commits from 652-make-command-to-test-getclosestopenhubs into master 2022-03-24 08:20:53 +00:00
Showing only changes of commit 3e238347be - Show all commits

View file

@ -13,7 +13,7 @@ use App\Service\MapTools;
class TestClosestOpenHubsCommand extends Command
{
$protected $maptools;
protected $maptools;
protected function configure()
{
@ -37,7 +37,16 @@ class TestClosestOpenHubsCommand extends Command
$lat = $input->getArgument('lat');
$point = new Point($long, $lat);
$this->maptools->getClosestOpenHubs();
$hubs_with_distance = $this->maptools->getClosestOpenHubs($point, 10);
foreach($hubs_with_distance as $hub_dist)
{
$hub = $hub_dist['hub'];
$distance = $hub_dist['distance'];
error_log('Hub ID ' . $hub->getID() . ' - ' . $hub->getName() . ' = ' . $distance . ' kms away.');
}
return 0;
}