setDescription('Geocode tt_address records') ->addArgument( 'key', InputArgument::REQUIRED, 'Google Maps key for geocoding' ); } /** * Geocode all records * * @inheritdoc * @return int */ protected function execute(InputInterface $input, OutputInterface $output): int { $this->getGeocodeService($input->getArgument('key'))->calculateCoordinatesForAllRecordsInTable(); return 0; } /** * @param string $key Google Maps key * @return GeocodeService */ protected function getGeocodeService(string $key) { return GeneralUtility::makeInstance(GeocodeService::class, $key); } }