6 declare(strict_types=1);
11 use Magento\Store\Model\ResourceModel\Website\CollectionFactory as WebsiteCollectionFactory;
27 private $collectionFactory;
32 private $websitesDataIterator;
37 private $dimensionFactory;
45 $this->dimensionFactory = $dimensionFactory;
46 $this->collectionFactory = $collectionFactory;
54 foreach ($this->getWebsites() as
$website) {
55 yield $this->dimensionFactory->create(self::DIMENSION_NAME, (
string)
$website);
62 private function getWebsites(): array
64 if ($this->websitesDataIterator ===
null) {
65 $websites = $this->collectionFactory->create()
71 return $this->websitesDataIterator;
__construct(WebsiteCollectionFactory $collectionFactory, DimensionFactory $dimensionFactory)