Skip to content

Commit 7674201

Browse files
committed
Merge branch 'MAGETWO-63350' of github.com:magento-troll/magento2ce into MAGETWO-58456
2 parents 92e0189 + b59364d commit 7674201

File tree

1 file changed

+12
-1
lines changed
  • app/code/Magento/SalesRule/Model/ResourceModel

1 file changed

+12
-1
lines changed

app/code/Magento/SalesRule/Model/ResourceModel/Rule.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,17 @@
1515

1616
/**
1717
* Sales Rule resource model
18+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1819
*/
1920
class Rule extends AbstractResource
2021
{
22+
/**
23+
* Store associated with rule entities information map
24+
*
25+
* @var array
26+
*/
27+
protected $_associatedEntitiesMap = [];
28+
2129
/**
2230
* @var array
2331
*/
@@ -70,7 +78,10 @@ public function __construct(
7078
) {
7179
$this->string = $string;
7280
$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();
7485
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
7586
$this->metadataPool = $metadataPool ?: ObjectManager::getInstance()->get(MetadataPool::class);
7687
parent::__construct($context, $connectionName);

0 commit comments

Comments
 (0)