Initial commit - Typo3 11.5.41

This commit is contained in:
Matteo Gallo
2026-07-03 17:53:31 +02:00
commit 5ca4743197
6811 changed files with 568848 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
<?php
declare(strict_types=1);
namespace FriendsOfTYPO3\TtAddress\Command;
/**
* This file is part of the "tt_address" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*/
use FriendsOfTYPO3\TtAddress\Service\GeocodeService;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Command for geocoding coordinates
*/
class GeocodeCommand extends Command
{
/**
* Defines the allowed options for this command
*
* @inheritdoc
*/
protected function configure()
{
$this
->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);
}
}