9
9
use Magento \Catalog \Model \Product \Visibility ;
10
10
use Magento \CatalogImportExport \Model \Import \Product \RowValidatorInterface as ValidatorInterface ;
11
11
use Magento \Framework \App \Filesystem \DirectoryList ;
12
+ use Magento \Framework \Exception \LocalizedException ;
12
13
use Magento \Framework \Filesystem ;
13
14
use Magento \Framework \Model \ResourceModel \Db \ObjectRelationProcessor ;
14
15
use Magento \Framework \Model \ResourceModel \Db \TransactionManagerInterface ;
@@ -712,7 +713,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
712
713
* @param \Magento\CatalogInventory\Model\Spi\StockStateProviderInterface $stockStateProvider
713
714
* @param \Magento\Catalog\Helper\Data $catalogData
714
715
* @param \Magento\ImportExport\Model\Import\Config $importConfig
715
- * @param Proxy\Product\ResourceFactory $resourceFactory
716
+ * @param Proxy\Product\ResourceModelFactory $resourceFactory
716
717
* @param Product\OptionFactory $optionFactory
717
718
* @param \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory $setColFactory
718
719
* @param Product\Type\Factory $productTypeFactory
@@ -1084,12 +1085,12 @@ protected function _initTypeModels()
1084
1085
$ params = [$ this , $ productTypeName ];
1085
1086
if (!($ model = $ this ->_productTypeFactory ->create ($ productTypeConfig ['model ' ], ['params ' => $ params ]))
1086
1087
) {
1087
- throw new \ Magento \ Framework \ Exception \ LocalizedException (
1088
+ throw new LocalizedException (
1088
1089
__ ('Entity type model \'%1 \' is not found ' , $ productTypeConfig ['model ' ])
1089
1090
);
1090
1091
}
1091
1092
if (!$ model instanceof \Magento \CatalogImportExport \Model \Import \Product \Type \AbstractType) {
1092
- throw new \ Magento \ Framework \ Exception \ LocalizedException (
1093
+ throw new LocalizedException (
1093
1094
__ (
1094
1095
'Entity type model must be an instance of '
1095
1096
. \Magento \CatalogImportExport \Model \Import \Product \Type \AbstractType::class
@@ -1551,6 +1552,7 @@ public function getImagesFromRow(array $rowData)
1551
1552
* @SuppressWarnings(PHPMD.NPathComplexity)
1552
1553
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
1553
1554
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
1555
+ * @throws LocalizedException
1554
1556
*/
1555
1557
protected function _saveProducts ()
1556
1558
{
@@ -1611,7 +1613,7 @@ protected function _saveProducts()
1611
1613
1612
1614
// wrong attribute_set_code was received
1613
1615
if (!$ attributeSetId ) {
1614
- throw new \ Magento \ Framework \ Exception \ LocalizedException (
1616
+ throw new LocalizedException (
1615
1617
__ (
1616
1618
'Wrong attribute set code "%1", please correct it and try again. ' ,
1617
1619
$ rowData ['attribute_set_code ' ]
@@ -1998,7 +2000,7 @@ protected function _getUploader()
1998
2000
}
1999
2001
2000
2002
if (!$ this ->_fileUploader ->setTmpDir ($ tmpPath )) {
2001
- throw new \ Magento \ Framework \ Exception \ LocalizedException (
2003
+ throw new LocalizedException (
2002
2004
__ ('File directory \'%1 \' is not readable. ' , $ tmpPath )
2003
2005
);
2004
2006
}
@@ -2007,7 +2009,7 @@ protected function _getUploader()
2007
2009
2008
2010
$ this ->_mediaDirectory ->create ($ destinationPath );
2009
2011
if (!$ this ->_fileUploader ->setDestDir ($ destinationPath )) {
2010
- throw new \ Magento \ Framework \ Exception \ LocalizedException (
2012
+ throw new LocalizedException (
2011
2013
__ ('File directory \'%1 \' is not writable. ' , $ destinationPath )
2012
2014
);
2013
2015
}
@@ -2029,6 +2031,7 @@ public function getUploader()
2029
2031
* Return a new file name if the same file is already exists.
2030
2032
*
2031
2033
* @param string $fileName
2034
+ * @param bool $renameFileOff
2032
2035
* @return string
2033
2036
*/
2034
2037
protected function uploadMediaFiles ($ fileName , $ renameFileOff = false )
@@ -2753,9 +2756,7 @@ private function _customFieldsMapping($rowData)
2753
2756
}
2754
2757
2755
2758
/**
2756
- * Validate data rows and save bunches to DB
2757
- *
2758
- * @return $this
2759
+ * {@inheritdoc}
2759
2760
*/
2760
2761
protected function _saveValidatedBunches ()
2761
2762
{
0 commit comments