File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
lib/internal/Magento/Framework/EntityManager Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,14 @@ class TypeResolver
15
15
*/
16
16
private $ metadataPool ;
17
17
18
+ /**
19
+ * @var array
20
+ */
21
+ private $ typeMapping = [
22
+ \Magento \SalesRule \Model \Rule::class => \Magento \SalesRule \Api \Data \RuleInterface::class,
23
+ \Magento \SalesRule \Model \Rule \Interceptor::class => \Magento \SalesRule \Api \Data \RuleInterface::class
24
+ ];
25
+
18
26
/**
19
27
* TypeResolver constructor.
20
28
* @param MetadataPool $metadataPool
@@ -24,14 +32,6 @@ public function __construct(MetadataPool $metadataPool)
24
32
$ this ->metadataPool = $ metadataPool ;
25
33
}
26
34
27
- /**
28
- * @var array
29
- */
30
- private $ typeMapping = [
31
- \Magento \SalesRule \Model \Rule::class => \Magento \SalesRule \Api \Data \RuleInterface::class,
32
- \Magento \SalesRule \Model \Rule \Interceptor::class => \Magento \SalesRule \Api \Data \RuleInterface::class
33
- ];
34
-
35
35
/**
36
36
* @param object $type
37
37
* @return string
@@ -61,10 +61,10 @@ public function resolve($type)
61
61
62
62
foreach ($ dataInterfaces as $ dataInterface ) {
63
63
if ($ this ->metadataPool ->hasConfiguration ($ dataInterface )) {
64
- break ;
64
+ $ this -> typeMapping [ $ className ] = $ dataInterface ;
65
65
}
66
66
}
67
67
68
- return $ dataInterface ;
68
+ return $ this -> typeMapping [ $ className ] ;
69
69
}
70
70
}
You can’t perform that action at this time.
0 commit comments