Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit dc22a82

Browse files
author
Carlos Lizaga
committed
Fine tuning: add use Magento\Framework\Exception\LocalizedException in
order to use LocalizedException and reuse ObjectManager instead of classpath.
1 parent 19de842 commit dc22a82

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Magento\Framework\App\ObjectManager;
99
use Magento\Framework\App\ResourceConnection;
10+
use Magento\Framework\Exception\LocalizedException;
1011
use Magento\Framework\Serialize\Serializer\Json;
1112
use Magento\ImportExport\Model\Import\AbstractSource;
1213
use Magento\ImportExport\Model\Import as ImportExport;
@@ -310,7 +311,7 @@ public function __construct(
310311
protected function _getSource()
311312
{
312313
if (!$this->_source) {
313-
throw new \Magento\Framework\Exception\LocalizedException(__('Please specify a source.'));
314+
throw new LocalizedException(__('Please specify a source.'));
314315
}
315316
return $this->_source;
316317
}
@@ -548,11 +549,11 @@ public function getBehavior()
548549
if (!isset(
549550
$this->_parameters['behavior']
550551
) ||
551-
$this->_parameters['behavior'] != \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND &&
552-
$this->_parameters['behavior'] != \Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE &&
553-
$this->_parameters['behavior'] != \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE
552+
$this->_parameters['behavior'] != ImportExport::BEHAVIOR_APPEND &&
553+
$this->_parameters['behavior'] != ImportExport::BEHAVIOR_REPLACE &&
554+
$this->_parameters['behavior'] != ImportExport::BEHAVIOR_DELETE
554555
) {
555-
return \Magento\ImportExport\Model\Import::getDefaultBehavior();
556+
return ImportExport::getDefaultBehavior();
556557
}
557558
return $this->_parameters['behavior'];
558559
}
@@ -604,7 +605,7 @@ public function getProcessedRowsCount()
604605
public function getSource()
605606
{
606607
if (!$this->_source) {
607-
throw new \Magento\Framework\Exception\LocalizedException(__('The source is not set.'));
608+
throw new LocalizedException(__('The source is not set.'));
608609
}
609610
return $this->_source;
610611
}
@@ -879,7 +880,7 @@ public function getValidColumnNames()
879880
protected function getMetadataPool()
880881
{
881882
if (!$this->metadataPool) {
882-
$this->metadataPool = \Magento\Framework\App\ObjectManager::getInstance()
883+
$this->metadataPool = ObjectManager::getInstance()
883884
->get(\Magento\Framework\EntityManager\MetadataPool::class);
884885
}
885886
return $this->metadataPool;

0 commit comments

Comments
 (0)