3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+
6
7
namespace Magento \Store \Model \Service ;
7
8
9
+ use Magento \Framework \App \Config \ScopeConfigInterface ;
10
+ use Magento \Store \Api \Data \StoreConfigInterface ;
11
+ use Magento \Store \Api \Data \StoreInterface ;
12
+ use Magento \Store \Model \Data \StoreConfig ;
13
+ use Magento \Store \Model \Data \StoreConfigFactory ;
14
+ use Magento \Store \Model \ResourceModel \Store \CollectionFactory ;
15
+ use Magento \Store \Model \Store ;
16
+
8
17
class StoreConfigManager implements \Magento \Store \Api \StoreConfigManagerInterface
9
18
{
10
19
/**
11
- * @var \Magento\Store\Model\ResourceModel\Store\ CollectionFactory
20
+ * @var CollectionFactory
12
21
*/
13
22
protected $ storeCollectionFactory ;
14
23
15
24
/**
16
- * @var \Magento\Store\Model\Data\ StoreConfigFactory
25
+ * @var StoreConfigFactory
17
26
*/
18
27
protected $ storeConfigFactory ;
19
28
20
29
/**
21
30
* Core store config
22
31
*
23
- * @var \Magento\Framework\App\Config\ ScopeConfigInterface
32
+ * @var ScopeConfigInterface
24
33
*/
25
34
protected $ scopeConfig ;
26
35
@@ -38,23 +47,25 @@ class StoreConfigManager implements \Magento\Store\Api\StoreConfigManagerInterfa
38
47
];
39
48
40
49
/**
41
- * @param \Magento\Store\Model\ResourceModel\Store\ CollectionFactory $storeCollectionFactory
42
- * @param \Magento\Framework\App\Config\ ScopeConfigInterface $scopeConfig
43
- * @param \Magento\Store\Model\Data\ StoreConfigFactory $storeConfigFactory
50
+ * @param CollectionFactory $storeCollectionFactory
51
+ * @param ScopeConfigInterface $scopeConfig
52
+ * @param StoreConfigFactory $storeConfigFactory
44
53
*/
45
54
public function __construct (
46
- \ Magento \ Store \ Model \ ResourceModel \ Store \ CollectionFactory $ storeCollectionFactory ,
47
- \ Magento \ Framework \ App \ Config \ ScopeConfigInterface $ scopeConfig ,
48
- \ Magento \ Store \ Model \ Data \ StoreConfigFactory $ storeConfigFactory
55
+ CollectionFactory $ storeCollectionFactory ,
56
+ ScopeConfigInterface $ scopeConfig ,
57
+ StoreConfigFactory $ storeConfigFactory
49
58
) {
50
59
$ this ->storeCollectionFactory = $ storeCollectionFactory ;
51
60
$ this ->scopeConfig = $ scopeConfig ;
52
61
$ this ->storeConfigFactory = $ storeConfigFactory ;
53
62
}
54
63
55
64
/**
65
+ * Get store configurations
66
+ *
56
67
* @param string[] $storeCodes list of stores by store codes, will return all if storeCodes is not set
57
- * @return \Magento\Store\Api\Data\ StoreConfigInterface[]
68
+ * @return StoreConfigInterface[]
58
69
*/
59
70
public function getStoreConfigs (array $ storeCodes = null )
60
71
{
@@ -71,12 +82,14 @@ public function getStoreConfigs(array $storeCodes = null)
71
82
}
72
83
73
84
/**
74
- * @param \Magento\Store\Model\Store $store
75
- * @return \Magento\Store\Api\Data\StoreConfigInterface
85
+ * Get store specific configs
86
+ *
87
+ * @param Store|StoreInterface $store
88
+ * @return StoreConfigInterface
76
89
*/
77
- protected function getStoreConfig ($ store )
90
+ public function getStoreConfig ($ store )
78
91
{
79
- /** @var \Magento\Store\Model\Data\ StoreConfig $storeConfig */
92
+ /** @var StoreConfig $storeConfig */
80
93
$ storeConfig = $ this ->storeConfigFactory ->create ();
81
94
82
95
$ storeConfig ->setId ($ store ->getId ())
0 commit comments