Files
afup/sources/AppBundle/Command/SynchMembersCommand.php
Adrien Gallou 8f449e29eb ajout d'une commande de synchronisation de la liste membres-automatique
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.
2020-10-11 15:29:10 +02:00

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()
;
}
}