Aimeos\ShopBundle\Command\JobsCommand::execute PHP Method

execute() protected method

Executes the job controllers.
protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface Input object
$output Symfony\Component\Console\Output\OutputInterface Output object
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $context = $this->getContext();
        $aimeos = $this->getContainer()->get('aimeos')->get();
        $jobs = explode(' ', $input->getArgument('jobs'));
        $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
        foreach ($this->getSiteItems($context, $input) as $siteItem) {
            $localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false);
            $localeItem->setLanguageId(null);
            $localeItem->setCurrencyId(null);
            $context->setLocale($localeItem);
            $output->writeln(sprintf('Executing the Aimeos jobs for "<info>%s</info>"', $siteItem->getCode()));
            foreach ($jobs as $jobname) {
                \Aimeos\Controller\Jobs\Factory::createController($context, $aimeos, $jobname)->run();
            }
        }
    }