Skip to content

Commit 5681284

Browse files
committed
MAGETWO-94671: Product Export fails
1 parent 1766f07 commit 5681284

File tree

1 file changed

+31
-9
lines changed
  • app/code/Magento/CatalogImportExport/Model/Export

1 file changed

+31
-9
lines changed

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

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,13 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity
349349
private $productEntityLinkField;
350350

351351
/**
352+
* Product constructor.
352353
* @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
353354
* @param \Magento\Eav\Model\Config $config
354355
* @param \Magento\Framework\App\ResourceConnection $resource
355356
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
356357
* @param \Psr\Log\LoggerInterface $logger
357-
* @param \Magento\Catalog\Model\ResourceModel\Product\Collection $collection
358+
* @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collectionFactory
358359
* @param \Magento\ImportExport\Model\Export\ConfigInterface $exportConfig
359360
* @param \Magento\Catalog\Model\ResourceModel\ProductFactory $productFactory
360361
* @param \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory $attrSetColFactory
@@ -363,10 +364,10 @@ class Product extends \Magento\ImportExport\Model\Export\Entity\AbstractEntity
363364
* @param \Magento\Catalog\Model\ResourceModel\Product\Option\CollectionFactory $optionColFactory
364365
* @param \Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory $attributeColFactory
365366
* @param Product\Type\Factory $_typeFactory
366-
* @param \Magento\Catalog\Model\Product\LinkTypeProvider $linkTypeProvider
367-
* @param \Magento\CatalogImportExport\Model\Export\RowCustomizerInterface $rowCustomizer
367+
* @param ProductEntity\LinkTypeProvider $linkTypeProvider
368+
* @param RowCustomizerInterface $rowCustomizer
368369
* @param array $dateAttrCodes
369-
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
370+
* @throws \Magento\Framework\Exception\LocalizedException
370371
*/
371372
public function __construct(
372373
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
@@ -695,7 +696,9 @@ protected function updateDataWithCategoryColumns(&$dataRow, &$rowCategories, $pr
695696
}
696697

697698
/**
698-
* {@inheritdoc}
699+
* Get header columns
700+
*
701+
* @return string[]
699702
*/
700703
public function _getHeaderColumns()
701704
{
@@ -754,7 +757,10 @@ protected function _getExportMainAttrCodes()
754757
}
755758

756759
/**
757-
* {@inheritdoc}
760+
* Get entity collection
761+
*
762+
* @param bool $resetCollection
763+
* @return \Magento\Framework\Data\Collection\AbstractDb
758764
*/
759765
protected function _getEntityCollection($resetCollection = false)
760766
{
@@ -861,7 +867,10 @@ public function export()
861867
}
862868

863869
/**
864-
* {@inheritdoc}
870+
* Apply filter to collection and add not skipped attributes to select.
871+
*
872+
* @param \Magento\Eav\Model\Entity\Collection\AbstractCollection $collection
873+
* @return \Magento\Eav\Model\Entity\Collection\AbstractCollection
865874
* @since 100.2.0
866875
*/
867876
protected function _prepareEntityCollection(\Magento\Eav\Model\Entity\Collection\AbstractCollection $collection)
@@ -923,8 +932,7 @@ protected function getExportData()
923932
}
924933

925934
/**
926-
* Load products' data from the collection
927-
* and filter it (if needed).
935+
* Load products' data from the collection and filter it (if needed).
928936
*
929937
* @return array Keys are product IDs, values arrays with keys as store IDs
930938
* and values as store-specific versions of Product entity.
@@ -1066,6 +1074,8 @@ private function wrapValue($value)
10661074
}
10671075

10681076
/**
1077+
* Collect multi raw data from
1078+
*
10691079
* @return array
10701080
*/
10711081
protected function collectMultirawData()
@@ -1107,6 +1117,8 @@ protected function collectMultirawData()
11071117
}
11081118

11091119
/**
1120+
* Check the current data has multiselect value
1121+
*
11101122
* @param \Magento\Catalog\Model\Product $item
11111123
* @param int $storeId
11121124
* @return bool
@@ -1119,6 +1131,8 @@ protected function hasMultiselectData($item, $storeId)
11191131
}
11201132

11211133
/**
1134+
* Collect multiselect values based on value
1135+
*
11221136
* @param \Magento\Catalog\Model\Product $item
11231137
* @param string $attrCode
11241138
* @param int $storeId
@@ -1143,6 +1157,8 @@ protected function collectMultiselectValues($item, $attrCode, $storeId)
11431157
}
11441158

11451159
/**
1160+
* Check attribute is valid
1161+
*
11461162
* @param string $code
11471163
* @param mixed $value
11481164
* @return bool
@@ -1162,6 +1178,8 @@ protected function isValidAttributeValue($code, $value)
11621178
}
11631179

11641180
/**
1181+
* Append multi row data
1182+
*
11651183
* @param array $dataRow
11661184
* @param array $multiRawData
11671185
* @return array
@@ -1291,6 +1309,8 @@ private function appendMultirowData(&$dataRow, $multiRawData)
12911309
}
12921310

12931311
/**
1312+
* Add multi row data to export
1313+
*
12941314
* @deprecated 100.1.0
12951315
* @param array $dataRow
12961316
* @param array $multiRawData
@@ -1338,6 +1358,8 @@ protected function _customHeadersMapping($rowData)
13381358
}
13391359

13401360
/**
1361+
* Convert option row to cell string
1362+
*
13411363
* @param array $option
13421364
* @return string
13431365
*/

0 commit comments

Comments
 (0)