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

getContext() protected method

Returns a context object
protected getContext ( ) : Aimeos\MShop\Context\Item\Standard
return Aimeos\MShop\Context\Item\Standard Context object
    protected function getContext()
    {
        $container = $this->getContainer();
        $aimeos = $container->get('aimeos')->get();
        $context = $container->get('aimeos_context')->get(false, 'command');
        $tmplPaths = $aimeos->getCustomPaths('controller/jobs/templates');
        $tmplPaths = array_merge($tmplPaths, $aimeos->getCustomPaths('client/html/templates'));
        $view = $container->get('aimeos_view')->create($context, $tmplPaths);
        $langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context)->getSubManager('language');
        $langids = array_keys($langManager->searchItems($langManager->createSearch(true)));
        $i18n = $this->getContainer()->get('aimeos_i18n')->get($langids);
        $context->setEditor('aimeos:jobs');
        $context->setView($view);
        $context->setI18n($i18n);
        return $context;
    }