mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
Feature: load french postal code from laposte hexasmal open data
This commit is contained in:
42
src/Bundle/ChillMainBundle/Command/LoadPostalCodeFR.php
Normal file
42
src/Bundle/ChillMainBundle/Command/LoadPostalCodeFR.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Command;
|
||||
|
||||
use Chill\MainBundle\Service\Import\PostalCodeFRFromOpenData;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class LoadPostalCodeFR extends Command
|
||||
{
|
||||
private PostalCodeFRFromOpenData $loader;
|
||||
|
||||
public function __construct(PostalCodeFRFromOpenData $loader)
|
||||
{
|
||||
$this->loader = $loader;
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function configure(): void
|
||||
{
|
||||
$this->setName('chill:main:postal-code:load:FR')
|
||||
->setDescription('Load France\'s postal code from online open data');
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$this->loader->import();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user