| Current Path : /var/www/v3.cesa.co.za/src/EventBundle/Command/ |
| Current File : /var/www/v3.cesa.co.za/src/EventBundle/Command/MailChimpCombinedCommand.php |
<?php
namespace App\EventBundle\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use App\CoreBundle\Services\ServiceGetterManager;
/**
* Mail Chimp Command
*
* @author Otto Saayman <otto@igotafrica.com>
* @package EventBundle
* @subpackage Controller
* @version 0.0.1
*/
class MailChimpCombinedCommand extends Command
{
private $serviceGetterManager;
public function __construct(ServiceGetterManager $serviceGetterManager)
{
$this->serviceGetterManager = $serviceGetterManager;
parent::__construct();
}
protected function configure()
{
$this
->setName('combined_attendee:mc_synch')
->setDescription('Synch school and marketing attendee data to MailChimp')
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('Combined MailChimp Synch Starting...');
$_SERVER["HTTP_HOST"] = 'v3.cesa.co.za';
// $_SERVER['DOCUMENT_ROOT'] = '/usr/www/users/saacea/v3.cesa.co.za';
$marketingAttendeeManager = $this->serviceGetterManager->get('marketing_attendee.manager');
$marketingAttendeeManager->mailChimpSynchCombined();
$output->writeln('Combined MailChimp Synch Complete');
return Command::SUCCESS;
}
}