Skip to content

Commit 0f36c26

Browse files
Merge branch 'MAGNIMEX-SPRINT-3-TABLE-PREFIXES' into 'MAGNIMEX-SPRINT-3'
Magnimex sprint 3 table prefixes See merge request !149
2 parents 2f85eee + 68b4802 commit 0f36c26

File tree

1 file changed

+14
-2
lines changed
  • app/code/Magento/CatalogImportExport/Model/Import

1 file changed

+14
-2
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,13 +1223,25 @@ protected function _saveProductEntity(array $entityRowsIn, array $entityRowsUp)
12231223
*/
12241224
protected function _prepareAllMediaFiles()
12251225
{
1226+
static $productEntityTableName = null;
1227+
static $productMediaGalleryTableName = null;
1228+
static $resource = null;
1229+
if (!$resource) {
1230+
$resource = $this->_resourceFactory->create();
1231+
}
1232+
if (!$productEntityTableName) {
1233+
$productEntityTableName = $resource->getTable('catalog_product_entity');
1234+
}
1235+
if (!$productMediaGalleryTableName) {
1236+
$productMediaGalleryTableName = $resource->getTable('catalog_product_entity_media_gallery');
1237+
}
12261238
if(empty($this->cachedImages)) {
12271239
$allMedia = $this->_connection->fetchAll($this->_connection->select()
12281240
->from(
1229-
["entity" => $this->_connection->getTableName('catalog_product_entity')],
1241+
["entity" => $productEntityTableName],
12301242
['sku']
12311243
)->joinLeft(
1232-
["media_gallery" => $this->_connection->getTableName('catalog_product_entity_media_gallery')],
1244+
["media_gallery" => $productMediaGalleryTableName],
12331245
"entity.entity_id = media_gallery.entity_id",
12341246
['value']
12351247
)

0 commit comments

Comments
 (0)