<?php
namespace AppBundle\Command;


use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;

class CheckProductCommand extends ContainerAwareCommand
{
    protected function configure()
    {
         $this
        ->setName('app:check:product')
        ->setDescription('Check if a product\' status should be changed.')
        ->setHelp('This command allows you to change product\' status');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $style = new OutputFormatterStyle('red', 'yellow', array('bold', 'blink'));
        $output->getFormatter()->setStyle('fire', $style);
        $output->writeln([
        'Check PRODUCT',
        '============',
        '',
        ]);
        $output->writeln('Chuck is in da place');
        $output->writeln('Executing check PRODUCT script');
        $productManager = $this->getContainer()->get('app.product_manager');
        $productManager->checkProduct($output);
    }
}