Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
StoreManagement.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Store\Model;
7 
9 use Magento\Store\Model\ResourceModel\Store\CollectionFactory;
10 
16 {
20  protected $storesFactory;
21 
25  public function __construct(CollectionFactory $storesFactory)
26  {
27  $this->storesFactory = $storesFactory;
28  }
29 
33  public function getCount()
34  {
35  $stores = $this->storesFactory->create();
37  $stores->setWithoutDefaultFilter();
38  return $stores->getSize();
39  }
40 }
__construct(CollectionFactory $storesFactory)