Skip to content

Commit 92e0189

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

File tree

1 file changed

+2
-15
lines changed
  • app/code/Magento/SalesRule/Model/ResourceModel

1 file changed

+2
-15
lines changed

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

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
namespace Magento\SalesRule\Model\ResourceModel;
77

88
use Magento\Framework\App\ObjectManager;
9-
use \Magento\SalesRule\Model\Rule as SalesRule;
109
use Magento\Framework\Model\AbstractModel;
1110
use Magento\Rule\Model\ResourceModel\AbstractResource;
1211
use Magento\Framework\EntityManager\EntityManager;
@@ -19,13 +18,6 @@
1918
*/
2019
class Rule extends AbstractResource
2120
{
22-
/**
23-
* Store associated with rule entities information map
24-
*
25-
* @var array
26-
*/
27-
protected $_associatedEntitiesMap = [];
28-
2921
/**
3022
* @var array
3123
*/
@@ -78,10 +70,7 @@ public function __construct(
7870
) {
7971
$this->string = $string;
8072
$this->_resourceCoupon = $resourceCoupon;
81-
$associatedEntitiesMapInstance = $associatedEntityMapInstance ?: ObjectManager::getInstance()->get(
82-
\Magento\SalesRule\Model\ResourceModel\Rule\AssociatedEntityMap::class
83-
);
84-
$this->_associatedEntitiesMap = $associatedEntitiesMapInstance->getData();
73+
$this->_associatedEntitiesMap = $associatedEntityMapInstance ? $associatedEntityMapInstance->getData() : [] ;
8574
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
8675
$this->metadataPool = $metadataPool ?: ObjectManager::getInstance()->get(MetadataPool::class);
8776
parent::__construct($context, $connectionName);
@@ -143,7 +132,7 @@ public function _beforeSave(AbstractModel $object)
143132
/**
144133
* Load an object
145134
*
146-
* @param SalesRule|AbstractModel $object
135+
* @param AbstractModel $object
147136
* @param mixed $value
148137
* @param string $field field to load by (defaults to model id)
149138
* @return $this
@@ -376,7 +365,6 @@ public function getProductAttributes($serializedString)
376365
/**
377366
* @param \Magento\Framework\Model\AbstractModel $object
378367
* @return $this
379-
* @throws \Exception
380368
*/
381369
public function save(\Magento\Framework\Model\AbstractModel $object)
382370
{
@@ -389,7 +377,6 @@ public function save(\Magento\Framework\Model\AbstractModel $object)
389377
*
390378
* @param \Magento\Framework\Model\AbstractModel $object
391379
* @return $this
392-
* @throws \Exception
393380
*/
394381
public function delete(AbstractModel $object)
395382
{

0 commit comments

Comments
 (0)