6 declare(strict_types=1);
25 private $storeCookieManager;
35 private $storeManager;
44 HttpContext $httpContext,
47 $this->storeCookieManager = $storeCookieManager;
48 $this->httpContext = $httpContext;
60 $defaultStoreView = $this->storeManager->getDefaultStoreView();
61 if ($defaultStoreView !==
null) {
62 if ($defaultStoreView->getId() === $targetStore->
getId()) {
63 $this->storeCookieManager->deleteStoreCookie($targetStore);
65 $this->httpContext->setValue(
Store::ENTITY, $targetStore->
getCode(), $defaultStoreView->getCode());
66 $this->storeCookieManager->setStoreCookie($targetStore);
__construct(StoreCookieManagerInterface $storeCookieManager, HttpContext $httpContext, StoreManagerInterface $storeManager)