public function get($locale = true, $type = 'frontend')
{
$config = $this->container->get('aimeos_config')->get($type);
if (self::$context === null) {
$context = new \Aimeos\MShop\Context\Item\Standard();
$context->setConfig($config);
$this->addDataBaseManager($context);
$this->addFilesystemManager($context);
$this->addMessageQueueManager($context);
$this->addLogger($context);
$this->addCache($context);
$this->addMailer($context);
self::$context = $context;
}
$context = self::$context;
$context->setConfig($config);
if ($locale === true) {
$localeItem = $this->container->get('aimeos_locale')->get($context);
$context->setI18n($this->container->get('aimeos_i18n')->get(array($localeItem->getLanguageId())));
$context->setLocale($localeItem);
}
$this->addSession($context);
$this->addUserGroups($context);
return $context;
}