Information Expert in stores handling
Definition at line 16 of file StoreRepository.php.
◆ __construct()
__construct |
( |
StoreFactory |
$storeFactory, |
|
|
\Magento\Store\Model\ResourceModel\Store\CollectionFactory |
$storeCollectionFactory |
|
) |
| |
- Parameters
-
StoreFactory | $storeFactory | |
\Magento\Store\Model\ResourceModel\Store\CollectionFactory | $storeCollectionFactory | |
Definition at line 52 of file StoreRepository.php.
◆ clean()
◆ get()
{Retrieve store by code
- Parameters
-
- Returns
- \Magento\Store\Api\Data\StoreInterface
- Exceptions
-
}
Implements StoreRepositoryInterface.
Definition at line 63 of file StoreRepository.php.
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) {
75 throw new NoSuchEntityException(
76 __(
"The store that was requested wasn't found. Verify the store and try again.")
◆ getActiveStoreByCode()
getActiveStoreByCode |
( |
|
$code | ) |
|
{Retrieve active store by code
- Parameters
-
- Returns
- \Magento\Store\Api\Data\StoreInterface
- Exceptions
-
NoSuchEntityException | |
StoreIsInactiveException | |
}
Implements StoreRepositoryInterface.
Definition at line 87 of file StoreRepository.php.
92 throw new StoreIsInactiveException();
◆ getActiveStoreById()
getActiveStoreById |
( |
|
$id | ) |
|
{Retrieve active store by id
- Parameters
-
- Returns
- \Magento\Store\Api\Data\StoreInterface
- Exceptions
-
NoSuchEntityException | |
StoreIsInactiveException | |
}
Implements StoreRepositoryInterface.
Definition at line 125 of file StoreRepository.php.
129 if (!
$store->isActive()) {
130 throw new StoreIsInactiveException();
◆ getById()
{Retrieve store by id
- Parameters
-
- Returns
- \Magento\Store\Api\Data\StoreInterface
- Exceptions
-
}
Implements StoreRepositoryInterface.
Definition at line 100 of file StoreRepository.php.
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) {
112 throw new NoSuchEntityException(
113 __(
"The store that was requested wasn't found. Verify the store and try again.")
◆ getList()
{Retrieve list of all stores
- Returns
- \Magento\Store\Api\Data\StoreInterface[]
}
Implements StoreRepositoryInterface.
Definition at line 138 of file StoreRepository.php.
140 if ($this->allLoaded) {
143 $stores = $this->getAppConfig()->get(
'scopes',
"stores", []);
145 $store = $this->storeFactory->create([
151 $this->allLoaded =
true;
◆ $allLoaded
◆ $entities
◆ $entitiesById
◆ $storeCollectionFactory
◆ $storeFactory
The documentation for this class was generated from the following file: