OXID eShop CE
6.1.5
|
Public Member Functions | |
init () | |
getImportObject ($type) | |
setImportType ($type) | |
setCsvFileFieldsOrder ($csvFields) | |
setCsvContainsHeader ($csvContainsHeader) | |
importFile ($importFilePath=null) | |
importData ($data) | |
getStatistics () | |
getImportedRowCount () | |
getImportObjectsList () | |
Public Attributes | |
const | ERROR_USER_NO_RIGHTS = 'Not sufficient rights to perform operation!' |
const | ERROR_NO_INIT = 'Init not executed, Access denied!' |
Protected Member Functions | |
importOne ($data) | |
afterImport ($data) | |
getImportType () | |
addImportedId ($id) | |
mapFields ($data) | |
csvTextConvert ($text, $mode) | |
getCsvFieldsTerminator () | |
getCsvFieldsEncolser () | |
checkAccess ($importObject, $isWriteAction) | |
createImportObject ($type) | |
Protected Attributes | |
$objects | |
$importType = null | |
$importedIds = [] | |
$returnMessage | |
$defaultStringTerminator = ';' | |
$defaultStringEncloser = '"' | |
$csvContainsHeader = null | |
$importFilePath | |
$isInitialized = false | |
$userId = null | |
$statistics = [] | |
$retried = false | |
$csvFileFieldsOrder = [] | |
$maxLineLength = 8192 | |
Class responsible for generic import functionality.
|
protected |
Adds true to $_aImportedIds where key is given.
mixed | $id | - given key |
|
protected |
Performs after import actions. If any error occurred during import tries to run import again and marks retried as true. If after running import second time all of the records failed, stops.
array | $data |
|
protected |
Checks if user has sufficient rights.
ImportObject | $importObject | Data type object |
boolean | $isWriteAction | Check for write permissions |
Exception |
|
protected |
Creates and returns import object.
string | $type | Type name in objects dir. |
|
protected |
Parses and replaces special chars.
string | $text | input text |
bool | $mode | true = Text2CSV, false = CSV2Text |
|
protected |
Get csv field encloser symbol.
|
protected |
Set csv field terminator symbol.
OxidEsales\EshopCommunity\Core\GenericImport\GenericImport::getImportedRowCount | ( | ) |
Returns count of imported rows, total, during import.
OxidEsales\EshopCommunity\Core\GenericImport\GenericImport::getImportObject | ( | $type | ) |
Get import object according import type.
string | $type | Import object type. |
OxidEsales\EshopCommunity\Core\GenericImport\GenericImport::getImportObjectsList | ( | ) |
Returns allowed for import objects list.
|
protected |
Gets import object type according type prefix.
Exception | if no such import type prefix |
OxidEsales\EshopCommunity\Core\GenericImport\GenericImport::getStatistics | ( | ) |
Returns statistics information about import.
OxidEsales\EshopCommunity\Core\GenericImport\GenericImport::importData | ( | $data | ) |
Performs import action.
array | $data |
OxidEsales\EshopCommunity\Core\GenericImport\GenericImport::importFile | ( | $importFilePath = null | ) |
Main import method, whole import of all types via a given csv file is done here.
string | $importFilePath | Full path of the CSV file. |
|
protected |
Main Import Handler, imports one row/call/object... returns true if there were any data processed, and master loop should run import again.
after importing, fills $this->_aStatistics[$this->_iIdx] with array of r=>(boolean)result, m=>(string)error message
array | $data |
OxidEsales\EshopCommunity\Core\GenericImport\GenericImport::init | ( | ) |
Init parameters needed for import. Creates Objects, checks Rights etc.
Exception |
|
protected |
Maps numeric array to assoc. Array
array | $data | numeric indices |
OxidEsales\EshopCommunity\Core\GenericImport\GenericImport::setCsvContainsHeader | ( | $csvContainsHeader | ) |
Set if CSV file contains header row.
bool | $csvContainsHeader | Whether imported file has a header row. |
OxidEsales\EshopCommunity\Core\GenericImport\GenericImport::setCsvFileFieldsOrder | ( | $csvFields | ) |
Set CSV file columns names.
array | $csvFields | CSV fields. |
OxidEsales\EshopCommunity\Core\GenericImport\GenericImport::setImportType | ( | $type | ) |
Set import object type prefix.
string | $type | Import type prefix. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
const OxidEsales\EshopCommunity\Core\GenericImport\GenericImport::ERROR_NO_INIT = 'Init not executed, Access denied!' |
const OxidEsales\EshopCommunity\Core\GenericImport\GenericImport::ERROR_USER_NO_RIGHTS = 'Not sufficient rights to perform operation!' |