File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
app/code/Magento/SalesRule/Model/ResourceModel Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 15
15
16
16
/**
17
17
* Sales Rule resource model
18
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
18
19
*/
19
20
class Rule extends AbstractResource
20
21
{
22
+ /**
23
+ * Store associated with rule entities information map
24
+ *
25
+ * @var array
26
+ */
27
+ protected $ _associatedEntitiesMap = [];
28
+
21
29
/**
22
30
* @var array
23
31
*/
@@ -70,7 +78,10 @@ public function __construct(
70
78
) {
71
79
$ this ->string = $ string ;
72
80
$ this ->_resourceCoupon = $ resourceCoupon ;
73
- $ this ->_associatedEntitiesMap = $ associatedEntityMapInstance ? $ associatedEntityMapInstance ->getData () : [] ;
81
+ $ associatedEntitiesMapInstance = $ associatedEntityMapInstance ?: ObjectManager::getInstance ()->get (
82
+ \Magento \SalesRule \Model \ResourceModel \Rule \AssociatedEntityMap::class
83
+ );
84
+ $ this ->_associatedEntitiesMap = $ associatedEntitiesMapInstance ->getData ();
74
85
$ this ->serializer = $ serializer ?: ObjectManager::getInstance ()->get (Json::class);
75
86
$ this ->metadataPool = $ metadataPool ?: ObjectManager::getInstance ()->get (MetadataPool::class);
76
87
parent ::__construct ($ context , $ connectionName );
You can’t perform that action at this time.
0 commit comments