mirror of
https://github.com/quentin-g-dev/afup.git
synced 2026-03-25 17:52:13 +01:00
On sychronise la liste membre automatique en arrière plan via une commande qu'on lancera régulièrement dans une cron. Cela permettra d'éviter des problèmes ou la liste n'est pas à jour.
33 lines
732 B
PHP
33 lines
732 B
PHP
<?php
|
|
|
|
namespace AppBundle\Command;
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
|
|
class SynchMembersCommand extends ContainerAwareCommand
|
|
{
|
|
/**
|
|
* @see Command
|
|
*/
|
|
protected function configure()
|
|
{
|
|
$this->setName('sync-members');
|
|
}
|
|
|
|
/**
|
|
* @see Command
|
|
*/
|
|
protected function execute(InputInterface $input, OutputInterface $output)
|
|
{
|
|
$container = $this->getContainer();
|
|
|
|
$container
|
|
->get('app.mailchimp_members_auto_synchronizer')
|
|
->setLogger($container->get('logger'))
|
|
->synchronize()
|
|
;
|
|
}
|
|
}
|