Skip to content

Commit 2835452

Browse files
committed
MAGETWO-52105: Edit category does not work
1 parent ef3515c commit 2835452

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/internal/Magento/Framework/EntityManager/TypeResolver.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ class TypeResolver
1515
*/
1616
private $metadataPool;
1717

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+
1826
/**
1927
* TypeResolver constructor.
2028
* @param MetadataPool $metadataPool
@@ -24,14 +32,6 @@ public function __construct(MetadataPool $metadataPool)
2432
$this->metadataPool = $metadataPool;
2533
}
2634

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-
3535
/**
3636
* @param object $type
3737
* @return string
@@ -61,10 +61,10 @@ public function resolve($type)
6161

6262
foreach ($dataInterfaces as $dataInterface) {
6363
if ($this->metadataPool->hasConfiguration($dataInterface)) {
64-
break;
64+
$this->typeMapping[$className] = $dataInterface;
6565
}
6666
}
6767

68-
return $dataInterface;
68+
return $this->typeMapping[$className];
6969
}
7070
}

0 commit comments

Comments
 (0)