@@ -50,9 +50,9 @@ class Generator
50
50
protected $ storeManager ;
51
51
52
52
/**
53
- * @var array
53
+ * @var \Magento\Framework\Webapi\CustomAttributeTypeLocatorInterface
54
54
*/
55
- protected $ customAttributeMapArray = null ;
55
+ protected $ customAttributeTypeLocator = null ;
56
56
57
57
/**
58
58
* Initialize dependencies.
@@ -62,22 +62,22 @@ class Generator
62
62
* @param \Magento\Framework\App\Cache\Type\Webapi $cache
63
63
* @param \Magento\Framework\Reflection\TypeProcessor $typeProcessor
64
64
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
65
- * @param \Magento\Framework\Object $customAttributeMap
65
+ * @param \Magento\Framework\Webapi\CustomAttributeTypeLocatorInterface $customAttributeTypeLocator
66
66
*/
67
67
public function __construct (
68
68
\Magento \Webapi \Model \Soap \Config $ apiConfig ,
69
69
WsdlFactory $ wsdlFactory ,
70
70
\Magento \Framework \App \Cache \Type \Webapi $ cache ,
71
71
\Magento \Framework \Reflection \TypeProcessor $ typeProcessor ,
72
72
\Magento \Store \Model \StoreManagerInterface $ storeManager ,
73
- \Magento \Framework \Object $ customAttributeMap
73
+ \Magento \Framework \Webapi \ CustomAttributeTypeLocatorInterface $ customAttributeTypeLocator
74
74
) {
75
75
$ this ->_apiConfig = $ apiConfig ;
76
76
$ this ->_wsdlFactory = $ wsdlFactory ;
77
77
$ this ->_cache = $ cache ;
78
78
$ this ->_typeProcessor = $ typeProcessor ;
79
79
$ this ->storeManager = $ storeManager ;
80
- $ this ->customAttributeMapArray = array_values ( $ customAttributeMap -> getData ()) ;
80
+ $ this ->customAttributeTypeLocator = $ customAttributeTypeLocator ;
81
81
}
82
82
83
83
/**
@@ -178,7 +178,7 @@ protected function _generate($requestedServices, $endPointUrl)
178
178
*/
179
179
protected function addCustomAttributeTypes ($ wsdl )
180
180
{
181
- foreach ($ this ->customAttributeMapArray as $ customAttributeClass ) {
181
+ foreach ($ this ->customAttributeTypeLocator -> getAllServiceDataInterfaces () as $ customAttributeClass ) {
182
182
$ typeName = $ this ->_typeProcessor ->register ($ customAttributeClass );
183
183
$ wsdl ->addComplexType ($ typeName );
184
184
}
0 commit comments