Your IP : 216.73.217.117


Current Path : /var/www/v3.cesa.co.za/src/EventBundle/Command/
Upload File :
Current File : /var/www/v3.cesa.co.za/src/EventBundle/Command/MailChimpSCECommand.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 MailChimpSCECommand extends Command {

    private $serviceGetterManager;

    public function __construct(ServiceGetterManager $serviceGetterManager) {

        $this->serviceGetterManager = $serviceGetterManager;

        parent::__construct();
    }

    protected function configure() {
        $this
                ->setName('school_attendee:mc_synch')
                ->setDescription('Synch school attendee data to MailChimp')
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output) {

        $output->writeln('MailChimp Synch Starting...');

        $_SERVER["HTTP_HOST"] = 'v3.cesa.co.za';
//        $_SERVER['DOCUMENT_ROOT'] = '/usr/www/users/saacea/v3.cesa.co.za';

        $schoolAttendeeManager = $this->serviceGetterManager->get('school_attendee.manager');

        $schoolAttendeeManager->mailChimpSynch();

        $output->writeln('MailChimp Synch Complete');

        return Command::SUCCESS;
    }
}