Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
StoreDimensionProvider.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
8 namespace Magento\Store\Model;
9 
12 
17 {
22  const DIMENSION_NAME = 'scope';
23 
27  private $storeManager;
28 
32  private $dimensionFactory;
33 
38  public function __construct(StoreManagerInterface $storeManager, DimensionFactory $dimensionFactory)
39  {
40  $this->storeManager = $storeManager;
41  $this->dimensionFactory = $dimensionFactory;
42  }
43 
47  public function getIterator(): \Traversable
48  {
49  foreach (array_keys($this->storeManager->getStores()) as $storeId) {
50  yield [self::DIMENSION_NAME => $this->dimensionFactory->create(self::DIMENSION_NAME, (string)$storeId)];
51  }
52  }
53 }
$storeManager
__construct(StoreManagerInterface $storeManager, DimensionFactory $dimensionFactory)