Skip to content

Commit e07b074

Browse files
committed
MAGETWO-84124: Add backwards compatibility for RelationsDataSaver
1 parent 9cbef5e commit e07b074

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle/RelationsDataSaver.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
namespace Magento\BundleImportExport\Model\Import\Product\Type\Bundle;
77

8+
use Magento\Catalog\Model\ResourceModel\Product\Relation;
9+
use Magento\Framework\App\ObjectManager;
10+
811
/**
912
* A bundle product relations (options, selections, etc.) data saver.
1013
*
@@ -18,20 +21,21 @@ class RelationsDataSaver
1821
private $resource;
1922

2023
/**
21-
* @var \Magento\Catalog\Model\ResourceModel\Product\Relation
24+
* @var Relation
2225
*/
2326
private $productRelation;
2427

2528
/**
2629
* @param \Magento\Framework\App\ResourceConnection $resource
27-
* @param \Magento\Catalog\Model\ResourceModel\Product\Relation $productRelation
30+
* @param Relation $productRelation
2831
*/
2932
public function __construct(
3033
\Magento\Framework\App\ResourceConnection $resource,
31-
\Magento\Catalog\Model\ResourceModel\Product\Relation $productRelation
34+
Relation $productRelation = null
3235
) {
3336
$this->resource = $resource;
34-
$this->productRelation = $productRelation;
37+
$this->productRelation = $productRelation
38+
?: ObjectManager::getInstance()->get(Relation::class);
3539
}
3640

3741
/**

0 commit comments

Comments
 (0)