Skip to content

Commit ce075fc

Browse files
committed
Merge pull request magento#10 from magento-firedrakes/MAGETWO-46472
[Firedrakes] Sprint 53
2 parents 4987f3f + c3fa797 commit ce075fc

File tree

1 file changed

+7
-7
lines changed
  • app/code/Magento/CatalogSampleData/Model/Product

1 file changed

+7
-7
lines changed

app/code/Magento/CatalogSampleData/Model/Product/Gallery.php

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

88
use Magento\Catalog\Model\ProductFactory;
9-
use Magento\Catalog\Model\ResourceModel\Product\Attribute\Backend\Media as GalleryAttribute;
9+
use Magento\Catalog\Model\ResourceModel\Product\Gallery as GalleryResource;
1010
use Magento\Framework\Setup\SampleData\Context as SampleDataContext;
1111

1212
/**
@@ -47,18 +47,18 @@ class Gallery
4747
/**
4848
* @param SampleDataContext $sampleDataContext
4949
* @param ProductFactory $productFactory
50-
* @param GalleryAttribute $galleryAttribute
50+
* @param GalleryResource $galleryResource
5151
* @param \Magento\Eav\Model\Config $eavConfig
5252
*/
5353
public function __construct(
5454
SampleDataContext $sampleDataContext,
5555
ProductFactory $productFactory,
56-
GalleryAttribute $galleryAttribute,
56+
GalleryResource $galleryResource,
5757
\Magento\Eav\Model\Config $eavConfig
5858
) {
5959
$this->fixtureManager = $sampleDataContext->getFixtureManager();
6060
$this->csvReader = $sampleDataContext->getCsvReader();
61-
$this->galleryAttribute = $galleryAttribute;
61+
$this->galleryResource = $galleryResource;
6262
$this->productFactory = $productFactory;
6363
$this->eavConfig = $eavConfig;
6464
}
@@ -122,20 +122,20 @@ protected function storeImage($product, $images)
122122
if (strpos($image, '_main') !== false) {
123123
$baseImage = $image;
124124
}
125-
$id = $this->galleryAttribute->insertGallery([
125+
$id = $this->galleryResource->insertGallery([
126126
'attribute_id' => $mediaAttribute->getAttributeId(),
127127
'entity_id' => $product->getId(),
128128
'value' => $image,
129129
]);
130-
$this->galleryAttribute->insertGalleryValueInStore([
130+
$this->galleryResource->insertGalleryValueInStore([
131131
'value_id' => $id,
132132
'store_id' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
133133
'entity_id' => $product->getId(),
134134
'label' => 'Image',
135135
'position' => $i,
136136
'disables' => 0,
137137
]);
138-
$this->galleryAttribute->bindValueToEntity($id, $product->getId());
138+
$this->galleryResource->bindValueToEntity($id, $product->getId());
139139
$i++;
140140
}
141141

0 commit comments

Comments
 (0)