@@ -193,11 +193,6 @@ class Import extends AbstractModel
193
193
*/
194
194
private $ messageManager ;
195
195
196
- /**
197
- * @var SourceFactory
198
- */
199
- private $ sourceFactory ;
200
-
201
196
/**
202
197
* @var Upload
203
198
*/
@@ -220,7 +215,6 @@ class Import extends AbstractModel
220
215
* @param DateTime $localeDate
221
216
* @param array $data
222
217
* @param ManagerInterface|null $messageManager
223
- * @param SourceFactory|null $sourceFactory
224
218
* @param Upload|null $upload
225
219
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
226
220
*/
@@ -241,7 +235,6 @@ public function __construct(
241
235
DateTime $ localeDate ,
242
236
array $ data = [],
243
237
ManagerInterface $ messageManager = null ,
244
- SourceFactory $ sourceFactory = null ,
245
238
Upload $ upload = null
246
239
) {
247
240
$ this ->_importExportData = $ importExportData ;
@@ -259,8 +252,6 @@ public function __construct(
259
252
$ this ->localeDate = $ localeDate ;
260
253
$ this ->messageManager = $ messageManager ?: ObjectManager::getInstance ()
261
254
->get (ManagerInterface::class);
262
- $ this ->sourceFactory = $ sourceFactory ?? ObjectManager::getInstance ()
263
- ->get (SourceFactory::class);
264
255
$ this ->upload = $ upload ?: ObjectManager::getInstance ()
265
256
->get (Upload::class);
266
257
parent ::__construct ($ logger , $ filesystem , $ data );
@@ -313,6 +304,7 @@ protected function _getEntityAdapter()
313
304
314
305
/**
315
306
* Returns source adapter object.
307
+ *
316
308
* @Deprecated
317
309
* @see \Magento\ImportExport\Model\Import\Source\Factory::create()
318
310
* @param string $sourceFile Full path to source file
@@ -584,11 +576,7 @@ public function uploadFileAndGetSource()
584
576
{
585
577
$ sourceFile = $ this ->uploadSource ();
586
578
try {
587
- $ source = $ this ->sourceFactory ->create (
588
- $ sourceFile ,
589
- $ this ->_filesystem ->getDirectoryWrite (DirectoryList::ROOT ),
590
- $ this ->getData (self ::FIELD_FIELD_SEPARATOR )
591
- );
579
+ $ source = $ this ->_getSourceAdapter ($ sourceFile );
592
580
} catch (\Exception $ e ) {
593
581
$ this ->_varDirectory ->delete ($ this ->_varDirectory ->getRelativePath ($ sourceFile ));
594
582
throw new LocalizedException (__ ($ e ->getMessage ()));
0 commit comments