Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
StoreProcessor.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
14 
19 {
23  private $storeManager;
24 
30  public function __construct(StoreManagerInterface $storeManager)
31  {
32  $this->storeManager = $storeManager;
33  }
34 
41  public function processHeaderValue(string $headerValue) : void
42  {
43  if ($headerValue) {
44  $storeCode = ltrim(rtrim($headerValue));
45  $stores = $this->storeManager->getStores(false, true);
46  if (isset($stores[$storeCode])) {
47  $this->storeManager->setCurrentStore($storeCode);
48  } elseif (strtolower($storeCode) !== 'default') {
49  throw new GraphQlInputException(
50  new \Magento\Framework\Phrase('Store code %1 does not exist', [$storeCode])
51  );
52  }
53  }
54  }
55 }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
$storeManager
$storeCode
Definition: indexer.php:15