65 if (isset($this->entities[
$code])) {
66 return $this->entities[
$code];
69 $storeData = $this->getAppConfig()->get(
'scopes',
"stores/$code", []);
70 $store = $this->storeFactory->create([
74 if (
$store->getId() ===
null) {
76 __(
"The store that was requested wasn't found. Verify the store and try again.")
102 if (isset($this->entitiesById[
$id])) {
103 return $this->entitiesById[
$id];
106 $storeData = $this->getAppConfig()->get(
'scopes',
"stores/$id", []);
107 $store = $this->storeFactory->create([
111 if (
$store->getId() ===
null) {
113 __(
"The store that was requested wasn't found. Verify the store and try again.")
129 if (!
$store->isActive()) {
140 if ($this->allLoaded) {
143 $stores = $this->getAppConfig()->get(
'scopes',
"stores", []);
145 $store = $this->storeFactory->create([
151 $this->allLoaded =
true;
161 private function getAppConfig()
163 if (!$this->appConfig) {
166 return $this->appConfig;
174 $this->entities = [];
175 $this->entitiesById = [];
176 $this->allLoaded =
false;
getActiveStoreByCode($code)
__construct(StoreFactory $storeFactory, \Magento\Store\Model\ResourceModel\Store\CollectionFactory $storeCollectionFactory)