Skip to content

Commit

Permalink
MAGETWO-84124: Add backwards compatibility for RelationsDataSaver
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-paterson committed May 17, 2018
1 parent 9cbef5e commit e07b074
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*/
namespace Magento\BundleImportExport\Model\Import\Product\Type\Bundle;

use Magento\Catalog\Model\ResourceModel\Product\Relation;
use Magento\Framework\App\ObjectManager;

/**
* A bundle product relations (options, selections, etc.) data saver.
*
Expand All @@ -18,20 +21,21 @@ class RelationsDataSaver
private $resource;

/**
* @var \Magento\Catalog\Model\ResourceModel\Product\Relation
* @var Relation
*/
private $productRelation;

/**
* @param \Magento\Framework\App\ResourceConnection $resource
* @param \Magento\Catalog\Model\ResourceModel\Product\Relation $productRelation
* @param Relation $productRelation
*/
public function __construct(
\Magento\Framework\App\ResourceConnection $resource,
\Magento\Catalog\Model\ResourceModel\Product\Relation $productRelation
Relation $productRelation = null
) {
$this->resource = $resource;
$this->productRelation = $productRelation;
$this->productRelation = $productRelation
?: ObjectManager::getInstance()->get(Relation::class);
}

/**
Expand Down

0 comments on commit e07b074

Please sign in to comment.