Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct (\Psr\Log\LoggerInterface $logger, \Magento\Framework\Filesystem $filesystem, \Magento\ImportExport\Helper\Data $importExportData, \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\ImportExport\Model\Import\ConfigInterface $importConfig, \Magento\ImportExport\Model\Import\Entity\Factory $entityFactory, \Magento\ImportExport\Model\ResourceModel\Import\Data $importData, \Magento\ImportExport\Model\Export\Adapter\CsvFactory $csvFactory, \Magento\Framework\HTTP\Adapter\FileTransferFactory $httpFactory, \Magento\MediaStorage\Model\File\UploaderFactory $uploaderFactory, \Magento\ImportExport\Model\Source\Import\Behavior\Factory $behaviorFactory, \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry, \Magento\ImportExport\Model\History $importHistoryModel, DateTime $localeDate, array $data=[]) | |
getOperationResultMessages (ProcessingErrorAggregatorInterface $validationResult) | |
getDataSourceModel () | |
getEntity () | |
getProcessedEntitiesCount () | |
getProcessedRowsCount () | |
getWorkingDir () | |
importSource () | |
isImportAllowed () | |
getErrorAggregator () | |
uploadFileAndGetSource () | |
validateSource (\Magento\ImportExport\Model\Import\AbstractSource $source) | |
invalidateIndex () | |
getUniqueEntityBehaviors () | |
isReportEntityType ($entity=null) | |
getCreatedItemsCount () | |
getUpdatedItemsCount () | |
getDeletedItemsCount () | |
![]() | |
__construct (\Psr\Log\LoggerInterface $logger, \Magento\Framework\Filesystem $filesystem, array $data=[]) | |
addLogComment ($debugData) | |
getFormatedLogTrace () | |
![]() | |
__construct (array $data=[]) | |
addData (array $arr) | |
setData ($key, $value=null) | |
unsetData ($key=null) | |
getData ($key='', $index=null) | |
getDataByPath ($path) | |
getDataByKey ($key) | |
setDataUsingMethod ($key, $args=[]) | |
getDataUsingMethod ($key, $args=null) | |
hasData ($key='') | |
toArray (array $keys=[]) | |
convertToArray (array $keys=[]) | |
toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
toJson (array $keys=[]) | |
convertToJson (array $keys=[]) | |
toString ($format='') | |
__call ($method, $args) | |
isEmpty () | |
serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"') | |
debug ($data=null, &$objects=[]) | |
offsetSet ($offset, $value) | |
offsetExists ($offset) | |
offsetUnset ($offset) | |
offsetGet ($offset) | |
Static Public Member Functions | |
static | getAttributeType (\Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute) |
static | getDefaultBehavior () |
Data Fields | |
const | BEHAVIOR_APPEND = 'append' |
const | BEHAVIOR_ADD_UPDATE = 'add_update' |
const | BEHAVIOR_REPLACE = 'replace' |
const | BEHAVIOR_DELETE = 'delete' |
const | BEHAVIOR_CUSTOM = 'custom' |
const | FIELD_NAME_SOURCE_FILE = 'import_file' |
const | FIELD_NAME_IMG_ARCHIVE_FILE = 'import_image_archive' |
const | FIELD_NAME_IMG_FILE_DIR = 'import_images_file_dir' |
const | FIELD_NAME_ALLOWED_ERROR_COUNT = 'allowed_error_count' |
const | FIELD_NAME_VALIDATION_STRATEGY = 'validation_strategy' |
const | FIELD_FIELD_SEPARATOR = '_import_field_separator' |
const | FIELD_FIELD_MULTIPLE_VALUE_SEPARATOR = '_import_multiple_value_separator' |
const | FIELD_EMPTY_ATTRIBUTE_VALUE_CONSTANT = '_import_empty_attribute_value_constant' |
const | FIELDS_ENCLOSURE = 'fields_enclosure' |
const | DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR = ',' |
const | DEFAULT_EMPTY_ATTRIBUTE_VALUE_CONSTANT = '__EMPTY__VALUE__' |
const | DEFAULT_SIZE = 50 |
const | MAX_IMPORT_CHUNKS = 4 |
const | IMPORT_HISTORY_DIR = 'import_history/' |
const | IMPORT_DIR = 'import/' |
Protected Member Functions | |
_getEntityAdapter () | |
_getSourceAdapter ($sourceFile) | |
processImport () | |
_removeBom ($sourceFile) | |
createHistoryReport ($sourceFileRelative, $entity, $extension=null, $result=null) | |
![]() | |
_getData ($key) | |
_underscore ($name) | |
Protected Attributes | |
$_entityAdapter | |
$_importExportData = null | |
$_importConfig | |
$_entityFactory | |
$_importData | |
$_csvFactory | |
$_httpFactory | |
$_uploaderFactory | |
$indexerRegistry | |
$_behaviorFactory | |
$_filesystem | |
![]() | |
$_debugMode = false | |
$_debugReplacePrivateDataKeys = [] | |
$_logTrace = [] | |
$_logger | |
$_varDirectory | |
![]() | |
$_data = [] | |
Additional Inherited Members | |
![]() | |
static | $_underscoreCache = [] |
Import model
@api
@method string getBehavior() getBehavior() @method \Magento\ImportExport\Model\Import setEntity() setEntity(string $value) @SuppressWarnings(PHPMD.CouplingBetweenObjects) @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
Definition at line 26 of file Import.php.
__construct | ( | \Psr\Log\LoggerInterface | $logger, |
\Magento\Framework\Filesystem | $filesystem, | ||
\Magento\ImportExport\Helper\Data | $importExportData, | ||
\Magento\Framework\App\Config\ScopeConfigInterface | $coreConfig, | ||
\Magento\ImportExport\Model\Import\ConfigInterface | $importConfig, | ||
\Magento\ImportExport\Model\Import\Entity\Factory | $entityFactory, | ||
\Magento\ImportExport\Model\ResourceModel\Import\Data | $importData, | ||
\Magento\ImportExport\Model\Export\Adapter\CsvFactory | $csvFactory, | ||
\Magento\Framework\HTTP\Adapter\FileTransferFactory | $httpFactory, | ||
\Magento\MediaStorage\Model\File\UploaderFactory | $uploaderFactory, | ||
\Magento\ImportExport\Model\Source\Import\Behavior\Factory | $behaviorFactory, | ||
\Magento\Framework\Indexer\IndexerRegistry | $indexerRegistry, | ||
\Magento\ImportExport\Model\History | $importHistoryModel, | ||
DateTime | $localeDate, | ||
array | $data = [] |
||
) |
\Psr\Log\LoggerInterface | $logger | |
\Magento\Framework\Filesystem | $filesystem | |
\Magento\ImportExport\Helper\Data | $importExportData | |
\Magento\Framework\App\Config\ScopeConfigInterface | $coreConfig | |
Import\ConfigInterface | $importConfig | |
Import\Entity\Factory | $entityFactory | |
\Magento\ImportExport\Model\ResourceModel\Import\Data | $importData | |
Export\Adapter\CsvFactory | $csvFactory | |
FileTransferFactory | $httpFactory | |
\Magento\MediaStorage\Model\File\UploaderFactory | $uploaderFactory | |
Source\Import\Behavior\Factory | $behaviorFactory | |
\Magento\Framework\Indexer\IndexerRegistry | $indexerRegistry | |
History | $importHistoryModel | |
DateTime | $localeDate | |
array | $data | @SuppressWarnings(PHPMD.ExcessiveParameterList) |
Definition at line 200 of file Import.php.
|
protected |
Create instance of entity adapter and return it
Definition at line 239 of file Import.php.
|
protected |
Returns source adapter object.
string | $sourceFile | Full path to source file |
Definition at line 285 of file Import.php.
|
protected |
Remove BOM from a file
string | $sourceFile |
Definition at line 577 of file Import.php.
|
protected |
Create history report
string | $sourceFileRelative | |
string | $entity | |
string | $extension | |
array | $result |
Definition at line 758 of file Import.php.
|
static |
Get attribute type for upcoming validation.
\Magento\Eav\Model\Entity\Attribute\AbstractAttribute | \Magento\Eav\Model\Entity\Attribute | $attribute |
Definition at line 345 of file Import.php.
getCreatedItemsCount | ( | ) |
getDataSourceModel | ( | ) |
DB data source model getter.
Definition at line 362 of file Import.php.
|
static |
getDeletedItemsCount | ( | ) |
getEntity | ( | ) |
getErrorAggregator | ( | ) |
Provides error aggregator.
Definition at line 489 of file Import.php.
getOperationResultMessages | ( | ProcessingErrorAggregatorInterface | $validationResult | ) |
Return operation result messages
ProcessingErrorAggregatorInterface | $validationResult |
Definition at line 301 of file Import.php.
getProcessedEntitiesCount | ( | ) |
Returns number of checked entities.
Definition at line 398 of file Import.php.
getProcessedRowsCount | ( | ) |
getUniqueEntityBehaviors | ( | ) |
Get array of unique entity behaviors array( <behavior_model_code> => <behavior_class_name>, ... )
Definition at line 703 of file Import.php.
getUpdatedItemsCount | ( | ) |
getWorkingDir | ( | ) |
Import/Export working directory (source files, result files, lock files etc.).
Definition at line 419 of file Import.php.
importSource | ( | ) |
Import source file structure to DB.
Definition at line 430 of file Import.php.
invalidateIndex | ( | ) |
Invalidate indexes by process codes.
Definition at line 636 of file Import.php.
isImportAllowed | ( | ) |
isReportEntityType | ( | $entity = null | ) |
Retrieve processed reports entity types
string | null | $entity |
Definition at line 723 of file Import.php.
|
protected |
uploadFileAndGetSource | ( | ) |
Move uploaded file and provide source instance.
Definition at line 557 of file Import.php.
validateSource | ( | \Magento\ImportExport\Model\Import\AbstractSource | $source | ) |
Validates source file and returns validation result
Before validate data the method requires to initialize error aggregator (ProcessingErrorAggregatorInterface) with 'validation strategy' and 'allowed error count' values to allow using this parameters in validation process.
\Magento\ImportExport\Model\Import\AbstractSource | $source |
Definition at line 597 of file Import.php.
|
protected |
Definition at line 165 of file Import.php.
|
protected |
Definition at line 145 of file Import.php.
|
protected |
#- #-
Definition at line 118 of file Import.php.
|
protected |
Definition at line 135 of file Import.php.
|
protected |
Definition at line 170 of file Import.php.
|
protected |
Definition at line 150 of file Import.php.
|
protected |
Definition at line 130 of file Import.php.
|
protected |
Definition at line 140 of file Import.php.
|
protected |
Definition at line 125 of file Import.php.
|
protected |
Definition at line 155 of file Import.php.
|
protected |
Definition at line 160 of file Import.php.
const BEHAVIOR_ADD_UPDATE = 'add_update' |
Definition at line 33 of file Import.php.
const BEHAVIOR_APPEND = 'append' |
#+ Import behaviors
Definition at line 31 of file Import.php.
const BEHAVIOR_CUSTOM = 'custom' |
Definition at line 39 of file Import.php.
const BEHAVIOR_DELETE = 'delete' |
Definition at line 37 of file Import.php.
const BEHAVIOR_REPLACE = 'replace' |
Definition at line 35 of file Import.php.
const DEFAULT_EMPTY_ATTRIBUTE_VALUE_CONSTANT = '__EMPTY__VALUE__' |
default empty attribute value constant
Definition at line 102 of file Import.php.
const DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR = ',' |
#- default delimiter for several values in one cell as default for FIELD_FIELD_MULTIPLE_VALUE_SEPARATOR
Definition at line 97 of file Import.php.
const DEFAULT_SIZE = 50 |
#+ Import constants
Definition at line 107 of file Import.php.
const FIELD_EMPTY_ATTRIBUTE_VALUE_CONSTANT = '_import_empty_attribute_value_constant' |
Import empty attribute value constant.
Definition at line 85 of file Import.php.
const FIELD_FIELD_MULTIPLE_VALUE_SEPARATOR = '_import_multiple_value_separator' |
Import multiple value separator.
Definition at line 80 of file Import.php.
const FIELD_FIELD_SEPARATOR = '_import_field_separator' |
Import field separator.
Definition at line 75 of file Import.php.
const FIELD_NAME_ALLOWED_ERROR_COUNT = 'allowed_error_count' |
Allowed errors count field name
Definition at line 65 of file Import.php.
const FIELD_NAME_IMG_ARCHIVE_FILE = 'import_image_archive' |
Import image archive.
Definition at line 55 of file Import.php.
const FIELD_NAME_IMG_FILE_DIR = 'import_images_file_dir' |
Import images file directory.
Definition at line 60 of file Import.php.
const FIELD_NAME_SOURCE_FILE = 'import_file' |
#- #+ Form field names (and IDs)Import source file.
Definition at line 50 of file Import.php.
const FIELD_NAME_VALIDATION_STRATEGY = 'validation_strategy' |
Validation startegt field name
Definition at line 70 of file Import.php.
const FIELDS_ENCLOSURE = 'fields_enclosure' |
Allow multiple values wrapping in double quotes for additional attributes.
Definition at line 90 of file Import.php.
const IMPORT_DIR = 'import/' |
Definition at line 113 of file Import.php.
const IMPORT_HISTORY_DIR = 'import_history/' |
Definition at line 111 of file Import.php.
const MAX_IMPORT_CHUNKS = 4 |
Definition at line 109 of file Import.php.